diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2bc0dd0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM python:3.7 + +RUN mkdir /app +WORKDIR /app +ADD . /app/ +RUN pip install -r app/requirements.txt + +EXPOSE 5000 +CMD ["python", "app/main.py"] \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index ce620c2..0000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM python:3.7 - -RUN mkdir /app -WORKDIR /app -ADD . /app/ -RUN pip install -r requirements.txt - -EXPOSE 5000 -CMD ["python", "/app/main.py"] \ No newline at end of file diff --git a/kubernetes/deployment.yaml b/kubernetes/deployment.yaml index fdaeb8e..5c984e5 100644 --- a/kubernetes/deployment.yaml +++ b/kubernetes/deployment.yaml @@ -12,21 +12,50 @@ spec: type: LoadBalancer +# --- +# apiVersion: apps/v1 +# kind: Deployment +# metadata: +# name: hello-python +# # labels: +# # app: hello-python +# spec: +# replicas: 4 +# selector: +# matchLabels: +# app: hello-python +# version: v1 +# template: +# metadata: +# labels: +# app: hello-python +# spec: +# containers: +# - name: hello-python +# image: hello-python:latest +# imagePullPolicy: Never +# ports: +# - containerPort: 5000 + --- -apiVersion: apps/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: hello-python + labels: + app: hello-python spec: - replicas: 4 + replicas: 3 + selector: + matchLabels: + app: hello-python-pod template: metadata: labels: - app: hello-python + app: hello-python-pod spec: containers: - - name: hello-python - image: hello-python:latest - imagePullPolicy: Never + - name: hello-python-pod + image: adaverse/hello-flask:latest ports: - containerPort: 5000 diff --git a/kubernetes/kaniko-executor.yaml b/kubernetes/kaniko-executor.yaml new file mode 100644 index 0000000..94af2c8 --- /dev/null +++ b/kubernetes/kaniko-executor.yaml @@ -0,0 +1,23 @@ +apiVersion: v1 +kind: Pod +metadata: + name: kaniko +spec: + containers: + - name: kaniko + image: adaverse/kaniko-executor:latest + args: [ "--context=git://github.com/Adaverse/hello-python", + "--destination=adaverse/hello-flask"] # replace with your dockerhub account + volumeMounts: + - name: kaniko-secret + mountPath: /kaniko/.docker + restartPolicy: Never + volumes: + - name: kaniko-secret + secret: + secretName: regcred + items: + - key: .dockerconfigjson + path: config.json + imagePullSecrets: + - name: regcred \ No newline at end of file