Skip to content

Commit d469c98

Browse files
onprem 2.1.0 pre-release (#1095)
1 parent bf2a488 commit d469c98

File tree

8 files changed

+328
-162
lines changed

8 files changed

+328
-162
lines changed

codefresh/.ci/values/defaults-hpa.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,4 @@ argo-platform:
145145

146146
abac:
147147
hpa:
148-
enabled: true
148+
enabled: true

codefresh/.ci/values/upgrade.yaml

Whitespace-only changes.

codefresh/Chart.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ dependencies:
109109
version: 21.233.16
110110
- name: cfui
111111
repository: https://chartmuseum.codefresh.io/cfui
112-
version: 14.91.79
112+
version: 14.91.81
113113
- name: k8s-monitor
114114
repository: https://chartmuseum.codefresh.io/k8s-monitor
115115
version: 4.11.2
@@ -133,18 +133,18 @@ dependencies:
133133
version: 0.8.1
134134
- name: cf-platform-analytics
135135
repository: https://chartmuseum.codefresh.io/cf-platform-analytics
136-
version: 0.49.10
136+
version: 0.49.11
137137
- name: cf-platform-analytics
138138
repository: https://chartmuseum.codefresh.io/cf-platform-analytics
139-
version: 0.49.10
139+
version: 0.49.11
140140
- name: argo-platform
141141
repository: https://chartmuseum.codefresh.io/argo-platform
142-
version: 1.2403.0
142+
version: 1.2406.0
143143
- name: argo-hub-platform
144144
repository: https://chartmuseum.codefresh.io/argo-hub-platform
145145
version: 0.1.4
146146
- name: codefresh-tunnel-server
147147
repository: https://chartmuseum.codefresh.io/codefresh-tunnel-server
148148
version: 0.1.14
149-
digest: sha256:2092a1608dbe4b5981c9ea703b3a150116b915cd5a104fab5a011609bc941997
150-
generated: "2023-08-24T17:37:18.542323454+03:00"
149+
digest: sha256:6d28402df7f036b69e5f35591c87c69eb40b4f6a0269c40910d7f2054be21829
150+
generated: "2023-08-25T20:37:19.318627237+03:00"

codefresh/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
description: Helm Chart for Codefresh On-Prem
33
name: codefresh
4-
version: 2.1.0-alpha.1
4+
version: 2.1.0-alpha.2
55
keywords:
66
- codefresh
77
home: https://codefresh.io/
@@ -16,7 +16,7 @@ annotations:
1616
artifacthub.io/alternativeName: "codefresh-onprem"
1717
artifacthub.io/changes: |
1818
- kind: added
19-
description: onprem 2.1.0-alpha.1 pre-release
19+
description: onprem 2.1.0-alpha.2 pre-release
2020
artifacthub.io/prerelease: "true"
2121
dependencies:
2222
- name: cf-common

codefresh/README.md

Lines changed: 104 additions & 36 deletions
Large diffs are not rendered by default.

codefresh/README.md.gotmpl

Lines changed: 89 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Helm chart for deploying [Codefresh On-Premises](https://codefresh.io/docs/docs/
99
- [Prerequisites](#prerequisites)
1010
- [Get Repo Info](#get-repo-info)
1111
- [Install Chart](#install-chart)
12-
- [Helm Chart Configuration](#helm-chart-configuration)
12+
- [Chart Configuration](#chart-configuration)
1313
- [Persistent services](#persistent-services)
1414
- [Configuring external services](#configuring-external-services)
1515
- [External MongoDB](#external-mongodb)
@@ -30,13 +30,14 @@ Helm chart for deploying [Codefresh On-Premises](https://codefresh.io/docs/docs/
3030
- [Firebase Configuration](#firebase-configuration)
3131
- [Additional configuration](#additional-configuration)
3232
- [Retention policy for builds and logs](#retention-policy-for-builds-and-logs)
33-
- [Project's pipelines limit](#projects-pipelines-limit)
33+
- [Projects pipelines limit](#projects-pipelines-limit)
3434
- [Enable session cookie](#enable-session-cookie)
3535
- [Upgrading](#upgrading)
36-
- [To 2.0.0](#to-200)
37-
- [To 2.0.12](#to-2012)
38-
- [To 2.1.0](#to-210)
36+
- [To 2-0-0](#to-200)
37+
- [To 2-0-12](#to-2012)
38+
- [To 2-1-0](#to-210)
3939
- [Rollback](#rollback)
40+
- [Troubleshooting](#troubleshooting)
4041
- [Values](#values)
4142

4243
## Prerequisites
@@ -45,11 +46,10 @@ Helm chart for deploying [Codefresh On-Premises](https://codefresh.io/docs/docs/
4546
- Helm **3.8.0+**
4647
- PV provisioner support in the underlying infrastructure
4748
- GCR Service Account JSON `sa.json` (provided by Codefresh, contact support@codefresh.io)
48-
- Firebase [Realtime Database URL](https://firebase.google.com/docs/database/web/start#create_a_database) and [legacy token](https://firebase.google.com/docs/database/rest/auth#legacy_tokens) for it. See [Firebase Configuration](#firebase-configuration)
49+
- Firebase [Realtime Database URL](https://firebase.google.com/docs/database/web/start#create_a_database) with [legacy token](https://firebase.google.com/docs/database/rest/auth#legacy_tokens). See [Firebase Configuration](#firebase-configuration)
4950
- Valid TLS certificates for Ingress
5051
- When [external](#external-postgressql) PostgreSQL is used, `pg_cron` and `pg_partman` extensions **must be enabled** for [analytics](https://codefresh.io/docs/docs/dashboards/home-dashboard/#pipelines-dashboard) to work (see [AWS RDS example](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/PostgreSQL_pg_cron.html#PostgreSQL_pg_cron.enable))
5152

52-
5353
## Get Repo Info
5454

5555
```console
@@ -121,12 +121,25 @@ ingress:
121121
# -- Existing `kubernetes.io/tls` type secret with TLS certificates (keys: `tls.crt`, `tls.key`)
122122
existingSecret: ""
123123

124-
# -- ingress-nginx
125124
ingress-nginx:
126125
# -- Enable ingress-nginx controller
127126
enabled: true
128127
```
129128

129+
- *Or specify your own `.Values.ingress.ingressClassName` (disable built-in ingress-nginx subchart)*
130+
131+
```yaml
132+
ingress:
133+
# -- Enable the Ingress
134+
enabled: true
135+
# -- Set the ingressClass that is used for the ingress.
136+
ingressClassName: nginx
137+
138+
ingress-nginx:
139+
# -- Disable ingress-nginx controller
140+
enabled: false
141+
```
142+
130143
- Install the chart
131144

132145
```console
@@ -152,7 +165,7 @@ helm upgrade --install cf codefresh/codefresh \
152165
```
153166

154167

155-
## Helm Chart Configuration
168+
## Chart Configuration
156169

157170
See [Customizing the Chart Before Installing](https://helm.sh/docs/intro/using_helm/#customizing-the-chart-before-installing). To see all configurable options with detailed comments, visit the chart's [values.yaml](./values.yaml), or run these configuration commands:
158171

@@ -168,7 +181,7 @@ The following table displays the list of **persistent** services created as part
168181
| :--- | :---- | :--- |
169182
| MongoDB | Stores all account data (account settings, users, projects, pipelines, builds etc.) | 4.4.x |
170183
| Postgresql | Stores data about events for the account (pipeline updates, deletes, etc.). The audit log uses the data from this database. | 13.x |
171-
| Redis | Used for caching, and as a key-value store for cron trigger manager. | 6.0.x |
184+
| Redis | Used for caching, and as a key-value store for cron trigger manager. | 7.0.x |
172185

173186
> Running on netfs (nfs, cifs) is not recommended.
174187

@@ -236,15 +249,15 @@ global:
236249

237250
# -- Set mongodb password in plain text
238251
mongodbPassword: "password"
239-
# -- Set monogdb password from existing secret
252+
# -- Set mongodb password from existing secret
240253
mongodbPasswordSecretKeyRef: {}
241254
# E.g.
242255
# mongodbPasswordSecretKeyRef:
243256
# name: my-secret
244257
# key: mongodb-password
245258

246259
# -- Set mongodb host in plain text
247-
mongodbHost: "my-mongodb.prod.svc.cluster.local"
260+
mongodbHost: "my-mongodb.prod.svc.cluster.local:27017"
248261
# -- Set mongodb host from existing secret
249262
mongodbHostSecretKeyRef: {}
250263
# E.g.
@@ -310,7 +323,7 @@ seed:
310323
enabled: true
311324
# -- (optional) "postgres" admin user in plain text (required ONLY for seed job!)
312325
# Must be a privileged user allowed to create databases and grant roles.
313-
# If omitted, username and password from `.Values.global.postgresUser/postgresPassword` will be taken.
326+
# If omitted, username and password from `.Values.global.postgresUser/postgresPassword` will be used.
314327
postgresUser: "postgres"
315328
# -- (optional) "postgres" admin user from exising secret
316329
postgresUserSecretKeyRef: {}
@@ -1361,7 +1374,8 @@ helm-repo-manager:
13611374
#### Affected values:
13621375

13631376
- [Legacy ChartMuseum subchart deprecation](#to-2012)
1364-
- **Deprecated** (still supported for backward compatibility!) `global.mongoURI`
1377+
- **Changed** default ingress paths. All point to `internal-gateway` now. **Remove any overrides at `.Values.ingress.services`!**
1378+
- **Deprecated** `global.mongoURI`. **Still supported for backward compatibility!**
13651379
- **Added** `global.mongodbProtocol` / `global.mongodbUser` / `global.mongodbPassword` / `global.mongodbHost` / `global.mongodbOptions`
13661380
- **Added** `global.mongodbUserSecretKeyRef` / `global.mongodbPasswordSecretKeyRef` / `global.mongodbHostSecretKeyRef`
13671381
- **Added** `seed.mongoSeedJob.mongodbRootUserSecretKeyRef` / `seed.mongoSeedJob.mongodbRootPasswordSecretKeyRef`
@@ -1392,4 +1406,65 @@ helm rollback $RELEASE_NAME $RELEASE_NUMBER \
13921406
--wait
13931407
```
13941408

1409+
## Troubleshooting
1410+
1411+
### Error: Failed to validate connection to Docker daemon; caused by Error: certificate has expired
1412+
1413+
Builds are stuck in pending with `Error: Failed to validate connection to Docker daemon; caused by Error: certificate has expired`
1414+
1415+
**Reason:** Runtime certificates have expiried.
1416+
1417+
To check if runtime internal CA expired:
1418+
1419+
```console
1420+
kubectl -n $NAMESPACE get secret/cf-codefresh-certs-client -o jsonpath="{.data['ca\.pem']}" | base64 -d | openssl x509 -enddate -noout
1421+
```
1422+
1423+
**Resolution:** Replace internal CA and re-issue dind certs for runtime
1424+
1425+
- Delete k8s secret with expired certificate
1426+
```console
1427+
kubectl -n $NAMESPACE delete secret cf-codefresh-certs-client
1428+
```
1429+
1430+
- Set `.Values.global.gencerts.enabled=true` (`.Values.global.certsJob=true` for onprem < 2.x version)
1431+
1432+
```yaml
1433+
# -- Job to generate internal runtime secrets.
1434+
# @default -- See below
1435+
gencerts:
1436+
enabled: true
1437+
```
1438+
1439+
- Upgrade Codefresh On-Prem Helm release. It will recreate `cf-codefresh-certs-client` secret
1440+
```console
1441+
helm upgrade --install cf codefresh/codefresh \
1442+
-f cf-values.yaml \
1443+
--namespace codefresh \
1444+
--create-namespace \
1445+
--debug \
1446+
--wait \
1447+
--timeout 15m
1448+
```
1449+
1450+
- Restart `cfapi` and `cfsign` deployments
1451+
1452+
```console
1453+
kubectl -n $NAMESPACE rollout restart deployment/cf-cfapi
1454+
kubectl -n $NAMESPACE rollout restart deployment/cf-cfsign
1455+
```
1456+
1457+
**Case A:** Codefresh Runner installed with HELM chart ([charts/cf-runtime](https://github.com/codefresh-io/venona/tree/release-1.0/charts/cf-runtime))
1458+
1459+
Re-apply the `cf-runtime` helm chart. Post-upgrade `gencerts-dind` helm hook will regenerate the dind certificates using a new CA.
1460+
1461+
**Case B:** Codefresh Runner installed with legacy CLI ([codefresh runner init](https://codefresh-io.github.io/cli/runner/init/))
1462+
1463+
Delete `codefresh-certs-server` k8s secret and run [./configure-dind-certs.sh](https://github.com/codefresh-io/venona/blob/release-1.0/charts/cf-runtime/files/configure-dind-certs.sh) in your runtime namespace.
1464+
1465+
```console
1466+
kubectl -n $NAMESPACE delete secret codefresh-certs-server
1467+
./configure-dind-certs.sh -n $RUNTIME_NAMESPACE https://$CODEFRESH_HOST $CODEFRESH_API_TOKEN
1468+
```
1469+
13951470
{{ template "chart.valuesSection" . }}

codefresh/templates/gencerts/cm-gencerts.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ data:
5555
openssl genrsa -out $CA_KEY 4096
5656
5757
echo "--- Generate ca.pem"
58-
openssl req -new -x509 -days 1024 -key $CA_KEY -sha256 -out $CA_PEM -subj "/CN=ca.codefresh.io" -addext "subjectAltName = DNS:ca.{{ .Values.global.appUrl }}"
58+
openssl req -new -x509 -days 3653 -key $CA_KEY -sha256 -out $CA_PEM -subj "/CN=ca.codefresh.io" -addext "subjectAltName = DNS:ca.{{ .Values.global.appUrl }}"
5959
6060
echo "--- Generate server-key.pem"
6161
openssl genrsa -out $SERVER_KEY 4096
@@ -71,7 +71,7 @@ data:
7171
cat $EXTFILE
7272
7373
echo "--- sign certificate $SERVER_PEM "
74-
openssl x509 -req -days 1024 -sha256 -in $SERVER_CSR -CA $CA_PEM -CAkey $CA_KEY \
74+
openssl x509 -req -days 3653 -sha256 -in $SERVER_CSR -CA $CA_PEM -CAkey $CA_KEY \
7575
-CAcreateserial -out $SERVER_PEM -extfile $EXTFILE || err "Failed to sign certificate"
7676
7777
cp -v $SERVER_PEM $CLIENT_CERT

0 commit comments

Comments
 (0)