From d107891d94067d9138aeb7b533f64b6313af6a63 Mon Sep 17 00:00:00 2001 From: jashmehta3300 Date: Thu, 10 Aug 2023 11:29:52 -0400 Subject: [PATCH] Updating helm, depricating standalone k8 deployement file Co-authored-by: pkalapat@gmail.com --- .github/workflows/build_and_push_images.yml | 2 + k8.yaml | 342 -------------------- martianbank/templates/k8.yaml | 16 +- martianbank/values.yaml | 8 +- 4 files changed, 18 insertions(+), 350 deletions(-) delete mode 100644 k8.yaml diff --git a/.github/workflows/build_and_push_images.yml b/.github/workflows/build_and_push_images.yml index 1c721fb..4d050dd 100644 --- a/.github/workflows/build_and_push_images.yml +++ b/.github/workflows/build_and_push_images.yml @@ -33,6 +33,8 @@ jobs: context: . - name: transactions context: . + - name: locust + context: . steps: - name: Checkout repository diff --git a/k8.yaml b/k8.yaml deleted file mode 100644 index fa51d26..0000000 --- a/k8.yaml +++ /dev/null @@ -1,342 +0,0 @@ -# Copyright (c) 2023 Cisco Systems, Inc. and its affiliates All rights reserved. -# Use of this source code is governed by a BSD-style -# license that can be found in the LICENSE file. - -# You can tell Kubernetes how to identify your microservice by using labels - -# UI -apiVersion: apps/v1 -kind: Deployment -metadata: - name: ui - labels: - app: ui -spec: - replicas: 1 - selector: - matchLabels: - app: ui - template: - metadata: - labels: - app: ui - spec: - containers: - - name: ui - image: ghcr.io/cisco-open/martian-bank-demo-ui - ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: dashboard - labels: - app: dashboard -spec: - replicas: 1 - selector: - matchLabels: - app: dashboard - template: - metadata: - labels: - app: dashboard - spec: - containers: - - name: dashboard - image: ghcr.io/cisco-open/martian-bank-demo-dashboard - env: - - name: ACCOUNT_HOST - value: accounts - - name: LOAN_HOST - value: loan - - name: TRANSACTION_HOST - value: transactions - - ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: accounts - labels: - app: accounts -spec: - replicas: 1 - selector: - matchLabels: - app: accounts - template: - metadata: - labels: - app: accounts - spec: - containers: - - name: accounts - image: ghcr.io/cisco-open/martian-bank-demo-accounts -# loan ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: loan - labels: - app: loan -spec: - replicas: 1 - selector: - matchLabels: - app: loan - template: - metadata: - labels: - app: loan - spec: - containers: - - name: loan - # registry: docker.io - image: ghcr.io/cisco-open/martian-bank-demo-loan - -# transactions - ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: transactions - labels: - app: transactions -spec: - replicas: 1 - selector: - matchLabels: - app: transactions - template: - metadata: - labels: - app: transactions - spec: - containers: - - name: transactions - image: ghcr.io/cisco-open/martian-bank-demo-transactions - - -# customer-auth - ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: customer-auth - labels: - app: customer-auth -spec: - replicas: 1 - selector: - matchLabels: - app: customer-auth - template: - metadata: - labels: - app: customer-auth - spec: - containers: - - name: customer-auth - image: ghcr.io/cisco-open/martian-bank-demo-customer-auth - - -# atm-locator ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: atm-locator - labels: - app: atm-locator -spec: - replicas: 1 - selector: - matchLabels: - app: atm-locator - template: - metadata: - labels: - app: atm-locator - spec: - containers: - - name: atm-locator - image: ghcr.io/cisco-open/martian-bank-demo-atm-locator - -# nginx ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: nginx - labels: - app: nginx -spec: - replicas: 1 - selector: - matchLabels: - app: nginx - template: - metadata: - labels: - app: nginx - spec: - containers: - - name: nginx - image: ghcr.io/cisco-open/martian-bank-demo-nginx - - -# make mongodb deployemnt ---- - -apiVersion: v1 -kind: Pod -metadata: - name: mongo-pod -spec: - containers: - - name: mongo - image: mongo - env: - - name: MONGO_INITDB_ROOT_USERNAME - value: root - - name: MONGO_INITDB_ROOT_PASSWORD - value: example - ports: - - containerPort: 27017 - name: mongodb - - - - - - - - - -# Service - ---- -apiVersion: v1 -kind: Service -metadata: - name: nginx -spec: - type: LoadBalancer - selector: - app: nginx - ports: - - protocol: TCP - port: 80 - targetPort: 80 - ---- -apiVersion: v1 -kind: Service -metadata: - name: customer-auth -spec: - selector: - app: customer-auth - ports: - - protocol: TCP - port: 8000 - targetPort: 8000 - ---- -apiVersion: v1 -kind: Service -metadata: - name: atm-locator -spec: - selector: - app: atm-locator - ports: - - protocol: TCP - port: 8001 - targetPort: 8001 - ---- -apiVersion: v1 -kind: Service -metadata: - name: ui -spec: - type: LoadBalancer - selector: - app: ui - ports: - - protocol: TCP - port: 3000 - targetPort: 3000 - ---- -apiVersion: v1 -kind: Service -metadata: - name: customer-auth -spec: - selector: - app: customer-auth - ports: - - protocol: TCP - port: 8000 - targetPort: 8000 - - ---- -apiVersion: v1 -kind: Service -metadata: - name: dashboard -spec: - type: LoadBalancer # This is the only line that is different from the previous service that this is accessible from outside - selector: - app: dashboard - ports: - - protocol: TCP - port: 5000 - targetPort: 5000 - ---- -apiVersion: v1 -kind: Service -metadata: - name: accounts -spec: - selector: - app: accounts - ports: - - protocol: TCP - port: 50051 - targetPort: 50051 - ---- -apiVersion: v1 -kind: Service -metadata: - name: loan -spec: - selector: - app: loan - ports: - - protocol: TCP - port: 50053 - targetPort: 50053 - ---- -apiVersion: v1 -kind: Service -metadata: - name: transactions -spec: - selector: - app: transactions - ports: - - protocol: TCP - port: 50052 - targetPort: 50052 diff --git a/martianbank/templates/k8.yaml b/martianbank/templates/k8.yaml index 1f10414..55ba483 100644 --- a/martianbank/templates/k8.yaml +++ b/martianbank/templates/k8.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: ui - image: docker.io/jashmehta3300/martian-bank-ui + image: ghcr.io/cisco-open/martian-bank-demo-ui env: {{- if .Values.nginx.enabled }} - name: VITE_USERS_URL @@ -79,7 +79,7 @@ spec: spec: containers: - name: dashboard - image: docker.io/jashmehta3300/martian-bank-dashboard + image: ghcr.io/cisco-open/martian-bank-demo-dashboard env: - name: SERVICE_PROTOCOL value: {{.Values.SERVICE_PROTOCOL}} @@ -132,7 +132,7 @@ spec: spec: containers: - name: customer-auth - image: docker.io/jashmehta3300/martian-bank-customer-auth + image: ghcr.io/cisco-open/martian-bank-demo-customer-auth env: {{- if not .Values.mongodb.enabled }} - name: DATABASE_HOST @@ -180,7 +180,7 @@ spec: spec: containers: - name: atm-locator - image: docker.io/jashmehta3300/martian-bank-atm-locator + image: ghcr.io/cisco-open/martian-bank-demo-atm-locator env: {{- if not .Values.mongodb.enabled }} - name: DATABASE_HOST @@ -230,7 +230,7 @@ spec: spec: containers: - name: nginx - image: docker.io/jashmehta3300/martian-bank-nginx + image: ghcr.io/cisco-open/martian-bank-demo-nginx --- apiVersion: v1 kind: Service @@ -247,6 +247,7 @@ spec: {{- end }} +{{- if .Values.locust.enabled }} # locust --- apiVersion: apps/v1 @@ -267,7 +268,7 @@ spec: spec: containers: - name: locust - image: docker.io/jashmehta3300/martian-bank-locust + image: ghcr.io/cisco-open/martian-bank-demo-locust env: - name: VITE_USERS_URL value: http://customer-auth:8000/api/users @@ -290,4 +291,5 @@ spec: ports: - protocol: TCP port: 8098 - targetPort: 8098 \ No newline at end of file + targetPort: 8098 +{{- end }} \ No newline at end of file diff --git a/martianbank/values.yaml b/martianbank/values.yaml index f491bcc..42e30ee 100644 --- a/martianbank/values.yaml +++ b/martianbank/values.yaml @@ -109,4 +109,10 @@ mongodb: enabled: false SERVICE_PROTOCOL: "http" -DB_URL: \ No newline at end of file +DB_URL: + +####################################################################################### +## Deploy locust + +locust: + enabled: false \ No newline at end of file