Skip to content

Commit d1d76b1

Browse files
yaroslav-codefreshilia-medvedev-codefreshdanielm-codefresh
authored
Release 0.4.0 (#113)
* create release branch + udpate app version to 0.1.37 * fail template when runtime.name not provided (#117) * fail template when runtime.name not provided * add test on runtimename * ArgoCD 2.9.3 + ArgoRollouts 1.6.1 (#115) * change argo-cd chart to release version * bump minor version * fix readme (#118) * Hosted runtimes registration flow (#116) * bump app-proxy --------- Co-authored-by: ilia-medvedev-codefresh <[email protected]> Co-authored-by: danielm-codefresh <[email protected]>
1 parent 800404d commit d1d76b1

File tree

8 files changed

+177
-15
lines changed

8 files changed

+177
-15
lines changed

charts/gitops-runtime/Chart.yaml

+15-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apiVersion: v2
2-
appVersion: 0.1.36
2+
appVersion: 0.1.37
33
description: A Helm chart for Codefresh gitops runtime
44
name: gitops-runtime
5-
version: 0.3.5
5+
version: 0.4.0
66
home: https://github.com/codefresh-io/gitops-runtime-helm
77
icon: https://avatars1.githubusercontent.com/u/11412079?v=3
88
keywords:
@@ -15,11 +15,21 @@ annotations:
1515
artifacthub.io/alternativeName: "codefresh-gitops-runtime"
1616
artifacthub.io/changes: |
1717
- kind: changed
18-
description: Update ArgoCD chart to version 5.50.1-2-cap-CR-create-apps-with-err
18+
description: Update app-proxy
19+
- kind: changed
20+
description: Update app version to 0.1.37
21+
- kind: added
22+
description: Support Codefresh hosted runtimes registration flow
23+
- kind: fixed
24+
description: fail templating when runtime.name is not provided and ingress is enabled
25+
- kind: changed
26+
description: Update Argo-CD to 5.51.6-1-cap-2.9-2023.12.06-e6258156d (2.9.3)
27+
- kind: changed
28+
description: Update Argo-Rollouts to 2.32.5-2-cap-init (1.6.1)
1929
dependencies:
2030
- name: argo-cd
2131
repository: https://codefresh-io.github.io/argo-helm
22-
version: 5.50.1-2-cap-CR-create-apps-with-err
32+
version: 5.51.6-1-cap-2.9-2023.12.06-e6258156d
2333
- name: argo-events
2434
repository: https://codefresh-io.github.io/argo-helm
2535
version: 2.0.9-1-cap-CR-19893
@@ -29,7 +39,7 @@ dependencies:
2939
condition: argo-workflows.enabled
3040
- name: argo-rollouts
3141
repository: https://codefresh-io.github.io/argo-helm
32-
version: 2.31.6-1-cf-init
42+
version: 2.32.5-2-cap-init
3343
condition: argo-rollouts.enabled
3444
- name: sealed-secrets
3545
repository: https://bitnami-labs.github.io/sealed-secrets/

charts/gitops-runtime/README.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## Codefresh gitops runtime
2-
![Version: 0.3.5](https://img.shields.io/badge/Version-0.3.5-informational?style=flat-square) ![AppVersion: 0.1.36](https://img.shields.io/badge/AppVersion-0.1.36-informational?style=flat-square)
2+
![Version: 0.4.0](https://img.shields.io/badge/Version-0.4.0-informational?style=flat-square) ![AppVersion: 0.1.37](https://img.shields.io/badge/AppVersion-0.1.37-informational?style=flat-square)
33

44
## Prerequisites
55

@@ -27,7 +27,7 @@ We have created a helper utility to resolve this issue:
2727
The utility is packaged in a container image. Below are instructions on executing the utility using Docker:
2828

2929
```
30-
docker run -v <output_dir>:/output quay.io/codefresh/gitops-runtime-private-registry-utils:0.3.5 <local_registry>
30+
docker run -v <output_dir>:/output quay.io/codefresh/gitops-runtime-private-registry-utils:0.4.0 <local_registry>
3131
```
3232
`output_dir` - is a local directory where the utility will output files. <br>
3333
`local_registry` - is your local registry where you want to mirror the images to
@@ -100,14 +100,14 @@ sealed-secrets:
100100
| 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 |
101101
| app-proxy.image.pullPolicy | string | `"IfNotPresent"` | |
102102
| app-proxy.image.repository | string | `"quay.io/codefresh/cap-app-proxy"` | |
103-
| app-proxy.image.tag | string | `"1.2508.3"` | |
103+
| app-proxy.image.tag | string | `"1.2565.0"` | |
104104
| app-proxy.imagePullSecrets | list | `[]` | |
105105
| app-proxy.initContainer.command[0] | string | `"./init.sh"` | |
106106
| app-proxy.initContainer.env | object | `{}` | |
107107
| app-proxy.initContainer.extraVolumeMounts | list | `[]` | Extra volume mounts for init container |
108108
| app-proxy.initContainer.image.pullPolicy | string | `"IfNotPresent"` | |
109109
| app-proxy.initContainer.image.repository | string | `"quay.io/codefresh/cap-app-proxy-init"` | |
110-
| app-proxy.initContainer.image.tag | string | `"1.2508.3"` | |
110+
| app-proxy.initContainer.image.tag | string | `"1.2565.0"` | |
111111
| app-proxy.initContainer.resources.limits.cpu | string | `"1"` | |
112112
| app-proxy.initContainer.resources.limits.memory | string | `"512Mi"` | |
113113
| app-proxy.initContainer.resources.requests.cpu | string | `"0.2"` | |
@@ -277,8 +277,9 @@ sealed-secrets:
277277
| 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. |
278278
| global.codefresh.userToken.secretKeyRef | object | `{}` | User token that references an existing secret containing the token. |
279279
| global.codefresh.userToken.token | string | `""` | User token in plain text. The chart creates and manages the secret for this token. |
280-
| global.runtime | object | `{"cluster":"https://kubernetes.default.svc","eventBus":{"annotations":{},"name":"codefresh-eventbus","nats":{"native":{"auth":"token","containerTemplate":{"resources":{"limits":{"cpu":"500m","ephemeral-storage":"2Gi","memory":"4Gi"},"requests":{"cpu":"200m","ephemeral-storage":"2Gi","memory":"1Gi"}}},"maxPayload":"4MB","replicas":3}},"pdb":{"enabled":true,"minAvailable":2}},"gitCredentials":{"password":{"secretKeyRef":{},"value":null},"username":"username"},"ingress":{"annotations":{},"className":"nginx","enabled":false,"hosts":[],"protocol":"https","tls":[]},"ingressUrl":"","name":null}` | Runtime level settings |
280+
| global.runtime | object | `{"cluster":"https://kubernetes.default.svc","codefreshHosted":false,"eventBus":{"annotations":{},"name":"codefresh-eventbus","nats":{"native":{"auth":"token","containerTemplate":{"resources":{"limits":{"cpu":"500m","ephemeral-storage":"2Gi","memory":"4Gi"},"requests":{"cpu":"200m","ephemeral-storage":"2Gi","memory":"1Gi"}}},"maxPayload":"4MB","replicas":3}},"pdb":{"enabled":true,"minAvailable":2}},"gitCredentials":{"password":{"secretKeyRef":{},"value":null},"username":"username"},"ingress":{"annotations":{},"className":"nginx","enabled":false,"hosts":[],"protocol":"https","tls":[]},"ingressUrl":"","name":null}` | Runtime level settings |
281281
| global.runtime.cluster | string | `"https://kubernetes.default.svc"` | Runtime cluster. Should not be changed. |
282+
| global.runtime.codefreshHosted | bool | `false` | Defines whether this is a Codefresh hosted runtime. Should not be changed. |
282283
| global.runtime.eventBus.annotations | object | `{}` | Annotations on EventBus resource |
283284
| global.runtime.eventBus.name | string | `"codefresh-eventbus"` | Eventbus name |
284285
| global.runtime.eventBus.pdb | object | `{"enabled":true,"minAvailable":2}` | Pod disruption budget for the eventbus |

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ argoWorkflowsInsecure: {{ .Values.config.argoWorkflowsInsecure | quote }}
55
argoWorkflowsUrl: {{ default "" .Values.config.argoWorkflowsUrl }}
66
cors: {{ .Values.global.codefresh.url }}
77
env: {{ .Values.config.env | quote}}
8-
runtimeName: {{ .Values.global.runtime.name | quote}}
8+
runtimeName: {{ required "global.runtime.name is required" .Values.global.runtime.name | quote}}
99
skipGitPermissionValidation: {{ .Values.config.skipGitPermissionValidation | quote }}
1010
logLevel: {{ .Values.config.logLevel | quote }}
1111
{{- $enrichmentValues := get .Values "image-enrichment" }}

charts/gitops-runtime/templates/app-proxy/_app-proxy-env.yaml

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{/*
1+
{{/*
22
Some app-proxy environment variables are determined by values provided in other components,
33
to keep the separation of components as pseudo library charts, they are defined here to be merged when
44
app-proxy components are generated.
@@ -9,8 +9,29 @@ USER_TOKEN:
99
{{- include "codefresh-gitops-runtime.installation-token-env-var-value" . | nindent 2 }}
1010
{{- if or .Values.global.runtime.gitCredentials.password.value .Values.global.runtime.gitCredentials.password.secretKeyRef }}
1111
GIT_USERNAME: {{ .Values.global.runtime.gitCredentials.username }}
12-
GIT_PASSWORD:
12+
GIT_PASSWORD:
1313
{{- include "codefresh-gitops-runtime.runtime-gitcreds.password.env-var-value" . | nindent 2 }}
1414
{{- end }}
1515
WORKFLOW_PIPELINES_WEBHOOKS_TLS_SECRET: codefresh-workflow-pipelines-tls
16+
{{- /* Target account id, used for hosted runtimes registration. Not used in hybrid */}}
17+
{{- if .Values.global.runtime.codefreshHosted }}
18+
INSTALLATION_TYPE: HELM_HOSTED
19+
CODEFRESH_ADMIN_TOKEN:
20+
{{- include "codefresh-gitops-runtime.installation-token-env-var-value" . | nindent 2 }}
21+
{{- if .Values.global.codefresh.accountId }}
22+
TARGET_RUNTIME_ACCOUNT_ID: {{ .Values.global.codefresh.accountId }}
23+
{{- else }}
24+
{{- fail "global.codefresh.accountId must be provided for hosted runtimes"}}
25+
{{- end }}
26+
{{- end }}
27+
{{/*
28+
This will promote argo-rollouts dependency version to app-proxy.
29+
This will be used when installing argo-rollouts using button.
30+
*/}}
31+
{{- range $d := .Chart.Dependencies }}
32+
{{- if eq $d.Name "argo-rollouts" }}
33+
ROLLOUTS_HELM_REPOSITORY: {{ $d.Repository | quote }}
34+
ROLLOUTS_HELM_VERSION: {{ $d.Version | quote }}
35+
{{- end }}
36+
{{- end }}
1637
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
suite: Test hosted runtime flow in app-proxy
2+
templates:
3+
- app-proxy/deployment.yaml
4+
- app-proxy/config.yaml
5+
tests:
6+
- it: accountId appears in app-proxy env if provided - used in hosted
7+
template: 'app-proxy/deployment.yaml'
8+
values:
9+
- ./values/mandatory-values.yaml
10+
set:
11+
global.runtime.codefreshHosted: true
12+
global.codefresh.accountId: "asd123"
13+
asserts:
14+
- contains:
15+
path: spec.template.spec.containers[0].env
16+
content:
17+
name: TARGET_RUNTIME_ACCOUNT_ID
18+
value: "asd123"
19+
20+
- it: Fail template accountId missing for hosted runtime
21+
template: 'app-proxy/deployment.yaml'
22+
values:
23+
- ./values/mandatory-values.yaml
24+
set:
25+
global.runtime.codefreshHosted: true
26+
global.codefresh.accountId: ""
27+
asserts:
28+
- failedTemplate:
29+
errorMessage: 'global.codefresh.accountId must be provided for hosted runtimes'
30+
31+
- it: accountId appears in app-proxy env and runtime type is HELM_HOSTED
32+
template: 'app-proxy/deployment.yaml'
33+
values:
34+
- ./values/mandatory-values.yaml
35+
set:
36+
global.runtime.codefreshHosted: true
37+
global.codefresh.accountId: "asd123"
38+
asserts:
39+
- contains:
40+
path: spec.template.spec.containers[0].env
41+
content:
42+
name: TARGET_RUNTIME_ACCOUNT_ID
43+
value: "asd123"
44+
- contains:
45+
path: spec.template.spec.containers[0].env
46+
content:
47+
name: INSTALLATION_TYPE
48+
value: "HELM_HOSTED"
49+
- notContains:
50+
path: spec.template.spec.containers[0].env
51+
content:
52+
name: INSTALLATION_TYPE
53+
value: "HELM"
54+
55+
- it: Installation type shpuld be Helm by default
56+
template: 'app-proxy/deployment.yaml'
57+
values:
58+
- ./values/mandatory-values.yaml
59+
asserts:
60+
- contains:
61+
path: spec.template.spec.containers[0].env
62+
content:
63+
name: INSTALLATION_TYPE
64+
value: "HELM"
65+
- notContains:
66+
path: spec.template.spec.containers[0].env
67+
content:
68+
name: INSTALLATION_TYPE
69+
value: "HELM_HOSTED"

charts/gitops-runtime/tests/app-proxy-misc_test.yaml

+23
Original file line numberDiff line numberDiff line change
@@ -219,3 +219,26 @@ tests:
219219
content:
220220
name: my-secret
221221
mountPath: /my-secret
222+
223+
- it: Fail template if runtime name not provided
224+
template: 'app-proxy/config.yaml'
225+
set:
226+
global.codefresh.userToken.token: dummy
227+
global.codefresh.accountId: asddd
228+
global.runtime.ingress.enabled: true
229+
global.runtime.ingress.hosts[0]: asddd
230+
asserts:
231+
- failedTemplate:
232+
errorMessage: 'global.runtime.name is required'
233+
234+
- it: Runtime name propagated to app-proxy cm
235+
template: 'app-proxy/config.yaml'
236+
values:
237+
- ./values/mandatory-values.yaml
238+
set:
239+
global.runtime.name: test1
240+
asserts:
241+
- equal:
242+
path: data.runtimeName
243+
value: "test1"
244+

charts/gitops-runtime/tests/installation-token_test.yaml

+36
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,39 @@ tests:
3737
secretKeyRef:
3838
name: mysecret
3939
key: mykey
40+
# Hosted admin token
41+
- it: app proxy - hosted plain string value
42+
template: 'app-proxy/deployment.yaml'
43+
values:
44+
- ./values/mandatory-values-no-token.yaml
45+
set:
46+
global.runtime.codefreshHosted: true
47+
global.codefresh.userToken.token: dummy
48+
asserts:
49+
- contains:
50+
path: spec.template.spec.containers[0].env
51+
content:
52+
name: CODEFRESH_ADMIN_TOKEN
53+
valueFrom:
54+
secretKeyRef:
55+
name: codefresh-user-token
56+
key: token
57+
optional: true
58+
59+
- it: app proxy - hosted secretkeyref
60+
template: 'app-proxy/deployment.yaml'
61+
values:
62+
- ./values/mandatory-values-no-token.yaml
63+
set:
64+
global.runtime.codefreshHosted: true
65+
global.codefresh.userToken.secretKeyRef.name: mysecret
66+
global.codefresh.userToken.secretKeyRef.key: mykey
67+
asserts:
68+
- contains:
69+
path: spec.template.spec.containers[0].env
70+
content:
71+
name: CODEFRESH_ADMIN_TOKEN
72+
valueFrom:
73+
secretKeyRef:
74+
name: mysecret
75+
key: mykey

charts/gitops-runtime/values.yaml

+4-2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ global:
5050
name:
5151
# -- Runtime cluster. Should not be changed.
5252
cluster: https://kubernetes.default.svc
53+
# -- Defines whether this is a Codefresh hosted runtime. Should not be changed.
54+
codefreshHosted: false
5355
# -- Ingress settings
5456
ingress:
5557
# -- The protocol that Codefresh platform will use to access the runtime ingress. Can be http or https.
@@ -416,15 +418,15 @@ app-proxy:
416418
tag: 1.1.10-main
417419
image:
418420
repository: quay.io/codefresh/cap-app-proxy
419-
tag: 1.2508.3
421+
tag: 1.2565.0
420422
pullPolicy: IfNotPresent
421423
# -- Extra volume mounts for main container
422424
extraVolumeMounts: []
423425

424426
initContainer:
425427
image:
426428
repository: quay.io/codefresh/cap-app-proxy-init
427-
tag: 1.2508.3
429+
tag: 1.2565.0
428430
pullPolicy: IfNotPresent
429431
command:
430432
- ./init.sh

0 commit comments

Comments
 (0)