From 8747d33d366d880d41199c5a8657c01c8a34c0e1 Mon Sep 17 00:00:00 2001 From: benjamin Oguntoye Date: Tue, 30 Aug 2022 21:11:11 +0300 Subject: [PATCH] v1 --- aws-secret.yaml | 9 +++ env-configmap.yaml | 14 ++++ env-secret.yaml | 9 +++ udagram-api-feed/backend-feed-deployment.yaml | 72 +++++++++++++++++++ udagram-api-feed/backend-feed-service.yaml | 12 ++++ udagram-api-user/backend-user-deployment.yaml | 72 +++++++++++++++++++ udagram-api-user/backend-user-service.yaml | 12 ++++ udagram-frontend/frontend-deployment.yaml | 72 +++++++++++++++++++ udagram-frontend/frontend-service.yaml | 12 ++++ .../reverseproxy-deployment.yaml | 72 +++++++++++++++++++ .../reverseproxy-service.yaml | 12 ++++ 11 files changed, 368 insertions(+) create mode 100644 aws-secret.yaml create mode 100644 env-configmap.yaml create mode 100644 env-secret.yaml create mode 100644 udagram-api-feed/backend-feed-deployment.yaml create mode 100644 udagram-api-feed/backend-feed-service.yaml create mode 100644 udagram-api-user/backend-user-deployment.yaml create mode 100644 udagram-api-user/backend-user-service.yaml create mode 100644 udagram-frontend/frontend-deployment.yaml create mode 100644 udagram-frontend/frontend-service.yaml create mode 100644 udagram-reverseproxy/reverseproxy-deployment.yaml create mode 100644 udagram-reverseproxy/reverseproxy-service.yaml diff --git a/aws-secret.yaml b/aws-secret.yaml new file mode 100644 index 0000000..5775c47 --- /dev/null +++ b/aws-secret.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: Secret +metadata: + name: aws-secret +type: Opaque +data: + AWS_USER: YXdzX2FjY2Vzc19rZXlfaWQgPSBBS0lBVDZQM0JOV0JQWEVBMkpGTQphd3Nfc2VjcmV0X2FjY2Vzc19rZXkgPSA1bFFjV2d6eTBvUlhBS1FKbWpZTEVlQTNyUnllSXhselphVnpkTENnCg== + # aws_access_key_id: YXdzX2FjY2Vzc19rZXlfaWQgPSBBS0lBVDZQM0JOV0JQWEVBMkpGTQphd3Nfc2VjcmV0X2FjY2Vz + # aws_secret_access_key: c19rZXkgPSA1bFFjV2d6eTBvUlhBS1FKbWpZTEVlQTNyUnllSXhselphVnpkTENnCg== diff --git a/env-configmap.yaml b/env-configmap.yaml new file mode 100644 index 0000000..c277c63 --- /dev/null +++ b/env-configmap.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: env-configmap + labels: + app: env-configmap +data: + POSTGRES_HOST: micro-database-2.cuxfohxmwd2x.us-east-1.rds.amazonaws.com + POSTGRES_DB: postgres + AWS_BUCKET: project3-271646289282-dev + AWS_REGION: us-east-1 + AWS_PROFILE: default + JWT_SECRET: testing + URL: http://localhost:8080 diff --git a/env-secret.yaml b/env-secret.yaml new file mode 100644 index 0000000..ea27586 --- /dev/null +++ b/env-secret.yaml @@ -0,0 +1,9 @@ +# {"POSTGRES_USERNAME": "postgres", "POSTGRES_PASSWORD": "joey1234"} +apiVersion: v1 +kind: Secret +metadata: + name: env-secret +type: Opaque +data: + POSTGRES_USERNAME: postgres + POSTGRES_PASSWORD: joey1234 diff --git a/udagram-api-feed/backend-feed-deployment.yaml b/udagram-api-feed/backend-feed-deployment.yaml new file mode 100644 index 0000000..a2a1a50 --- /dev/null +++ b/udagram-api-feed/backend-feed-deployment.yaml @@ -0,0 +1,72 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: udagram-api-feed + labels: + app: udagram-api-feed +spec: + replicas: 2 + selector: + matchLabels: + app: udagram-api-feed + template: + metadata: + labels: + app: udagram-api-feed + spec: + containers: + - name: docker-kubernates + image: jlord31/udagram-api-feed + ports: + - containerPort: 8080 + env: + - name: AWS_USER + valueFrom: + secretKeyRef: + name: aws-secret + key: AWS_USER + - name: POSTGRES_USERNAME + valueFrom: + secretKeyRef: + name: env-secret + key: POSTGRES_USERNAME + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: env-secret + key: POSTGRES_PASSWORD + - name: POSTGRES_HOST + valueFrom: + configMapKeyRef: + name: env-configmap + key: POSTGRES_HOST + - name: POSTGRES_DB + valueFrom: + configMapKeyRef: + name: env-configmap + key: POSTGRES_DB + - name: AWS_BUCKET + valueFrom: + configMapKeyRef: + name: env-configmap + key: AWS_BUCKET + - name: AWS_REGION + valueFrom: + configMapKeyRef: + name: env-configmap + key: AWS_REGION + - name: AWS_PROFILE + valueFrom: + configMapKeyRef: + name: env-configmap + key: AWS_PROFILE + - name: JWT_SECRET + valueFrom: + configMapKeyRef: + name: env-configmap + key: JWT_SECRET + - name: URL + valueFrom: + configMapKeyRef: + name: env-configmap + key: URL diff --git a/udagram-api-feed/backend-feed-service.yaml b/udagram-api-feed/backend-feed-service.yaml new file mode 100644 index 0000000..87aca34 --- /dev/null +++ b/udagram-api-feed/backend-feed-service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: udagram-api-feed + labels: + run: udagram-api-feed +spec: + ports: + - port: 8080 + protocol: TCP + selector: + run: udagram-api-feed diff --git a/udagram-api-user/backend-user-deployment.yaml b/udagram-api-user/backend-user-deployment.yaml new file mode 100644 index 0000000..0426f03 --- /dev/null +++ b/udagram-api-user/backend-user-deployment.yaml @@ -0,0 +1,72 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: udagram-user-feed + labels: + app: udagram-user-feed +spec: + replicas: 2 + selector: + matchLabels: + app: udagram-user-feed + template: + metadata: + labels: + app: udagram-user-feed + spec: + containers: + - name: docker-kubernates + image: jlord31/udagram-user-feed + ports: + - containerPort: 8080 + env: + - name: AWS_USER + valueFrom: + secretKeyRef: + name: aws-secret + key: AWS_USER + - name: POSTGRES_USERNAME + valueFrom: + secretKeyRef: + name: env-secret + key: POSTGRES_USERNAME + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: env-secret + key: POSTGRES_PASSWORD + - name: POSTGRES_HOST + valueFrom: + configMapKeyRef: + name: env-configmap + key: POSTGRES_HOST + - name: POSTGRES_DB + valueFrom: + configMapKeyRef: + name: env-configmap + key: POSTGRES_DB + - name: AWS_BUCKET + valueFrom: + configMapKeyRef: + name: env-configmap + key: AWS_BUCKET + - name: AWS_REGION + valueFrom: + configMapKeyRef: + name: env-configmap + key: AWS_REGION + - name: AWS_PROFILE + valueFrom: + configMapKeyRef: + name: env-configmap + key: AWS_PROFILE + - name: JWT_SECRET + valueFrom: + configMapKeyRef: + name: env-configmap + key: JWT_SECRET + - name: URL + valueFrom: + configMapKeyRef: + name: env-configmap + key: URL diff --git a/udagram-api-user/backend-user-service.yaml b/udagram-api-user/backend-user-service.yaml new file mode 100644 index 0000000..08c9e24 --- /dev/null +++ b/udagram-api-user/backend-user-service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: udagram-user-feed + labels: + run: udagram-user-feed +spec: + ports: + - port: 8080 + protocol: TCP + selector: + run: udagram-user-feed diff --git a/udagram-frontend/frontend-deployment.yaml b/udagram-frontend/frontend-deployment.yaml new file mode 100644 index 0000000..d16a8d6 --- /dev/null +++ b/udagram-frontend/frontend-deployment.yaml @@ -0,0 +1,72 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: udagram-frontend + labels: + app: udagram-frontend +spec: + replicas: 2 + selector: + matchLabels: + app: udagram-frontend + template: + metadata: + labels: + app: udagram-frontend + spec: + containers: + - name: docker-kubernates + image: jlord31/udagram-frontend + ports: + - containerPort: 8100 + env: + - name: AWS_USER + valueFrom: + secretKeyRef: + name: aws-secret + key: AWS_USER + - name: POSTGRES_USERNAME + valueFrom: + secretKeyRef: + name: env-secret + key: POSTGRES_USERNAME + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: env-secret + key: POSTGRES_PASSWORD + - name: POSTGRES_HOST + valueFrom: + configMapKeyRef: + name: env-configmap + key: POSTGRES_HOST + - name: POSTGRES_DB + valueFrom: + configMapKeyRef: + name: env-configmap + key: POSTGRES_DB + - name: AWS_BUCKET + valueFrom: + configMapKeyRef: + name: env-configmap + key: AWS_BUCKET + - name: AWS_REGION + valueFrom: + configMapKeyRef: + name: env-configmap + key: AWS_REGION + - name: AWS_PROFILE + valueFrom: + configMapKeyRef: + name: env-configmap + key: AWS_PROFILE + - name: JWT_SECRET + valueFrom: + configMapKeyRef: + name: env-configmap + key: JWT_SECRET + - name: URL + valueFrom: + configMapKeyRef: + name: env-configmap + key: URL diff --git a/udagram-frontend/frontend-service.yaml b/udagram-frontend/frontend-service.yaml new file mode 100644 index 0000000..fd967a2 --- /dev/null +++ b/udagram-frontend/frontend-service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: udagram-frontend + labels: + run: udagram-frontend +spec: + ports: + - port: 8100 + protocol: TCP + selector: + run: udagram-frontend diff --git a/udagram-reverseproxy/reverseproxy-deployment.yaml b/udagram-reverseproxy/reverseproxy-deployment.yaml new file mode 100644 index 0000000..ee4f559 --- /dev/null +++ b/udagram-reverseproxy/reverseproxy-deployment.yaml @@ -0,0 +1,72 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: udagram-reverseproxy + labels: + app: udagram-reverseproxy +spec: + replicas: 2 + selector: + matchLabels: + app: udagram-reverseproxy + template: + metadata: + labels: + app: udagram-reverseproxy + spec: + containers: + - name: docker-kubernates + image: jlord31/reverseproxy + ports: + - containerPort: 8080 + env: + - name: AWS_USER + valueFrom: + secretKeyRef: + name: aws-secret + key: AWS_USER + - name: POSTGRES_USERNAME + valueFrom: + secretKeyRef: + name: env-secret + key: POSTGRES_USERNAME + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: env-secret + key: POSTGRES_PASSWORD + - name: POSTGRES_HOST + valueFrom: + configMapKeyRef: + name: env-configmap + key: POSTGRES_HOST + - name: POSTGRES_DB + valueFrom: + configMapKeyRef: + name: env-configmap + key: POSTGRES_DB + - name: AWS_BUCKET + valueFrom: + configMapKeyRef: + name: env-configmap + key: AWS_BUCKET + - name: AWS_REGION + valueFrom: + configMapKeyRef: + name: env-configmap + key: AWS_REGION + - name: AWS_PROFILE + valueFrom: + configMapKeyRef: + name: env-configmap + key: AWS_PROFILE + - name: JWT_SECRET + valueFrom: + configMapKeyRef: + name: env-configmap + key: JWT_SECRET + - name: URL + valueFrom: + configMapKeyRef: + name: env-configmap + key: URL diff --git a/udagram-reverseproxy/reverseproxy-service.yaml b/udagram-reverseproxy/reverseproxy-service.yaml new file mode 100644 index 0000000..8dcd3a3 --- /dev/null +++ b/udagram-reverseproxy/reverseproxy-service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: udagram-reverseproxy + labels: + run: udagram-reverseproxy +spec: + ports: + - port: 8080 + protocol: TCP + selector: + run: udagram-reverseproxy