@codefresh-io/kube-integration 1.25.23-CR-983 → 1.25.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.deploy/kube-integration/templates/deployment.yaml +168 -15
- package/.deploy/kube-integration/templates/hpa.yaml +6 -6
- package/.deploy/kube-integration/templates/pdb.yaml +21 -0
- package/.deploy/kube-integration/values.yaml +34 -2
- package/CODEOWNERS +2 -2
- package/Dockerfile +1 -1
- package/infra/eventbus.js +1 -1
- package/infra/express.js +1 -1
- package/infra/index.js +1 -1
- package/package.json +7 -6
- package/service.yaml +1 -1
- package/.deploy/kube-integration/templates/_kube-integration-deployment.tpl +0 -180
- package/.deploy/kube-integration/templates/kube-integration-istio-destinationrule.yaml +0 -28
- package/.deploy/kube-integration/templates/kube-integration-istio-local-virtuslservice.yaml +0 -34
|
@@ -1,16 +1,169 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
{{
|
|
5
|
-
|
|
6
|
-
{{
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
{{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
apiVersion: apps/v1
|
|
2
|
+
kind: Deployment
|
|
3
|
+
metadata:
|
|
4
|
+
name: {{ template "kube-integration.fullname" $ }}-{{ .version | default "base" }}
|
|
5
|
+
labels:
|
|
6
|
+
app: {{ template "kube-integration.fullname" . }}
|
|
7
|
+
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
|
|
8
|
+
release: {{ .Release.Name | quote }}
|
|
9
|
+
heritage: {{ .Release.Service | quote }}
|
|
10
|
+
version: {{ .version | default "base" | quote }}
|
|
11
|
+
spec:
|
|
12
|
+
{{- if not .Values.hpa.enabled }}
|
|
13
|
+
replicas: {{ .Values.replicaCount }}
|
|
15
14
|
{{- end }}
|
|
16
|
-
|
|
15
|
+
selector:
|
|
16
|
+
matchLabels:
|
|
17
|
+
app: {{ template "kube-integration.fullname" . }}
|
|
18
|
+
template:
|
|
19
|
+
metadata:
|
|
20
|
+
annotations:
|
|
21
|
+
checksum/secret: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
|
|
22
|
+
labels:
|
|
23
|
+
app: {{ template "kube-integration.fullname" . }}
|
|
24
|
+
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
|
|
25
|
+
release: {{ .Release.Name | quote }}
|
|
26
|
+
heritage: {{ .Release.Service | quote }}
|
|
27
|
+
version: {{ .version | default "base" | quote }}
|
|
28
|
+
spec:
|
|
29
|
+
{{- with .Values.podSecurityContext }}
|
|
30
|
+
securityContext: {{ toYaml . | nindent 8}}
|
|
31
|
+
{{- end }}
|
|
32
|
+
{{- if .Values.affinity }}
|
|
33
|
+
affinity: {{ toYaml .Values.affinity | nindent 8 }}
|
|
34
|
+
{{- end }}
|
|
35
|
+
{{- if .Values.nodeSelector }}
|
|
36
|
+
nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
|
|
37
|
+
{{- end }}
|
|
38
|
+
{{- if .Values.tolerations }}
|
|
39
|
+
tolerations: {{ toYaml .Values.tolerations | nindent 8 }}
|
|
40
|
+
{{- end }}
|
|
41
|
+
{{- if .Values.global.hostAliases }}
|
|
42
|
+
hostAliases:
|
|
43
|
+
{{ toYaml .Values.global.hostAliases | indent 8 }}
|
|
44
|
+
{{- end }}
|
|
45
|
+
imagePullSecrets:
|
|
46
|
+
- name: "{{ .Release.Name }}-{{ .Values.global.codefresh }}-registry"
|
|
47
|
+
terminationGracePeriodSeconds: 10
|
|
48
|
+
containers:
|
|
49
|
+
- name: {{ template "kube-integration.fullname" . }}
|
|
50
|
+
{{- if .Values.global.privateRegistry }}
|
|
51
|
+
image: "{{ .Values.global.dockerRegistry }}{{ .Values.image }}:{{ .Values.imageTag }}"
|
|
52
|
+
{{- else }}
|
|
53
|
+
image: "{{ .Values.dockerRegistry }}{{ .Values.image }}:{{ .Values.imageTag }}"
|
|
54
|
+
{{- end }}
|
|
55
|
+
{{- if not .Values.global.devEnvironment }}
|
|
56
|
+
securityContext:
|
|
57
|
+
allowPrivilegeEscalation: false
|
|
58
|
+
{{- end }}
|
|
59
|
+
imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }}
|
|
60
|
+
{{- if .Values.resources }}
|
|
61
|
+
resources: {{ toYaml .Values.resources | nindent 10 }}
|
|
62
|
+
{{- end }}
|
|
63
|
+
env:
|
|
64
|
+
{{- if .Values.global.env }}
|
|
65
|
+
{{- range $key, $value := .Values.global.env }}
|
|
66
|
+
- name: {{ $key }}
|
|
67
|
+
value: {{ $value | quote }}
|
|
68
|
+
{{- end}}
|
|
69
|
+
{{- end}}
|
|
70
|
+
{{- range $key, $value := $.Values.env }}
|
|
71
|
+
- name: {{ $key }}
|
|
72
|
+
value: {{ $value | quote }}
|
|
73
|
+
{{- end }}
|
|
74
|
+
- name: AGENT
|
|
75
|
+
value: {{ .Values.global.agent }}
|
|
76
|
+
# Mode variable to start it as http server
|
|
77
|
+
- name: MODE
|
|
78
|
+
value: "1"
|
|
79
|
+
- name: NODE_ENV
|
|
80
|
+
value: kubernetes
|
|
81
|
+
- name: MONGO_URI
|
|
82
|
+
valueFrom:
|
|
83
|
+
secretKeyRef:
|
|
84
|
+
name: {{ template "kube-integration.fullname" . }}
|
|
85
|
+
key: mongo-uri
|
|
86
|
+
- name: RABBIT_PASSWORD
|
|
87
|
+
valueFrom:
|
|
88
|
+
secretKeyRef:
|
|
89
|
+
name: "{{ .Release.Name }}-{{ .Values.global.codefresh }}"
|
|
90
|
+
key: rabbitmq-password
|
|
91
|
+
- name: RABBIT_USER
|
|
92
|
+
valueFrom:
|
|
93
|
+
secretKeyRef:
|
|
94
|
+
name: "{{ .Release.Name }}-{{ .Values.global.codefresh }}"
|
|
95
|
+
key: rabbitmq-username
|
|
96
|
+
- name: RABBIT_PROTOCOL
|
|
97
|
+
value: {{ .Values.global.rabbitmqProtocol | default "amqp" | quote }}
|
|
98
|
+
- name: EVENTBUS_URI
|
|
99
|
+
value: $(RABBIT_PROTOCOL)://$(RABBIT_USER):$(RABBIT_PASSWORD)@{{ default (printf "%s-%s" .Release.Name .Values.global.rabbitService) .Values.global.rabbitmqHostname }}
|
|
100
|
+
- name: POSTGRES_HOST
|
|
101
|
+
value: {{ default (printf "%s-%s" .Release.Name .Values.global.postgresService) .Values.global.postgresHostname | quote }}
|
|
102
|
+
- name: POSTGRES_DATABASE
|
|
103
|
+
value: {{ .Values.global.postgresDatabase }}
|
|
104
|
+
- name: POSTGRES_PORT
|
|
105
|
+
value: {{ .Values.global.postgresPort | quote }}
|
|
106
|
+
- name: POSTGRES_USER
|
|
107
|
+
valueFrom:
|
|
108
|
+
secretKeyRef:
|
|
109
|
+
name: "{{ .Release.Name }}-{{ .Values.global.codefresh }}"
|
|
110
|
+
key: postgres-user
|
|
111
|
+
- name: POSTGRES_PASSWORD
|
|
112
|
+
valueFrom:
|
|
113
|
+
secretKeyRef:
|
|
114
|
+
name: "{{ .Release.Name }}-{{ .Values.global.codefresh }}"
|
|
115
|
+
key: postgres-password
|
|
116
|
+
- name: NEWRELIC_LICENSE_KEY
|
|
117
|
+
valueFrom:
|
|
118
|
+
secretKeyRef:
|
|
119
|
+
name: "{{ .Release.Name }}-{{ .Values.global.codefresh }}"
|
|
120
|
+
key: newrelic-license-key
|
|
121
|
+
- name: PORT
|
|
122
|
+
value: "{{ .Values.global.kubeIntegrationPort }}"
|
|
123
|
+
- name: SERVICE_NAME
|
|
124
|
+
value: {{ template "kube-integration.name" . }}
|
|
125
|
+
- name: FORMAT_LOGS_TO_ELK
|
|
126
|
+
value: "{{ .Values.formatLogsToElk }}"
|
|
127
|
+
{{- if $.Values.global.mongoTLS }}
|
|
128
|
+
- name: MTLS_CERT_PATH
|
|
129
|
+
value: /etc/ssl/mongodb/ca.pem
|
|
130
|
+
{{- end }}
|
|
131
|
+
ports:
|
|
132
|
+
- containerPort: {{ .Values.targetPort }}
|
|
133
|
+
protocol: TCP
|
|
134
|
+
{{- if .Values.readinessProbe.enabled }}
|
|
135
|
+
readinessProbe: {{ toYaml (omit .Values.readinessProbe "enabled") | nindent 10 }}
|
|
136
|
+
httpGet:
|
|
137
|
+
path: /api/ping
|
|
138
|
+
port: {{ .Values.targetPort }}
|
|
139
|
+
{{- end }}
|
|
140
|
+
{{- if .Values.livenessProbe.enabled }}
|
|
141
|
+
livenessProbe: {{ toYaml (omit .Values.livenessProbe "enabled") | nindent 10 }}
|
|
142
|
+
httpGet:
|
|
143
|
+
path: /api/ping
|
|
144
|
+
port: {{ .Values.targetPort }}
|
|
145
|
+
{{- end }}
|
|
146
|
+
volumeMounts:
|
|
147
|
+
{{- if .Values.global.addResolvConf }}
|
|
148
|
+
- mountPath: /etc/resolv.conf
|
|
149
|
+
name: resolvconf
|
|
150
|
+
subPath: resolv.conf
|
|
151
|
+
readOnly: true
|
|
152
|
+
{{- end }}
|
|
153
|
+
{{- if $.Values.global.mongoTLS }}
|
|
154
|
+
- mountPath: /etc/ssl/mongodb/
|
|
155
|
+
name: mongodb-tls
|
|
156
|
+
readOnly: true
|
|
157
|
+
{{- end }}
|
|
158
|
+
volumes:
|
|
159
|
+
{{- if .Values.global.addResolvConf }}
|
|
160
|
+
- name: resolvconf
|
|
161
|
+
configMap:
|
|
162
|
+
name: {{ .Release.Name }}-{{ .Values.global.codefresh }}-resolvconf
|
|
163
|
+
{{- end }}
|
|
164
|
+
{{- if $.Values.global.mongoTLS }}
|
|
165
|
+
- name: mongodb-tls
|
|
166
|
+
secret:
|
|
167
|
+
secretName: {{ $.Release.Name }}-{{ $.Values.global.codefresh }}-mongodb-tls
|
|
168
|
+
{{- end }}
|
|
169
|
+
restartPolicy: Always
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{{- if .Values.
|
|
1
|
+
{{- if .Values.hpa.enabled }}
|
|
2
2
|
apiVersion: autoscaling/v2beta2
|
|
3
3
|
kind: HorizontalPodAutoscaler
|
|
4
4
|
metadata:
|
|
@@ -8,17 +8,17 @@ spec:
|
|
|
8
8
|
apiVersion: apps/v1
|
|
9
9
|
kind: Deployment
|
|
10
10
|
name: {{ template "kube-integration.fullname" . }}-{{ .version | default "base" }}
|
|
11
|
-
minReplicas: {{
|
|
12
|
-
maxReplicas: {{
|
|
11
|
+
minReplicas: {{ .Values.hpa.minReplicas }}
|
|
12
|
+
maxReplicas: {{ .Values.hpa.maxReplicas }}
|
|
13
13
|
metrics:
|
|
14
|
-
{{- if .Values.
|
|
15
|
-
{{ toYaml .Values.
|
|
14
|
+
{{- if .Values.hpa.metrics }}
|
|
15
|
+
{{ toYaml .Values.hpa.metrics | indent 4 }}
|
|
16
16
|
{{- else }}
|
|
17
17
|
- type: Resource
|
|
18
18
|
resource:
|
|
19
19
|
name: cpu
|
|
20
20
|
target:
|
|
21
21
|
type: Utilization
|
|
22
|
-
averageUtilization:
|
|
22
|
+
averageUtilization: {{ .Values.hpa.targetCPU }}
|
|
23
23
|
{{- end }}
|
|
24
24
|
{{- end }}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{{- if index .Values.pdb.enabled -}}
|
|
2
|
+
apiVersion: policy/v1
|
|
3
|
+
kind: PodDisruptionBudget
|
|
4
|
+
metadata:
|
|
5
|
+
name: {{ template "kube-integration.fullname" . }}
|
|
6
|
+
labels:
|
|
7
|
+
app: {{ template "kube-integration.fullname" . }}
|
|
8
|
+
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
|
9
|
+
release: "{{ .Release.Name }}"
|
|
10
|
+
heritage: "{{ .Release.Service }}"
|
|
11
|
+
spec:
|
|
12
|
+
{{- if .Values.pdb.minAvailable }}
|
|
13
|
+
minAvailable: {{ .Values.pdb.minAvailable }}
|
|
14
|
+
{{- end }}
|
|
15
|
+
{{- if .Values.pdb.maxUnavailable }}
|
|
16
|
+
maxUnavailable: {{ .Values.pdb.maxUnavailable }}
|
|
17
|
+
{{- end }}
|
|
18
|
+
selector:
|
|
19
|
+
matchLabels:
|
|
20
|
+
app: {{ template "kube-integration.fullname" . }}
|
|
21
|
+
{{- end -}}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
global:
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
# global codefresh chart name; all subcharts use this name to access secrets and configmaps
|
|
3
|
+
codefresh: codefresh
|
|
4
4
|
|
|
5
5
|
podSecurityContext:
|
|
6
6
|
runAsNonRoot: true
|
|
@@ -28,3 +28,35 @@ targetPort: 9000
|
|
|
28
28
|
|
|
29
29
|
# formatLogsToElk logs will be formatter as elk expect to read it
|
|
30
30
|
formatLogsToElk: true
|
|
31
|
+
|
|
32
|
+
# HorizontalPodAutoscaler
|
|
33
|
+
hpa:
|
|
34
|
+
enabled: false
|
|
35
|
+
minReplicas: 1
|
|
36
|
+
maxReplicas: 2
|
|
37
|
+
targetCPU: 70
|
|
38
|
+
|
|
39
|
+
# PodDisruptionBudget
|
|
40
|
+
pdb:
|
|
41
|
+
enabled: false
|
|
42
|
+
minAvailable: "50%"
|
|
43
|
+
maxUnavailable: ""
|
|
44
|
+
|
|
45
|
+
readinessProbe:
|
|
46
|
+
enabled: true
|
|
47
|
+
periodSeconds: 5
|
|
48
|
+
successThreshold: 1
|
|
49
|
+
failureThreshold: 2
|
|
50
|
+
timeoutSeconds: 10
|
|
51
|
+
|
|
52
|
+
livenessProbe:
|
|
53
|
+
enabled: true
|
|
54
|
+
periodSeconds: 50
|
|
55
|
+
successThreshold: 1
|
|
56
|
+
failureThreshold: 3
|
|
57
|
+
initialDelaySeconds: 30
|
|
58
|
+
timeoutSeconds: 10
|
|
59
|
+
|
|
60
|
+
affinity: {}
|
|
61
|
+
nodeSelector: {}
|
|
62
|
+
tolerations: []
|
package/CODEOWNERS
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
# the repo. Unless a later match takes precedence,
|
|
3
3
|
# @global-owner1 and @global-owner2 will be requested for
|
|
4
4
|
# review when someone opens a pull request.
|
|
5
|
-
* pavel@codefresh.io
|
|
5
|
+
* pavel@codefresh.io denis@codefresh.io
|
|
6
6
|
|
|
7
|
-
/ pavel@codefresh.io
|
|
7
|
+
/ pavel@codefresh.io denis@codefresh.io
|
package/Dockerfile
CHANGED
package/infra/eventbus.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const Promise = require('bluebird');
|
|
4
4
|
const eventBus = require('@codefresh-io/eventbus');
|
|
5
|
-
const monitor = require('cf-monitor');
|
|
5
|
+
const monitor = require('@codefresh-io/cf-monitor');
|
|
6
6
|
const logger = require('cf-logs').Logger("codefresh:infra:eventbus");
|
|
7
7
|
const config = require('./../config');
|
|
8
8
|
|
package/infra/express.js
CHANGED
package/infra/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const logging = require('./logging');
|
|
4
4
|
const config = require('../config');
|
|
5
|
-
const monitor = require('cf-monitor');
|
|
5
|
+
const monitor = require('@codefresh-io/cf-monitor');
|
|
6
6
|
monitor.init();
|
|
7
7
|
const Promise = require('bluebird'); // jshint ignore:line
|
|
8
8
|
const processEvents = require('./process-events');
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.25.
|
|
2
|
+
"version": "1.25.24",
|
|
3
3
|
"name": "@codefresh-io/kube-integration",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"description": "",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"url": "git+https://github.com/codefresh-io/kube-integration.git"
|
|
20
20
|
},
|
|
21
21
|
"engines": {
|
|
22
|
-
"node": "14.
|
|
22
|
+
"node": "^14.21.1"
|
|
23
23
|
},
|
|
24
24
|
"author": "Oleg Sucharevich <olegs@codefresh.io>",
|
|
25
25
|
"license": "ISC",
|
|
@@ -34,21 +34,22 @@
|
|
|
34
34
|
"shelljs": "0.8.5",
|
|
35
35
|
"node-forge": "1.3.0",
|
|
36
36
|
"openid-client": "^4.9.0",
|
|
37
|
-
"
|
|
37
|
+
"request/qs": "6.5.3",
|
|
38
|
+
"kubernetes-client/qs": "6.9.7"
|
|
38
39
|
},
|
|
39
40
|
"dependencies": {
|
|
40
41
|
"@codefresh-io/docker-reference": "^0.0.5",
|
|
41
42
|
"@codefresh-io/eventbus": "1.4.3",
|
|
42
43
|
"@codefresh-io/http-infra": "^1.8.11",
|
|
44
|
+
"@codefresh-io/cf-monitor": "0.0.25",
|
|
43
45
|
"bluebird": "^3.5.0",
|
|
44
|
-
"body-parser": "
|
|
46
|
+
"body-parser": "1.19.2",
|
|
45
47
|
"cf-errors": "^0.1.16",
|
|
46
48
|
"cf-logs": "^1.1.24",
|
|
47
|
-
"cf-monitor": "git+https://github.com/codefresh-io/cf-monitor.git#184a3e0824114e298936c134a1ae520dfb167aa1",
|
|
48
49
|
"compression": "^1.6.2",
|
|
49
50
|
"cookie-parser": "^1.4.3",
|
|
50
51
|
"eventemitter2": "^4.1.2",
|
|
51
|
-
"express": "
|
|
52
|
+
"express": "4.17.3",
|
|
52
53
|
"google-protobuf": "^3.5.0",
|
|
53
54
|
"js-yaml": "^3.13.1",
|
|
54
55
|
"kube-config-builder": "^1.1.3",
|
package/service.yaml
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
version: 1.
|
|
1
|
+
version: 1.28.3
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
{{/*
|
|
2
|
-
We create Deployment resource as template to be able to use many deployments but with
|
|
3
|
-
different name and version. This is for Istio POC.
|
|
4
|
-
*/}}
|
|
5
|
-
{{- define "kube-integration.renderDeployment" -}}
|
|
6
|
-
apiVersion: apps/v1
|
|
7
|
-
kind: Deployment
|
|
8
|
-
metadata:
|
|
9
|
-
name: {{ template "kube-integration.fullname" $ }}-{{ .version | default "base" }}
|
|
10
|
-
labels:
|
|
11
|
-
app: {{ template "kube-integration.fullname" . }}
|
|
12
|
-
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
|
|
13
|
-
release: {{ .Release.Name | quote }}
|
|
14
|
-
heritage: {{ .Release.Service | quote }}
|
|
15
|
-
version: {{ .version | default "base" | quote }}
|
|
16
|
-
spec:
|
|
17
|
-
replicas: {{ default 1 .Values.replicaCount }}
|
|
18
|
-
selector:
|
|
19
|
-
matchLabels:
|
|
20
|
-
app: {{ template "kube-integration.fullname" . }}
|
|
21
|
-
template:
|
|
22
|
-
metadata:
|
|
23
|
-
annotations:
|
|
24
|
-
checksum/secret: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
|
|
25
|
-
labels:
|
|
26
|
-
app: {{ template "kube-integration.fullname" . }}
|
|
27
|
-
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
|
|
28
|
-
release: {{ .Release.Name | quote }}
|
|
29
|
-
heritage: {{ .Release.Service | quote }}
|
|
30
|
-
version: {{ .version | default "base" | quote }}
|
|
31
|
-
spec:
|
|
32
|
-
{{- if not .Values.global.devEnvironment }}
|
|
33
|
-
{{- $podSecurityContext := (kindIs "invalid" .Values.global.podSecurityContextOverride) | ternary .Values.podSecurityContext .Values.global.podSecurityContextOverride }}
|
|
34
|
-
{{- with $podSecurityContext }}
|
|
35
|
-
securityContext:
|
|
36
|
-
{{ toYaml . | indent 8}}
|
|
37
|
-
{{- end }}
|
|
38
|
-
{{- end }}
|
|
39
|
-
# In production Kubernetes clusters we have multiple tiers of worker nodes.
|
|
40
|
-
# The following setting makes sure that your applicaiton will run on
|
|
41
|
-
# service nodes which don't run internal pods like monitoring.
|
|
42
|
-
# This is needed to ensure a good quality of service.
|
|
43
|
-
{{- with (default $.Values.global.appServiceTolerations $.Values.tolerations ) }}
|
|
44
|
-
tolerations:
|
|
45
|
-
{{ toYaml . | indent 8}}
|
|
46
|
-
{{- end }}
|
|
47
|
-
affinity:
|
|
48
|
-
{{ toYaml (default .Values.global.appServiceAffinity .Values.affinity) | indent 8 }}
|
|
49
|
-
{{- if .Values.global.hostAliases }}
|
|
50
|
-
hostAliases:
|
|
51
|
-
{{ toYaml .Values.global.hostAliases | indent 8 }}
|
|
52
|
-
{{- end }}
|
|
53
|
-
imagePullSecrets:
|
|
54
|
-
- name: "{{ .Release.Name }}-{{ .Values.global.codefresh }}-registry"
|
|
55
|
-
terminationGracePeriodSeconds: 10
|
|
56
|
-
containers:
|
|
57
|
-
- name: {{ template "kube-integration.fullname" . }}
|
|
58
|
-
{{- if .Values.global.privateRegistry }}
|
|
59
|
-
image: "{{ .Values.global.dockerRegistry }}{{ .Values.image }}:{{ .imageTag }}"
|
|
60
|
-
{{- else }}
|
|
61
|
-
image: "{{ .Values.dockerRegistry }}{{ .Values.image }}:{{ .imageTag }}"
|
|
62
|
-
{{- end }}
|
|
63
|
-
{{- if not .Values.global.devEnvironment }}
|
|
64
|
-
securityContext:
|
|
65
|
-
allowPrivilegeEscalation: false
|
|
66
|
-
{{- end }}
|
|
67
|
-
imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }}
|
|
68
|
-
resources:
|
|
69
|
-
{{ toYaml .Values.resources | indent 10 }}
|
|
70
|
-
env:
|
|
71
|
-
{{- if .Values.global.env }}
|
|
72
|
-
{{- range $key, $value := .Values.global.env }}
|
|
73
|
-
- name: {{ $key }}
|
|
74
|
-
value: {{ $value | quote }}
|
|
75
|
-
{{- end}}
|
|
76
|
-
{{- end}}
|
|
77
|
-
{{- range $key, $value := $.Values.env }}
|
|
78
|
-
- name: {{ $key }}
|
|
79
|
-
value: {{ $value | quote }}
|
|
80
|
-
{{- end }}
|
|
81
|
-
- name: AGENT
|
|
82
|
-
value: {{ .Values.global.agent }}
|
|
83
|
-
# Mode variable to start it as http server
|
|
84
|
-
- name: MODE
|
|
85
|
-
value: "1"
|
|
86
|
-
- name: NODE_ENV
|
|
87
|
-
value: kubernetes
|
|
88
|
-
- name: MONGO_URI
|
|
89
|
-
valueFrom:
|
|
90
|
-
secretKeyRef:
|
|
91
|
-
name: {{ template "kube-integration.fullname" . }}
|
|
92
|
-
key: mongo-uri
|
|
93
|
-
- name: RABBIT_PASSWORD
|
|
94
|
-
valueFrom:
|
|
95
|
-
secretKeyRef:
|
|
96
|
-
name: "{{ .Release.Name }}-{{ .Values.global.codefresh }}"
|
|
97
|
-
key: rabbitmq-password
|
|
98
|
-
- name: RABBIT_USER
|
|
99
|
-
valueFrom:
|
|
100
|
-
secretKeyRef:
|
|
101
|
-
name: "{{ .Release.Name }}-{{ .Values.global.codefresh }}"
|
|
102
|
-
key: rabbitmq-username
|
|
103
|
-
- name: EVENTBUS_URI
|
|
104
|
-
value: amqp://$(RABBIT_USER):$(RABBIT_PASSWORD)@{{ default (printf "%s-%s" .Release.Name .Values.global.rabbitService) .Values.global.rabbitmqHostname }}
|
|
105
|
-
- name: POSTGRES_HOST
|
|
106
|
-
value: {{ default (printf "%s-%s" .Release.Name .Values.global.postgresService) .Values.global.postgresHostname | quote }}
|
|
107
|
-
- name: POSTGRES_DATABASE
|
|
108
|
-
value: {{ .Values.global.postgresDatabase }}
|
|
109
|
-
- name: POSTGRES_PORT
|
|
110
|
-
value: {{ .Values.global.postgresPort | quote }}
|
|
111
|
-
- name: POSTGRES_USER
|
|
112
|
-
valueFrom:
|
|
113
|
-
secretKeyRef:
|
|
114
|
-
name: "{{ .Release.Name }}-{{ .Values.global.codefresh }}"
|
|
115
|
-
key: postgres-user
|
|
116
|
-
- name: POSTGRES_PASSWORD
|
|
117
|
-
valueFrom:
|
|
118
|
-
secretKeyRef:
|
|
119
|
-
name: "{{ .Release.Name }}-{{ .Values.global.codefresh }}"
|
|
120
|
-
key: postgres-password
|
|
121
|
-
- name: NEWRELIC_LICENSE_KEY
|
|
122
|
-
valueFrom:
|
|
123
|
-
secretKeyRef:
|
|
124
|
-
name: "{{ .Release.Name }}-{{ .Values.global.codefresh }}"
|
|
125
|
-
key: newrelic-license-key
|
|
126
|
-
- name: PORT
|
|
127
|
-
value: "{{ .Values.global.kubeIntegrationPort }}"
|
|
128
|
-
- name: SERVICE_NAME
|
|
129
|
-
value: {{ template "kube-integration.name" . }}
|
|
130
|
-
- name: FORMAT_LOGS_TO_ELK
|
|
131
|
-
value: "{{ .Values.formatLogsToElk }}"
|
|
132
|
-
{{- if $.Values.global.mongoTLS }}
|
|
133
|
-
- name: MTLS_CERT_PATH
|
|
134
|
-
value: /etc/ssl/mongodb/ca.pem
|
|
135
|
-
{{- end }}
|
|
136
|
-
ports:
|
|
137
|
-
- containerPort: {{ .Values.targetPort }}
|
|
138
|
-
protocol: TCP
|
|
139
|
-
readinessProbe:
|
|
140
|
-
httpGet:
|
|
141
|
-
path: /api/ping
|
|
142
|
-
port: {{ .Values.targetPort }}
|
|
143
|
-
periodSeconds: 5
|
|
144
|
-
successThreshold: 1
|
|
145
|
-
failureThreshold: 2
|
|
146
|
-
timeoutSeconds: 10
|
|
147
|
-
livenessProbe:
|
|
148
|
-
httpGet:
|
|
149
|
-
path: /api/ping
|
|
150
|
-
port: {{ .Values.targetPort }}
|
|
151
|
-
periodSeconds: 50
|
|
152
|
-
successThreshold: 1
|
|
153
|
-
failureThreshold: 3
|
|
154
|
-
initialDelaySeconds: 30
|
|
155
|
-
timeoutSeconds: 10
|
|
156
|
-
volumeMounts:
|
|
157
|
-
{{- if .Values.global.addResolvConf }}
|
|
158
|
-
- mountPath: /etc/resolv.conf
|
|
159
|
-
name: resolvconf
|
|
160
|
-
subPath: resolv.conf
|
|
161
|
-
readOnly: true
|
|
162
|
-
{{- end }}
|
|
163
|
-
{{- if $.Values.global.mongoTLS }}
|
|
164
|
-
- mountPath: /etc/ssl/mongodb/
|
|
165
|
-
name: mongodb-tls
|
|
166
|
-
readOnly: true
|
|
167
|
-
{{- end }}
|
|
168
|
-
volumes:
|
|
169
|
-
{{- if .Values.global.addResolvConf }}
|
|
170
|
-
- name: resolvconf
|
|
171
|
-
configMap:
|
|
172
|
-
name: {{ .Release.Name }}-{{ .Values.global.codefresh }}-resolvconf
|
|
173
|
-
{{- end }}
|
|
174
|
-
{{- if $.Values.global.mongoTLS }}
|
|
175
|
-
- name: mongodb-tls
|
|
176
|
-
secret:
|
|
177
|
-
secretName: {{ $.Release.Name }}-{{ $.Values.global.codefresh }}-mongodb-tls
|
|
178
|
-
{{- end }}
|
|
179
|
-
restartPolicy: Always
|
|
180
|
-
{{- end }}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
{{- if $.Values.global.istio.enabled }}
|
|
2
|
-
{{ $subsets := list }}
|
|
3
|
-
apiVersion: networking.istio.io/v1alpha3
|
|
4
|
-
kind: DestinationRule
|
|
5
|
-
metadata:
|
|
6
|
-
name: {{ template "kube-integration.fullname" . }}
|
|
7
|
-
spec:
|
|
8
|
-
host: {{ template "kube-integration.fqdn" . }}
|
|
9
|
-
subsets:
|
|
10
|
-
- name: base
|
|
11
|
-
labels:
|
|
12
|
-
version: base
|
|
13
|
-
{{- range $key,$value := .Values.global.istio.extraDeployments -}}
|
|
14
|
-
{{- range $host, $apps := $value -}}
|
|
15
|
-
{{- range $name, $a := $apps -}}
|
|
16
|
-
{{- if (eq $name "kube-integration") -}}
|
|
17
|
-
{{ $subsets = append $subsets (printf "%s" $host) }}
|
|
18
|
-
{{- end -}}
|
|
19
|
-
{{ end -}}
|
|
20
|
-
{{ end -}}
|
|
21
|
-
{{ end -}}
|
|
22
|
-
{{- range $s := $subsets | uniq }}
|
|
23
|
-
- name: {{ $s | replace "." "-" }}
|
|
24
|
-
labels:
|
|
25
|
-
version: {{ $s | replace "." "-" }}
|
|
26
|
-
{{- end -}}
|
|
27
|
-
{{ end }}
|
|
28
|
-
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{{- if $.Values.global.istio.enabled }}
|
|
2
|
-
apiVersion: networking.istio.io/v1alpha3
|
|
3
|
-
kind: VirtualService
|
|
4
|
-
metadata:
|
|
5
|
-
name: {{ template "kube-integration.fullname" $ }}
|
|
6
|
-
spec:
|
|
7
|
-
hosts:
|
|
8
|
-
- {{ template "kube-integration.fqdn" $ }}
|
|
9
|
-
http:
|
|
10
|
-
{{- range $key,$value := .Values.global.istio.extraDeployments -}}
|
|
11
|
-
{{- range $host, $apps := $value -}}
|
|
12
|
-
{{- range $name, $a := $apps -}}
|
|
13
|
-
{{- if (eq $name "kube-integration") }}
|
|
14
|
-
- match:
|
|
15
|
-
- headers:
|
|
16
|
-
x-codefresh-version:
|
|
17
|
-
exact: {{ $host }}
|
|
18
|
-
route:
|
|
19
|
-
- destination:
|
|
20
|
-
host: {{ template "kube-integration.fqdn" $ }}
|
|
21
|
-
port:
|
|
22
|
-
number: {{ $.Values.port }}
|
|
23
|
-
subset: {{ $host | replace "." "-" -}}
|
|
24
|
-
{{ end -}}
|
|
25
|
-
{{ end -}}
|
|
26
|
-
{{ end -}}
|
|
27
|
-
{{ end }}
|
|
28
|
-
- route:
|
|
29
|
-
- destination:
|
|
30
|
-
host: {{ template "kube-integration.fqdn" $ }}
|
|
31
|
-
port:
|
|
32
|
-
number: {{ $.Values.port }}
|
|
33
|
-
subset: base
|
|
34
|
-
{{ end }}
|