update cluster keys.

This commit is contained in:
Nawaz Dhandala 2021-07-12 15:16:38 +01:00
parent 35a9ddffbf
commit 3f09278222
7 changed files with 47 additions and 14 deletions

View File

@ -16,7 +16,7 @@ staging_container-scanner:
- sudo docker tag fyipeproject/container-scanner:master fyipeproject/container-scanner:3.0.$CI_PIPELINE_IID
- sudo docker push fyipeproject/container-scanner:3.0.$CI_PIPELINE_IID
- sudo docker push fyipeproject/container-scanner:master
- sudo kubectl --kubeconfig=/root/.kube/config set image deployment/fi-container fi-container=fyipeproject/container-scanner:3.0.$CI_PIPELINE_IID
- sudo kubectl --kubeconfig=/root/.kube/config set image deployment/fi-cont-scan fi-cont-scan=fyipeproject/container-scanner:3.0.$CI_PIPELINE_IID
# Cleanup
- chmod +x ./ci/scripts/deployment-cleanup.sh
- ./ci/scripts/deployment-cleanup.sh
@ -45,7 +45,7 @@ production_container-scanner:
- sudo docker tag fyipeproject/container-scanner:latest fyipeproject/container-scanner:3.0.$CI_PIPELINE_IID
- sudo docker push fyipeproject/container-scanner:3.0.$CI_PIPELINE_IID
- sudo docker push fyipeproject/container-scanner:latest
- sudo kubectl --kubeconfig=/root/.kube/config set image deployment/fi-container fi-container=fyipeproject/container-scanner:3.0.$CI_PIPELINE_IID
- sudo kubectl --kubeconfig=/root/.kube/config set image deployment/fi-cont-scan fi-cont-scan=fyipeproject/container-scanner:3.0.$CI_PIPELINE_IID
# Cleanup
- chmod +x ./ci/scripts/deployment-cleanup.sh
- ./ci/scripts/deployment-cleanup.sh

View File

@ -75,6 +75,7 @@ services:
- PROBE_NAME=Probe 1
- PROBE_KEY=test-key
- IS_SAAS_SERVICE=${IS_SAAS_SERVICE}
- CLUSTER_KEY=test
volumes:
- ./probe:/usr/src/app
# Use node modules of the container and not host system.
@ -134,6 +135,7 @@ services:
environment:
- IS_SAAS_SERVICE=${IS_SAAS_SERVICE}
- SERVER_URL=http://backend:3002
- CLUSTER_KEY=test
volumes:
- ./script-runner:/usr/src/app
# Use node modules of the container and not host system.
@ -155,6 +157,7 @@ services:
- REDIS_PORT=6379
- IS_SAAS_SERVICE=${IS_SAAS_SERVICE}
- SCRIPT_RUNNER_URL=http://script-runner:3009
- CLUSTER_KEY=test
depends_on:
- mongo
- redis
@ -280,6 +283,7 @@ services:
- APPLICATION_SCANNER_NAME=US
- APPPLICATION_SCANNER_KEY=test-key
- IS_SAAS_SERVICE=${IS_SAAS_SERVICE}
- CLUSTER_KEY=test
volumes:
- ./application-scanner:/usr/src/app
# Use node modules of the container and not host system.
@ -300,6 +304,7 @@ services:
- CONTAINER_SCANNER_NAME=US
- CONTAINER_SCANNER_KEY=test-key
- IS_SAAS_SERVICE=${IS_SAAS_SERVICE}
- CLUSTER_KEY=test
volumes:
- ./container-scanner:/usr/src/app
# Use node modules of the container and not host system.
@ -318,6 +323,7 @@ services:
- PORT=3015
- SERVER_URL=http://backend:3002
- IS_SAAS_SERVICE=${IS_SAAS_SERVICE}
- CLUSTER_KEY=test
volumes:
- ./lighthouse-runner:/usr/src/app
# Use node modules of the container and not host system.

View File

@ -34,6 +34,7 @@ services:
- REDIS_HOST=redis
- IS_SAAS_SERVICE=${IS_SAAS_SERVICE}
- SCRIPT_RUNNER_URL=http://script-runner:3009
- CLUSTER_KEY=test
depends_on:
- mongo
- redis
@ -119,6 +120,7 @@ services:
- PROBE_NAME=Probe 1
- PROBE_KEY=test-key
- IS_SAAS_SERVICE=${IS_SAAS_SERVICE}
- CLUSTER_KEY=test
depends_on:
- backend
probe2:
@ -133,6 +135,7 @@ services:
- PROBE_NAME=Probe 2
- PROBE_KEY=test-key
- IS_SAAS_SERVICE=${IS_SAAS_SERVICE}
- CLUSTER_KEY=test
depends_on:
- backend
api-docs:
@ -183,6 +186,7 @@ services:
environment:
- IS_SAAS_SERVICE=${IS_SAAS_SERVICE}
- SERVER_URL=http://backend:3002
- CLUSTER_KEY=test
application-scanner:
ports:
- '3005:3005'
@ -193,6 +197,7 @@ services:
- PORT=3005
- SERVER_URL=http://backend:3002
- IS_SAAS_SERVICE=${IS_SAAS_SERVICE}
- CLUSTER_KEY=test
depends_on:
- backend
container-scanner:
@ -205,6 +210,7 @@ services:
- PORT=3055
- SERVER_URL=http://backend:3002
- IS_SAAS_SERVICE=${IS_SAAS_SERVICE}
- CLUSTER_KEY=test
depends_on:
- backend
lighthouse-runner:
@ -217,6 +223,7 @@ services:
- PORT=3015
- SERVER_URL=http://backend:3002
- IS_SAAS_SERVICE=${IS_SAAS_SERVICE}
- CLUSTER_KEY=test
depends_on:
- backend

