-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creates dev microk8s environment using skaffold (#4)
* Creates dev microk8s environment using skaffold * Add app label to service too * Update readme to use kubectl instead of microk8s.kubectl * Small improvements
- Loading branch information
Showing
6 changed files
with
196 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# Git | ||
.git | ||
.gitignore | ||
.gitattributes | ||
|
||
|
||
# CI | ||
.codeclimate.yml | ||
.travis.yml | ||
.taskcluster.yml | ||
|
||
# Docker | ||
docker-compose.yml | ||
Dockerfile | ||
.docker | ||
.dockerignore | ||
|
||
# Byte-compiled / optimized / DLL files | ||
**/__pycache__/ | ||
**/*.py[cod] | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Virtual environment | ||
.env | ||
.venv/ | ||
venv/ | ||
|
||
# PyCharm | ||
.idea | ||
|
||
# Python mode for VIM | ||
.ropeproject | ||
**/.ropeproject | ||
|
||
# Vim swap files | ||
**/*.swp | ||
|
||
# VS Code | ||
.vscode/ | ||
|
||
# No need for markdowns like README in container | ||
*.md | ||
|
||
# Emacs | ||
flycheck* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM python:3.10 | ||
|
||
EXPOSE 30000 | ||
|
||
WORKDIR /home/app | ||
|
||
COPY poetry.lock . | ||
|
||
COPY pyproject.toml . | ||
|
||
RUN pip install poetry && \ | ||
poetry config virtualenvs.create false && \ | ||
poetry install --no-interaction --no-ansi --without dev | ||
|
||
COPY . . | ||
|
||
CMD [ "uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "30000", "--reload" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: api | ||
labels: | ||
app: api | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: api | ||
template: | ||
metadata: | ||
labels: | ||
app: api | ||
spec: | ||
containers: | ||
- name: api | ||
image: localhost:32000/api | ||
ports: | ||
- containerPort: 30000 | ||
|
||
--- | ||
|
||
# Expose port on localhost | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: api-service | ||
labels: | ||
app: api | ||
spec: | ||
type: NodePort | ||
selector: | ||
app: api | ||
ports: | ||
- port: 30000 | ||
nodePort: 30000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
apiVersion: skaffold/v4beta4 | ||
kind: Config | ||
metadata: | ||
name: api | ||
build: | ||
artifacts: | ||
- image: localhost:32000/api | ||
docker: | ||
dockerfile: Dockerfile | ||
# Sync these files to avoid rebuilding images | ||
sync: | ||
manual: | ||
- dest: "src/" | ||
src: "src/**" | ||
strip: "src/" | ||
- dest: "tests/" | ||
src: "tests/**" | ||
strip: "tests/" | ||
# Use microk8s registry | ||
insecureRegistries: | ||
- localhost:32000 | ||
manifests: | ||
rawYaml: | ||
- k8s.yaml | ||
deploy: | ||
kubeContext: microk8s |