diff --git a/Kubernetes-Manifests-file/Backend/deployment.yaml b/Kubernetes-Manifests-file/Backend/deployment.yaml new file mode 100644 index 0000000..dce24db --- /dev/null +++ b/Kubernetes-Manifests-file/Backend/deployment.yaml @@ -0,0 +1,57 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: api + namespace: three-tier + labels: + role: api + env: demo +spec: + replicas: 2 + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 1 + maxUnavailable: 25% + selector: + matchLabels: + role: api + template: + metadata: + labels: + role: api + spec: + imagePullSecrets: + - name: ecr-registry-secret + containers: + - name: api + image: 407622020962.dkr.ecr.us-east-1.amazonaws.com/backend:latest + imagePullPolicy: Always + env: + - name: MONGO_CONN_STR + value: mongodb://mongodb-svc:27017/todo?directConnection=true + - name: MONGO_USERNAME + valueFrom: + secretKeyRef: + name: mongo-sec + key: username + - name: MONGO_PASSWORD + valueFrom: + secretKeyRef: + name: mongo-sec + key: password + ports: + - containerPort: 3500 + livenessProbe: + httpGet: + path: /ok + port: 3500 + initialDelaySeconds: 2 + periodSeconds: 5 + readinessProbe: + httpGet: + path: /ok + port: 3500 + initialDelaySeconds: 5 + periodSeconds: 5 + successThreshold: 1