From 6e27a3c3a84d822e259c7416f995a62e66b60ba1 Mon Sep 17 00:00:00 2001 From: hkirat Date: Thu, 20 Jun 2024 10:58:31 +0530 Subject: [PATCH] Added ops --- ops/certificate.yml | 13 +++++++++++++ ops/deployment.yml | 33 +++++++++++++++++++++++++++++++++ ops/secret.yml | 7 +++++++ ops/service.yml | 12 ++++++++++++ 4 files changed, 65 insertions(+) create mode 100644 ops/certificate.yml create mode 100644 ops/deployment.yml create mode 100644 ops/secret.yml create mode 100644 ops/service.yml diff --git a/ops/certificate.yml b/ops/certificate.yml new file mode 100644 index 000000000..90ac8393c --- /dev/null +++ b/ops/certificate.yml @@ -0,0 +1,13 @@ +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: cms-cert + namespace: default +spec: + secretName: cms-tls + issuerRef: + name: letsencrypt-prod + kind: ClusterIssuer + commonName: app.100xdevs.com + dnsNames: + - app.100xdevs.com \ No newline at end of file diff --git a/ops/deployment.yml b/ops/deployment.yml new file mode 100644 index 000000000..53222ab7f --- /dev/null +++ b/ops/deployment.yml @@ -0,0 +1,33 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: cms + labels: + app: cms +spec: + replicas: 3 + selector: + matchLabels: + app: cms + template: + metadata: + labels: + app: cms + spec: + containers: + - name: cms + image: 100xdevs/cms:1 + imagePullPolicy: Always + ports: + - containerPort: 3000 + volumeMounts: + - name: secret + mountPath: /usr/src/app/.env + subPath: .env + volumes: + - name: secret + secret: + secretName: cms-secret + items: + - key: .env + path: .env \ No newline at end of file diff --git a/ops/secret.yml b/ops/secret.yml new file mode 100644 index 000000000..5e1b05a85 --- /dev/null +++ b/ops/secret.yml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: Secret +metadata: + name: cms-secret +type: Opaque +data: + .env: \ No newline at end of file diff --git a/ops/service.yml b/ops/service.yml new file mode 100644 index 000000000..271cd9f9c --- /dev/null +++ b/ops/service.yml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: cms +spec: + selector: + app: cms + ports: + - protocol: TCP + port: 80 + targetPort: 3000 + type: ClusterIP \ No newline at end of file