View File

@ -23,6 +23,11 @@ spec:
name: {{ printf "%s-%s" .Release.Name "app-scan" }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: CLUSTER_KEY
valueFrom:
configMapKeyRef:
name: {{ printf "%s-%s" $.Release.Name "configmap" }}
key: clusterkey
- name: NODE_ENV
value: 'production'
- name: PORT

View File

@ -2,25 +2,25 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ printf "%s-%s" .Release.Name "container-scanner" }}
name: {{ printf "%s-%s" .Release.Name "cont-scan" }}
namespace: {{ .Release.Namespace }}
labels:
app: {{ printf "%s-%s" .Release.Name "container-scanner" }}
app: {{ printf "%s-%s" .Release.Name "cont-scan" }}
app.kubernetes.io/part-of: fyipe
app.kubernetes.io/managed-by: Helm
spec:
selector:
matchLabels:
app: {{ printf "%s-%s" .Release.Name "container-scanner" }}
app: {{ printf "%s-%s" .Release.Name "cont-scan" }}
replicas: 1
template:
metadata:
labels:
app: {{ printf "%s-%s" .Release.Name "container-scanner" }}
app: {{ printf "%s-%s" .Release.Name "cont-scan" }}
spec:
containers:
- image: {{ printf "%s/%s/%s:%s" .Values.image.registry .Values.image.repository "container-scanner" .Values.image.tag }}
name: {{ printf "%s-%s" .Release.Name "container-scanner" }}
- image: {{ printf "%s/%s/%s:%s" .Values.image.registry .Values.image.repository "cont-scanner" .Values.image.tag }}
name: {{ printf "%s-%s" .Release.Name "cont-scan" }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: NODE_ENV
@ -31,10 +31,15 @@ spec:
value: {{ template "fyipe.serverUrl" $ }}
- name: IS_SAAS_SERVICE
value: 'true'
- name: CLUSTER_KEY
valueFrom:
configMapKeyRef:
name: {{ printf "%s-%s" $.Release.Name "configmap" }}
key: clusterkey
ports:
- containerPort: {{ .Values.host.containerScannerPort }}
hostPort: {{ .Values.host.containerScannerPort }}
name: {{ printf "%s-%s" .Release.Name "container-scanner" }}
name: {{ printf "%s-%s" .Release.Name "cont-scan" }}
restartPolicy: {{ .Values.image.restartPolicy }}
---
@ -43,17 +48,17 @@ apiVersion: v1
kind: Service
metadata:
labels:
app: {{ printf "%s-%s" .Release.Name "container-scanner" }}
app: {{ printf "%s-%s" .Release.Name "cont-scan" }}
app.kubernetes.io/part-of: fyipe
app.kubernetes.io/managed-by: Helm
name: {{ printf "%s-%s" .Release.Name "container-scanner" }}
name: {{ printf "%s-%s" .Release.Name "cont-scan" }}
namespace: {{ .Release.Namespace }}
spec:
ports:
- port: {{ .Values.host.containerScannerServicePort }}
targetPort: {{ .Values.host.containerScannerPort }}
selector:
app: {{ printf "%s-%s" .Release.Name "container-scanner" }}
app: {{ printf "%s-%s" .Release.Name "cont-scan" }}
type: ClusterIP
---
###################################
@ -63,14 +68,14 @@ spec:
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: {{ printf "%s-%s" .Release.Name "container-scanner" }}
name: {{ printf "%s-%s" .Release.Name "cont-scan" }}
spec:
maxReplicas: {{ .Values.autoScaler.maxReplicas }}
minReplicas: {{ .Values.autoScaler.minReplicas }}
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ printf "%s-%s" .Release.Name "container-scanner" }}
name: {{ printf "%s-%s" .Release.Name "cont-scan" }}
targetCPUUtilizationPercentage: {{ .Values.autoScaler.averageCpuUtilization }}
---
{{- end }}

View File

@ -31,6 +31,11 @@ spec:
value: {{ template "fyipe.serverUrl" $ }}
- name: IS_SAAS_SERVICE
value: 'true'
- name: CLUSTER_KEY
valueFrom:
configMapKeyRef:
name: {{ printf "%s-%s" $.Release.Name "configmap" }}
key: clusterkey
ports:
- containerPort: {{ .Values.host.lighthouseRunnerPort }}
hostPort: {{ .Values.host.lighthouseRunnerPort }}

View File

@ -25,6 +25,11 @@ spec:
name: {{ printf "%s-%s" .Release.Name "script" }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: CLUSTER_KEY
valueFrom:
configMapKeyRef:
name: {{ printf "%s-%s" $.Release.Name "configmap" }}
key: clusterkey
- name: NODE_ENV
value: 'production'
- name: SERVER_URL