From cbcbe8dd87cf00e97afdd3ad83687674723ecb43 Mon Sep 17 00:00:00 2001 From: att1106 Date: Tue, 14 Nov 2023 16:17:40 -0500 Subject: [PATCH] Added Kubernetes support --- deploy/deployment.yaml | 44 ++++++++++++++++++++++++++++++++++++++++++ deploy/service.yaml | 17 ++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 deploy/deployment.yaml create mode 100644 deploy/service.yaml diff --git a/deploy/deployment.yaml b/deploy/deployment.yaml new file mode 100644 index 0000000..1d661ed --- /dev/null +++ b/deploy/deployment.yaml @@ -0,0 +1,44 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + creationTimestamp: null + labels: + app: accounts + name: accounts +spec: + replicas: 3 + selector: + matchLabels: + app: accounts + strategy: {} + template: + metadata: + creationTimestamp: null + labels: + app: accounts + spec: + containers: + - image: us.icr.io/sn-labs-anhtuantran3/accounts:1 + name: accounts + resources: {} + + env: + - name: DATABASE_HOST + value: postgresql + - name: DATABASE_NAME + valueFrom: + secretKeyRef: + name: postgresql + key: database-name + - name: DATABASE_PASSWORD + valueFrom: + secretKeyRef: + name: postgresql + key: database-password + - name: DATABASE_USER + valueFrom: + secretKeyRef: + name: postgresql + key: database-user +status: {} + diff --git a/deploy/service.yaml b/deploy/service.yaml new file mode 100644 index 0000000..a17af59 --- /dev/null +++ b/deploy/service.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + creationTimestamp: null + labels: + app: accounts + name: accounts +spec: + ports: + - port: 8080 + protocol: TCP + targetPort: 8080 + selector: + app: accounts + type: ClusterIP +status: + loadBalancer: {}