Skip to content

Commit 599d942

Browse files
CR-17878 - support on-prem platform ca (#35)
* updated chart version to `0.2.1-alpha.14` * bumped appVersion to `0.1.29` * updated app-proxy to `1.2245.0` --------- Co-authored-by: Ilia Medvedev <[email protected]>
1 parent 1532532 commit 599d942

File tree

21 files changed

+630
-179
lines changed

21 files changed

+630
-179
lines changed

charts/gitops-runtime/Chart.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
apiVersion: v2
2-
appVersion: 0.1.27
2+
appVersion: 0.1.29
33
description: A Helm chart for Codefresh gitops runtime
44
name: gitops-runtime
5-
version: 0.2.1-alpha.13
5+
version: 0.2.1-alpha.14
66
home: https://github.com/codefresh-io/gitops-runtime-helm
7+
icon: https://codefresh.io/wp-content/uploads/2022/02/Codefresh_Logo_Vertical_LightBkgd.png
78
keywords:
89
- codefresh
910
- gitops
1011
maintainers:
1112
- name: codefresh
1213
url: https://codefresh-io.github.io/
14+
annotations:
15+
artifacthub.io/changes: |
16+
- kind: added
17+
description: Added support for custom CA
1318
dependencies:
1419
- name: argo-cd
1520
repository: https://codefresh-io.github.io/argo-helm

charts/gitops-runtime/README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# gitops-runtime
22

3-
![Version: 0.2.1-alpha.13](https://img.shields.io/badge/Version-0.2.1--alpha.13-informational?style=flat-square) ![AppVersion: 0.1.27](https://img.shields.io/badge/AppVersion-0.1.27-informational?style=flat-square)
3+
![Version: 0.2.1-alpha.14](https://img.shields.io/badge/Version-0.2.1--alpha.14-informational?style=flat-square) ![AppVersion: 0.1.29](https://img.shields.io/badge/AppVersion-0.1.29-informational?style=flat-square)
44

55
A Helm chart for Codefresh gitops runtime
66

@@ -36,6 +36,8 @@ A Helm chart for Codefresh gitops runtime
3636
| app-proxy.config.logLevel | string | `"info"` | Log Level |
3737
| app-proxy.config.skipGitPermissionValidation | string | `"false"` | Skit git permissions validation |
3838
| app-proxy.env | object | `{}` | |
39+
| app-proxy.extraVolumeMounts | list | `[]` | Extra volume mounts for main container |
40+
| app-proxy.extraVolumes | list | `[]` | extra volumes |
3941
| app-proxy.fullnameOverride | string | `"cap-app-proxy"` | |
4042
| app-proxy.image-enrichment | object | `{"config":{"clientHeartbeatIntervalInSeconds":5,"concurrencyCmKey":"imageReportExecutor","concurrencyCmName":"workflow-synchronization-semaphores","podGcStrategy":"OnWorkflowCompletion","ttlActiveInSeconds":900,"ttlAfterCompletionInSeconds":86400},"enabled":true,"serviceAccount":{"annotations":null,"create":true,"name":"codefresh-image-enrichment-sa"}}` | Image enrichment process configuration |
4143
| app-proxy.image-enrichment.config | object | `{"clientHeartbeatIntervalInSeconds":5,"concurrencyCmKey":"imageReportExecutor","concurrencyCmName":"workflow-synchronization-semaphores","podGcStrategy":"OnWorkflowCompletion","ttlActiveInSeconds":900,"ttlAfterCompletionInSeconds":86400}` | Configurations for image enrichment workflow |
@@ -52,13 +54,14 @@ A Helm chart for Codefresh gitops runtime
5254
| app-proxy.image-enrichment.serviceAccount.name | string | `"codefresh-image-enrichment-sa"` | Name of the service account to create or the name of the existing one to use |
5355
| app-proxy.image.pullPolicy | string | `"IfNotPresent"` | |
5456
| app-proxy.image.repository | string | `"quay.io/codefresh/cap-app-proxy"` | |
55-
| app-proxy.image.tag | string | `"1.2221.0"` | |
57+
| app-proxy.image.tag | string | `"1.2245.0"` | |
5658
| app-proxy.imagePullSecrets | list | `[]` | |
5759
| app-proxy.initContainer.command[0] | string | `"./init.sh"` | |
5860
| app-proxy.initContainer.env | object | `{}` | |
61+
| app-proxy.initContainer.extraVolumeMounts | list | `[]` | Extra volume mounts for init container |
5962
| app-proxy.initContainer.image.pullPolicy | string | `"IfNotPresent"` | |
6063
| app-proxy.initContainer.image.repository | string | `"quay.io/codefresh/cap-app-proxy-init"` | |
61-
| app-proxy.initContainer.image.tag | string | `"1.2221.0"` | |
64+
| app-proxy.initContainer.image.tag | string | `"1.2245.0"` | |
6265
| app-proxy.initContainer.resources.limits.cpu | string | `"1"` | |
6366
| app-proxy.initContainer.resources.limits.memory | string | `"512Mi"` | |
6467
| app-proxy.initContainer.resources.requests.cpu | string | `"0.2"` | |
@@ -123,9 +126,15 @@ A Helm chart for Codefresh gitops runtime
123126
| event-reporters.workflow.sensor.replicas | int | `1` | |
124127
| event-reporters.workflow.sensor.resources | object | `{}` | |
125128
| event-reporters.workflow.serviceAccount.create | bool | `true` | |
126-
| global.codefresh | object | `{"accountId":"","apiEventsPath":"/2.0/api/events","url":"https://g.codefresh.io","userToken":{"secretKeyRef":{},"token":""}}` | Codefresh platform and account-related settings |
129+
| global.codefresh | object | `{"accountId":"","apiEventsPath":"/2.0/api/events","tls":{"caCerts":{"secret":{"annotations":{},"content":"","create":false,"key":"ca-bundle.crt"},"secretKeyRef":{}},"workflowPipelinesGitWebhooks":{"annotatins":{},"certificates":{}}},"url":"https://g.codefresh.io","userToken":{"secretKeyRef":{},"token":""}}` | Codefresh platform and account-related settings |
127130
| global.codefresh.accountId | string | `""` | Codefresh Account ID. |
128131
| global.codefresh.apiEventsPath | string | `"/2.0/api/events"` | Events API endpoint URL suffix. |
132+
| global.codefresh.tls.caCerts | object | `{"secret":{"annotations":{},"content":"","create":false,"key":"ca-bundle.crt"},"secretKeyRef":{}}` | Custom CA certificates bundle for platform access with ssl |
133+
| global.codefresh.tls.caCerts.secret | object | `{"annotations":{},"content":"","create":false,"key":"ca-bundle.crt"}` | Chart managed secret for custom platform CA certificates |
134+
| global.codefresh.tls.caCerts.secret.create | bool | `false` | Whether to create the secret. |
135+
| global.codefresh.tls.caCerts.secret.key | string | `"ca-bundle.crt"` | The secret key that holds the ca bundle |
136+
| global.codefresh.tls.caCerts.secretKeyRef | object | `{}` | Reference to existing secret |
137+
| global.codefresh.tls.workflowPipelinesGitWebhooks | object | `{"annotatins":{},"certificates":{}}` | Those will be merged with the certificats defined in argo-cd.configs.tls.certificates - so if the certificates are already provided for ArgoCD, there is no need to provide them again. |
129138
| global.codefresh.url | string | `"https://g.codefresh.io"` | URL of Codefresh platform. |
130139
| global.codefresh.userToken | object | `{"secretKeyRef":{},"token":""}` | User token. Used for runtime registration against the patform. One of token (for plain text value) or secretKeyRef must be provided. |
131140
| global.codefresh.userToken.secretKeyRef | object | `{}` | User token that references an existing secret containing the token. |

charts/gitops-runtime/templates/_components/cap-app-proxy/_all_resources.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{{- define "cap-app-proxy.resources" }}
22
{{ include "cap-app-proxy.resources.configmap" . }}
3+
---
4+
{{ include "cap-app-proxy.resources.codefresh-tls-certs" . }}
35
---
46
{{ include "cap-app-proxy.resources.deployment" . }}
57
---

charts/gitops-runtime/templates/_components/cap-app-proxy/_deployment.yaml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@ spec:
3737
command:
3838
{{- toYaml .Values.initContainer.command | nindent 8 }}
3939
volumeMounts:
40-
- mountPath: /app/config/tls
41-
name: tls-certs
40+
{{- with .Values.initContainer.extraVolumeMounts }}
41+
{{- toYaml . | nindent 10 }}
42+
{{- end }}
43+
- mountPath: /app/config/git-tls-certs
44+
name: git-tls-certs
4245
readOnly: true
4346
- mountPath: /app/config/all
4447
name: all-certs
@@ -75,6 +78,9 @@ spec:
7578
resources:
7679
{{- toYaml .Values.resources | nindent 12 }}
7780
volumeMounts:
81+
{{- with .Values.extraVolumeMounts }}
82+
{{- toYaml . | nindent 8 }}
83+
{{- end }}
7884
- mountPath: /app/config/all
7985
name: all-certs
8086
readOnly: true
@@ -91,10 +97,14 @@ spec:
9197
{{- toYaml . | nindent 6 }}
9298
{{- end }}
9399
volumes:
100+
{{- with .Values.extraVolumes }}
101+
{{- toYaml . | nindent 6 }}
102+
{{- end }}
103+
- name: git-tls-certs
104+
secret:
105+
secretName: codefresh-workflow-pipelines-tls
106+
defaultMode: 420
107+
optional: true
94108
- name: all-certs
95109
emptyDir: {}
96-
- name: tls-certs
97-
configMap:
98-
defaultMode: 420
99-
name: argocd-tls-certs-cm
100-
{{- end }}
110+
{{- end }}

charts/gitops-runtime/templates/_components/event-reporters/_helpers.tpl

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ helm.sh/chart: {{ include "event-reporters.chart" . }}
3131
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
3232
{{- end }}
3333
app.kubernetes.io/managed-by: Helm
34-
app.kubernetes.io/part-of: events-reporter
3534
codefresh.io/internal: "true"
3635
{{- end }}
3736

@@ -79,7 +78,6 @@ helm.sh/chart: {{ include "event-reporters.chart" . }}
7978
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
8079
{{- end }}
8180
app.kubernetes.io/managed-by: Helm
82-
app.kubernetes.io/part-of: rollout-reporter
8381
codefresh.io/internal: "true"
8482
{{- end }}
8583

@@ -127,7 +125,6 @@ helm.sh/chart: {{ include "event-reporters.chart" . }}
127125
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
128126
{{- end }}
129127
app.kubernetes.io/managed-by: Helm
130-
app.kubernetes.io/part-of: workflow-reporter
131128
codefresh.io/internal: "true"
132129
{{- end }}
133130

@@ -148,3 +145,36 @@ Create the name of the service account to use
148145
{{- default "default" .Values.workflow.serviceAccount.name }}
149146
{{- end }}
150147
{{- end }}
148+
149+
{{/*
150+
Create a single event-source sensor http trigger
151+
assumes the name, condition and payload.dependencyName are identical
152+
*/}}
153+
{{- define "event-reporters.http.trigger" -}}
154+
{{- $url := (printf "%s%s" .Values.global.codefresh.url .Values.global.codefresh.apiEventsPath | quote) -}}
155+
- template:
156+
name: {{ .name }}
157+
conditions: {{ .name }}
158+
http:
159+
method: POST
160+
url: {{ $url }}
161+
{{- if or .Values.global.codefresh.tls.caCerts.secret.create .Values.global.codefresh.tls.caCerts.secretKeyRef}}
162+
tls:
163+
caCertSecret:
164+
name: {{ .Values.global.codefresh.tls.caCerts.secret.create | ternary "codefresh-tls-certs" .Values.global.codefresh.tls.caCerts.secretKeyRef.name }}
165+
key: {{ .Values.global.codefresh.tls.caCerts.secret.create | ternary (default "ca-bundle.crt" .Values.global.codefresh.tls.caCerts.secret.key) .Values.global.codefresh.tls.caCerts.secretKeyRef.key }}
166+
{{- end }}
167+
headers:
168+
Content-Type: application/json
169+
secureHeaders:
170+
- name: Authorization
171+
valueFrom:
172+
secretKeyRef:
173+
key: token
174+
name: codefresh-token
175+
payload:
176+
- dest: data
177+
src:
178+
dataKey: body
179+
dependencyName: {{ .name }}
180+
{{- end -}}

charts/gitops-runtime/templates/_components/event-reporters/events-reporter/_all_resources.yaml

Lines changed: 0 additions & 9 deletions
This file was deleted.

charts/gitops-runtime/templates/_components/event-reporters/events-reporter/_sensor.yaml

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,23 @@
22
apiVersion: argoproj.io/v1alpha1
33
kind: Sensor
44
metadata:
5+
name: events-reporter
56
labels:
67
{{- include "event-reporters.events-reporter.labels" . | nindent 4}}
7-
name: events-reporter
88
spec:
99
replicas: {{ .Values.events.sensor.replicas }}
10+
dependencies:
11+
- name: events
12+
eventSourceName: events-reporter
13+
eventName: events
14+
eventBusName: {{ .Values.global.runtime.eventBusName }}
1015
template:
1116
serviceAccountName: {{ include "event-reporters.events-reporter.serviceAccountName" .}}
1217
container:
1318
resources:
1419
{{- with .Values.events.sensor.resources }}
1520
{{- . | toYaml | nindent 8 }}
1621
{{- end }}
17-
dependencies:
18-
- eventName: events
19-
eventSourceName: events-reporter
20-
name: events
21-
eventBusName: {{ .Values.global.runtime.eventBusName }}
2222
triggers:
23-
- retryStrategy:
24-
duration: 0
25-
steps: 3
26-
template:
27-
conditions: events
28-
http:
29-
headers:
30-
Content-Type: application/json
31-
method: POST
32-
payload:
33-
- dest: data
34-
src:
35-
dataKey: body
36-
dependencyName: events
37-
secureHeaders:
38-
- name: Authorization
39-
valueFrom:
40-
secretKeyRef:
41-
key: token
42-
name: codefresh-token
43-
url: {{ printf "%s%s" .Values.global.codefresh.url .Values.global.codefresh.apiEventsPath | quote }}
44-
name: events
45-
{{- end }}
23+
{{- include "event-reporters.http.trigger" (dict "name" "events" "Values" .Values) | nindent 4 }}
24+
{{- end }}

charts/gitops-runtime/templates/_components/event-reporters/rollout-reporter/_all_resources.yaml

Lines changed: 0 additions & 9 deletions
This file was deleted.

charts/gitops-runtime/templates/_components/event-reporters/rollout-reporter/_sensor.yaml

Lines changed: 14 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -8,89 +8,26 @@ metadata:
88
spec:
99
replicas: {{ .Values.rollout.sensor.replicas }}
1010
dependencies:
11-
- eventName: rollouts
12-
eventSourceName: rollout-reporter
13-
name: rollouts
14-
- eventName: replicasets
15-
eventSourceName: rollout-reporter
16-
name: replicasets
17-
- eventName: analysisruns
18-
eventSourceName: rollout-reporter
19-
name: analysisruns
11+
- name: rollouts
12+
eventSourceName: rollout-reporter
13+
eventName: rollouts
14+
- name: replicasets
15+
eventSourceName: rollout-reporter
16+
eventName: replicasets
17+
- name: analysisruns
18+
eventSourceName: rollout-reporter
19+
eventName: analysisruns
2020
eventBusName: {{ .Values.global.runtime.eventBusName }}
2121
template:
22+
serviceAccountName: {{ include "event-reporters.rollout-reporter.serviceAccountName" .}}
2223
container:
2324
name: ""
2425
resources:
2526
{{- with .Values.rollout.eventSource.resources }}
2627
{{- . | toYaml | nindent 8 }}
2728
{{- end }}
28-
serviceAccountName: {{ include "event-reporters.rollout-reporter.serviceAccountName" .}}
2929
triggers:
30-
- retryStrategy:
31-
duration: 0
32-
steps: 3
33-
template:
34-
conditions: rollouts
35-
http:
36-
headers:
37-
Content-Type: application/json
38-
method: POST
39-
payload:
40-
- dest: data.object
41-
src:
42-
dataKey: body
43-
dependencyName: rollouts
44-
secureHeaders:
45-
- name: Authorization
46-
valueFrom:
47-
secretKeyRef:
48-
key: token
49-
name: codefresh-token
50-
url: {{ printf "%s%s" .Values.global.codefresh.url .Values.global.codefresh.apiEventsPath | quote }}
51-
name: rollouts
52-
- retryStrategy:
53-
duration: 0
54-
steps: 3
55-
template:
56-
conditions: replicasets
57-
http:
58-
headers:
59-
Content-Type: application/json
60-
method: POST
61-
payload:
62-
- dest: data.object
63-
src:
64-
dataKey: body
65-
dependencyName: replicasets
66-
secureHeaders:
67-
- name: Authorization
68-
valueFrom:
69-
secretKeyRef:
70-
key: token
71-
name: codefresh-token
72-
url: {{ printf "%s%s" .Values.global.codefresh.url .Values.global.codefresh.apiEventsPath | quote }}
73-
name: replicasets
74-
- retryStrategy:
75-
duration: 0
76-
steps: 3
77-
template:
78-
conditions: analysisruns
79-
http:
80-
headers:
81-
Content-Type: application/json
82-
method: POST
83-
payload:
84-
- dest: data.object
85-
src:
86-
dataKey: body
87-
dependencyName: analysisruns
88-
secureHeaders:
89-
- name: Authorization
90-
valueFrom:
91-
secretKeyRef:
92-
key: token
93-
name: codefresh-token
94-
url: {{ printf "%s%s" .Values.global.codefresh.url .Values.global.codefresh.apiEventsPath | quote }}
95-
name: analysisruns
96-
{{- end }}
30+
{{- include "event-reporters.http.trigger" (dict "name" "rollouts" "Values" .Values) | nindent 4 }}
31+
{{- include "event-reporters.http.trigger" (dict "name" "replicasets" "Values" .Values) | nindent 4 }}
32+
{{- include "event-reporters.http.trigger" (dict "name" "analysisruns" "Values" .Values) | nindent 4 }}
33+
{{- end }}

charts/gitops-runtime/templates/_components/event-reporters/workflow-reporter/_all_resources.yaml

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)