-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathREADME.md.gotmpl
More file actions
2718 lines (2128 loc) · 89.2 KB
/
README.md.gotmpl
File metadata and controls
2718 lines (2128 loc) · 89.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
## Codefresh On-Premises
{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }}
Helm chart for deploying [Codefresh On-Premises](https://codefresh.io/docs/docs/getting-started/intro-to-codefresh/) to Kubernetes.
## Table of Content
- [Prerequisites](#prerequisites)
- [Get Repo Info](#get-repo-info)
- [Install Chart](#install-chart)
- [Changes to the Bitnami catalog](#changes-to-the-bitnami-catalog)
- [Chart Configuration](#chart-configuration)
- [Persistent services](#persistent-services)
- [Configuring external services](#configuring-external-services)
- [External MongoDB](#external-mongodb)
- [External MongoDB with MTLS](#external-mongodb-with-mtls)
- [External PostgresSQL](#external-postgressql)
- [External Redis](#external-redis)
- [External Redis with MTLS](#external-redis-with-mtls)
- [External RabbitMQ](#external-rabbitmq)
- [External Consul](#external-consul)
- [External Nats](#external-nats)
- [BoltDB data in Cronus service](#boltdb-data-in-cronus-service)
- [Configuring Ingress-NGINX](#configuring-ingress-nginx)
- [ELB with SSL Termination (Classic Load Balancer)](#elb-with-ssl-termination-classic-load-balancer)
- [NLB (Network Load Balancer)](#nlb-network-load-balancer)
- [Configuration with ALB (Application Load Balancer)](#configuration-with-alb-application-load-balancer)
- [Configuration with Private Registry](#configuration-with-private-registry)
- [Configuration with multi-role CF-API](#configuration-with-multi-role-cf-api)
- [High Availability](#high-availability)
- [Mounting private CA certs](#mounting-private-ca-certs)
- [Installing on OpenShift](#installing-on-openshift)
- [Firebase Configuration](#firebase-configuration)
- [Additional configuration](#additional-configuration)
- [Retention policy for builds and logs](#retention-policy-for-builds-and-logs)
- [Projects pipelines limit](#projects-pipelines-limit)
- [Enable session cookie](#enable-session-cookie)
- [X-Frame-Options response header](#x-frame-options-response-header)
- [Image digests in containers](#image-digests-in-containers)
- [Hermes configuration](#hermes-configuration)
- [Configuring OIDC Provider](#configuring-oidc-provider)
- [Maintaining MongoDB indexes](#maintaining-mongodb-indexes)
- [Upgrading](#upgrading)
- [To 2.0.0](#to-2-0-0)
- [To 2.0.12](#to-2-0-12)
- [To 2.0.17](#to-2-0-17)
- [To 2.1.0](#to-2-1-0)
- [To 2.1.7](#to-2-1-7)
- [To 2.2.0](#to-2-2-0)
- [To 2.3.0](#to-2-3-0)
- [To 2.4.0](#to-2-4-0)
- [To 2.5.0](#to-2-5-0)
- [To 2.6.0](#to-2-6-0)
- [To 2.7.0](#to-2-7-0)
- [To 2.8.0](#to-2-8-0)
- [To 2.9.0](#to-2-9-0)
- [To 2.9.9](#to-2-9-9)
- [To 2.11.0](#to-2-11-0)
- [Rollback](#rollback)
- [Troubleshooting](#troubleshooting)
- [Values](#values)
⚠️⚠️⚠️
> Since version 2.1.7 chart is pushed **only** to OCI registry at `oci://quay.io/codefresh/codefresh`
> Versions prior to 2.1.7 are still available in ChartMuseum at `http://chartmuseum.codefresh.io/codefresh`
## Prerequisites
- Kubernetes **>= 1.28 && <= 1.32** (Supported versions mean that installation passed for the versions listed; however, it **may** work on older k8s versions as well)
- Helm **3.8.0+**
- PV provisioner support in the underlying infrastructure (with [resizing](https://kubernetes.io/blog/2018/07/12/resizing-persistent-volumes-using-kubernetes/) available)
- Minimal 4vCPU and 8Gi Memory available in the cluster (for production usage the recommended minimal cluster capacity is at least 12vCPUs and 36Gi Memory)
- GCR Service Account JSON `sa.json` (provided by Codefresh, contact support@codefresh.io)
- 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)
- Valid TLS certificates for Ingress
- 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)). The `pg_cron` extension should be the 1.4 version or higher for Azure Postgres DB.
- Redis persistent storage is required for CRON triggers in CI pipelines. Make sure that your external Redis instance supports persistence (AOF or RDB). It's recommended to deploy in-cluster Redis with persistence enabled (e.g. [bitnami/redis](https://github.com/bitnami/charts/tree/main/bitnami/redis) or [redis-ha](https://github.com/DandyDeveloper/charts/blob/master/charts/redis-ha/Chart.yaml)). See [Hermes configuration](#hermes-configuration) for more details.
## Get Repo Info
```console
helm show all oci://quay.io/codefresh/codefresh
```
See [Use OCI-based registries](https://helm.sh/docs/topics/registries/)
## Install Chart
**Important:** only helm 3.8.0+ is supported
> [!WARNING]
> The default chart configuration with embedded databases is **not intended for production usage**! You should use Cloud PaaS for MongoDB, PostgreSQL, Redis, RabbitMQ, Nats and Consul.
> See [Configuring external services](#configuring-external-services) section for details.
Edit default `values.yaml` or create empty `cf-values.yaml`
- Pass `sa.json` (as a single line) to `.Values.imageCredentials.password`
```yaml
# -- Credentials for Image Pull Secret object
imageCredentials:
registry: us-docker.pkg.dev
username: _json_key
password: '{ "type": "service_account", "project_id": "codefresh-enterprise", "private_key_id": ... }'
```
- Specify `.Values.global.appUrl`, `.Values.global.firebaseUrl`, `.Values.global.firebaseSecret`, `.Values.global.env.MONGOOSE_AUTO_INDEX`, `.Values.global.env.MONGO_AUTOMATIC_INDEX_CREATION`
```yaml
global:
# -- Application root url. Will be used in Ingress as hostname
appUrl: onprem.mydomain.com
# -- Firebase URL for logs streaming.
firebaseUrl: <>
# -- Firebase URL for logs streaming from existing secret
firebaseUrlSecretKeyRef: {}
# E.g.
# firebaseUrlSecretKeyRef:
# name: my-secret
# key: firebase-url
# -- Firebase Secret.
firebaseSecret: <>
# -- Firebase Secret from existing secret
firebaseSecretSecretKeyRef: {}
# E.g.
# firebaseSecretSecretKeyRef:
# name: my-secret
# key: firebase-secret
# -- Enable index creation in MongoDB
# This is required for first-time installations!
# Before usage in Production, you must set it to `false` or remove it!
env:
MONGOOSE_AUTO_INDEX: "true"
MONGO_AUTOMATIC_INDEX_CREATION: "true"
```
- Specify `.Values.ingress.ingressClassName` with `.Values.ingress.tls.cert` and `.Values.ingress.tls.key` OR `.Values.ingress.tls.existingSecret`
```yaml
ingress:
# -- Enable the Ingress
enabled: true
# -- Set the ingressClass that is used for the ingress.
ingressClassName: your-ingress-class-name
tls:
# -- Enable TLS
enabled: true
# -- Default secret name to be created with provided `cert` and `key` below
secretName: "star.codefresh.io"
# -- Certificate (base64 encoded)
cert: ""
# -- Private key (base64 encoded)
key: ""
# -- Existing `kubernetes.io/tls` type secret with TLS certificates (keys: `tls.crt`, `tls.key`)
existingSecret: ""
```
- Install the chart
```console
helm upgrade --install cf oci://quay.io/codefresh/codefresh \
-f cf-values.yaml \
--namespace codefresh \
--create-namespace \
--debug \
--wait \
--timeout 15m
```
### ⚠️ **MANDATORY** Post-Installation Action Items
Once your Codefresh On-Prem instance is installed, configured, and confirmed to be ready for production use, the following variables must be set to `false` or removed:
```yaml
global:
env:
MONGOOSE_AUTO_INDEX: "false"
MONGO_AUTOMATIC_INDEX_CREATION: "false"
```
## Changes to the Bitnami catalog
Due to changes in the Bitnami catalog (Ref: [Upcoming changes to the Bitnami catalog (effective August 28th, 2025)](https://github.com/bitnami/containers/issues/83267)), the following subcharts have been updated to use `docker.io/bitnamilegacy` repository:
- MongoDB
- PostgreSQL
- Redis
- RabbitMQ
- Nats
- Consul
[Bitnami Legacy repository](https://hub.docker.com/u/bitnamilegacy) catalog will receive no further updates or support and should only be used for temporary evaluation purposes. For production usage, please consider externalizing these services as described in [Configuring external services](#configuring-external-services) section.
If you have an option to use [Bitnami Secure Images](https://www.arrow.com/globalecs/uk/products/bitnami-secure-images/?utm_source=google&utm_medium=paidsearch&utm_campaign=bitnami&gad_source=1&gad_campaignid=22996675622), you need to override image repository and tag for each of Bitnami subcharts used in Codefresh chart and [provide a valid image pull secret](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/#registry-secret-existing-credentials).
```yaml
mongodb:
image:
repository: bitnami/mongodb
tag: <version>
pullSecrets:
- my-bitnami-registry-secret
redis:
image:
repository: bitnami/redis
tag: <version>
pullSecrets:
- my-bitnami-registry-secret
postgresql:
image:
repository: bitnami/postgresql
tag: <version>
pullSecrets:
- my-bitnami-registry-secret
rabbitmq:
image:
repository: bitnami/rabbitmq
tag: <version>
pullSecrets:
- my-bitnami-registry-secret
nats:
image:
repository: bitnami/nats
tag: <version>
pullSecrets:
- my-bitnami-registry-secret
consul:
image:
repository: bitnami/consul
tag: <version>
pullSecrets:
- my-bitnami-registry-secret
```
## Chart Configuration
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:
```console
helm show values codefresh/codefresh
```
### Persistent services
Codefresh relies on several persistent services to store its data:
- **MongoDB**: Stores all account data (account settings, users, projects, pipelines, builds etc.)
- **PostgreSQL**: Stores data about events for the account (pipeline updates, deletes, etc.). The audit log uses the data from this database.
- **Redis**: Used for caching, and as a key-value store for cron trigger manager.
- **RabbitMQ**: Used for message queueing.
- **Consul**: Used for store data about Windows runtimes
- **Cronus**: Used for storing CRON triggers data
The following table reflects the recommended and supported versions of these databases for different Codefresh releases:
| Codefresh version | MongoDB | PostgreSQL | Redis | RabbitMQ | Nats | Consul |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- |
| 2.11.x | \>=4.2 \<=7.x <br> Recommended: 7.x (`featureCompatibilityVersion: 7.0`)| \>= 16.x \<= 17.x <br> Recommended: 17.x | \>= 7.x \<= 8.x <br> Recommended: 8\.x | 3.13.x \| 4.0.x \| 4.1.x <br> Recommended: 4.1.x | 2.11.x <br> Recommended: 2.11.x | 1.21.x <br> Recommended: 1.21.x |
| 2.10.x | \>=4.2 \<=7.x <br> Recommended: 7.x (`featureCompatibilityVersion: 7.0`)| \>= 16.x \<= 17.x <br> Recommended: 17.x | \>= 7.x \<= 8.x <br> Recommended: 8\.x | 3.13.x \| 4.0.x \| 4.1.x <br> Recommended: 4.1.x | 2.11.x <br> Recommended: 2.11.x | 1.21.x <br> Recommended: 1.21.x |
| 2.9.x | \>=4.2 \<=7.x <br> Recommended: 7.x (`featureCompatibilityVersion: 7.0`)| \>= 16.x \<= 17.x <br> Recommended: 17.x | \>= 7.0.x \<= 7.4.x <br> Recommended: 7.4.x | 3.13.x \| 4.0.x \| 4.1.x <br> Recommended: 4.1.x | 2.11.x <br> Recommended: 2.11.x | 1.21.x <br> Recommended: 1.21.x |
| 2.8.x | \>=4.2 \<=7.x <br> Recommended: 7.x (`featureCompatibilityVersion: 6.0`)| \>= 13.x \<= 17.x <br> Recommended: 16.x \| 17.x | \>= 7.0.x \<= 7.4.x <br> Recommended: 7.4.x | 3.13.x \| 4.0.x \| 4.1.x <br> Recommended: 4.0.x | 2.11.x <br> Recommended: 2.11.x | 1.21.x <br> Recommended: 1.21.x |
| 2.7.x | \>=4.2 \<=6.x <br> Recommended: 6.x (`featureCompatibilityVersion: 6.0`)| 13.x | 7.0.x | 3.13.x | 2.10.x, 2.11.x | 1.20.x, 1.21.x |
| 2.6.x | \>=4.2 \<=6.x <br> Recommended: 6.x (`featureCompatibilityVersion: 5.0`)| 13.x | 7.0.x | 3.13.x | 2.10.x | 1.20.x |
> Running on netfs (nfs, cifs) is not recommended.
> Docker daemon (`cf-builder` stateful set) can be run on block storage only.
All of them can be externalized. See the next sections.
### Configuring external services
> [!WARNING]
> The default chart configuration with embedded databases is **not intended for production usage**! You should use Cloud PaaS for MongoDB, PostgreSQL, Redis, RabbitMQ, Nats and Consul.
The chart contains required dependencies for the corresponding services
- [bitnami/mongodb](https://github.com/bitnami/charts/tree/main/bitnami/mongodb)
- [bitnami/postgresql](https://github.com/bitnami/charts/tree/main/bitnami/postgresql)
- [bitnami/redis](https://github.com/bitnami/charts/tree/main/bitnami/redis)
- [bitnami/rabbitmq](https://github.com/bitnami/charts/tree/main/bitnami/rabbitmq)
To use external services like [MongoDB Atlas Database](https://www.mongodb.com/atlas/database) or [Amazon RDS for PostgreSQL](https://aws.amazon.com/rds/postgresql/) you need to adjust the values accordingly:
#### External MongoDB
> ⚠️ **Important!** If you use MongoDB Atlas, you must create user with `Write` permissions before installing Codefresh: <br>
> Then, provide the user credentials in the chart values at <br>
`.Values.global.mongodbUser/mongodbRootUserSecretKeyRef` <br>
`.Values.global.mongodbPassword/mongodbRootPasswordSecretKeyRef` <br>
`.Values.seed.mongoSeedJob.mongodbRootUser/mongodbRootUserSecretKeyRef` <br>
`.Values.seed.mongoSeedJob.mongodbRootPassword/mongodbRootPasswordSecretKeyRef` <br>
> Ref: <br>
> [Create Users in Atlas](https://www.mongodb.com/docs/atlas/security-add-mongodb-users/#configure-database-users)
> [!IMPORTANT]
> By default, Zstd network compression is enabled in Codefresh for MongodDB. Please ensure that Zstd compression is supported and enabled on your MongoDB server. If you'd like to opt out, you can disable it via `.Values.global.env.MONGO_ENABLE_ZSTD_NETWORK_COMPRESSION=false`. Disabling compression is not recommended however, as it may significantly increase amount of traffic and corresponding costs.
`values.yaml` for external MongoDB:
```yaml
seed:
mongoSeedJob:
# -- Enable mongo seed job. Seeds the required data (default idp/user/account), creates cfuser and required databases.
enabled: true
# -- Root user in plain text (required ONLY for seed job!).
mongodbRootUser: "root"
# -- Root user from existing secret
mongodbRootUserSecretKeyRef: {}
# E.g.
# mongodbRootUserSecretKeyRef:
# name: my-secret
# key: mongodb-root-user
# -- Root password in plain text (required ONLY for seed job!).
mongodbRootPassword: "password"
# -- Root password from existing secret
mongodbRootPasswordSecretKeyRef: {}
# E.g.
# mongodbRootPasswordSecretKeyRef:
# name: my-secret
# key: mongodb-root-password
global:
# -- LEGACY (but still supported) - Use `.global.mongodbProtocol` + `.global.mongodbUser/mongodbUserSecretKeyRef` + `.global.mongodbPassword/mongodbPasswordSecretKeyRef` + `.global.mongodbHost/mongodbHostSecretKeyRef` + `.global.mongodbOptions` instead
# Default MongoDB URI. Will be used by ALL services to communicate with MongoDB.
# Ref: https://www.mongodb.com/docs/manual/reference/connection-string/
# Note! `defaultauthdb` is omitted on purpose (i.e. mongodb://.../[defaultauthdb]).
mongoURI: ""
# E.g.
# mongoURI: "mongodb://cfuser:mTiXcU2wafr9@cf-mongodb:27017/"
# -- Set mongodb protocol (`mongodb` / `mongodb+srv`)
mongodbProtocol: mongodb
# -- Set mongodb user in plain text
mongodbUser: "cfuser"
# -- Set mongodb user from existing secret
mongodbUserSecretKeyRef: {}
# E.g.
# mongodbUserSecretKeyRef:
# name: my-secret
# key: mongodb-user
# -- Set mongodb password in plain text
mongodbPassword: "password"
# -- Set mongodb password from existing secret
mongodbPasswordSecretKeyRef: {}
# E.g.
# mongodbPasswordSecretKeyRef:
# name: my-secret
# key: mongodb-password
# -- Set mongodb host in plain text
mongodbHost: "my-mongodb.prod.svc.cluster.local:27017"
# -- Set mongodb host from existing secret
mongodbHostSecretKeyRef: {}
# E.g.
# mongodbHostSecretKeyRef:
# name: my-secret
# key: monogdb-host
# -- Set mongodb connection string options
# Ref: https://www.mongodb.com/docs/manual/reference/connection-string/#connection-string-options
mongodbOptions: "retryWrites=true"
mongodb:
# -- Disable mongodb subchart installation
enabled: false
```
##### Migrating from built-in MongoDB to external MongoDB
> **Note!** `MongoDB` is main database for Codefresh storing all the data about users, projects, pipelines, builds etc.
We're recommending to use `mongodump` and `mongorestore` tools to migrate ALL the data from built-in MongoDB to external MongoDB.
The connection string or `MONGODB_*` environment variables for built-in MongoDB can be obtained in `cfapi` secret.
[mongodump](https://www.mongodb.com/docs/database-tools/mongodump/)
[mongorestore](https://www.mongodb.com/docs/database-tools/mongorestore/)
#### External MongoDB with MTLS
In order to use MTLS (Mutual TLS) for MongoDB, you need:
* Create a K8S secret that contains the certificate (certificate file and private key).
The K8S secret should have one `ca.pem` key.
```console
cat cert.crt > ca.pem
cat cert.key >> ca.pem
kubectl create secret generic my-mongodb-tls --from-file=ca.pem
```
* Add `.Values.global.volumes` and `.Values.global.volumeMounts` to mount the secret into all the services.
```yaml
global:
volumes:
mongodb-tls:
enabled: true
type: secret
nameOverride: my-mongodb-tls
optional: true
volumeMounts:
mongodb-tls:
path:
- mountPath: /etc/ssl/mongodb/ca.pem
subPath: ca.pem
env:
MONGODB_SSL_ENABLED: true
MTLS_CERT_PATH: /etc/ssl/mongodb/ca.pem
RUNTIME_MTLS_CERT_PATH: /etc/ssl/mongodb/ca.pem
RUNTIME_MONGO_TLS: "true"
# Set these env vars to 'false' if self-signed certificate is used to avoid x509 errors
RUNTIME_MONGO_TLS_VALIDATE: "false"
MONGO_MTLS_VALIDATE: "false"
```
#### External PostgresSQL
```yaml
seed:
postgresSeedJob:
# -- Enable postgres seed job. Creates required user and databases.
enabled: true
# -- (optional) "postgres" admin user in plain text (required ONLY for seed job!)
# Must be a privileged user allowed to create databases and grant roles.
# If omitted, username and password from `.Values.global.postgresUser/postgresPassword` will be used.
postgresUser: "postgres"
# -- (optional) "postgres" admin user from exising secret
postgresUserSecretKeyRef: {}
# E.g.
# postgresUserSecretKeyRef:
# name: my-secret
# key: postgres-user
# -- (optional) Password for "postgres" admin user (required ONLY for seed job!)
postgresPassword: "password"
# -- (optional) Password for "postgres" admin user from existing secret
postgresPasswordSecretKeyRef: {}
# E.g.
# postgresPasswordSecretKeyRef:
# name: my-secret
# key: postgres-password
global:
# -- Set postgres user in plain text
postgresUser: cf_user
# -- Set postgres user from existing secret
postgresUserSecretKeyRef: {}
# E.g.
# postgresUserSecretKeyRef:
# name: my-secret
# key: postgres-user
# -- Set postgres password in plain text
postgresPassword: password
# -- Set postgres password from existing secret
postgresPasswordSecretKeyRef: {}
# E.g.
# postgresPasswordSecretKeyRef:
# name: my-secret
# key: postgres-password
# -- Set postgres service address in plain text.
postgresHostname: "my-postgres.domain.us-east-1.rds.amazonaws.com"
# -- Set postgres service from existing secret
postgresHostnameSecretKeyRef: {}
# E.g.
# postgresHostnameSecretKeyRef:
# name: my-secret
# key: postgres-hostname
# -- Set postgres port number
postgresPort: 5432
# -- Set postgres schema name for audit database in plain text.
auditPostgresSchemaName: "public"
# -- Disables saving events from eventbus into postgres.
# When it is set to “false” all events (workflows, jobs, user etc.) from eventbus are starting saving to postgres and following services (charts-manager, cluster-providers, context-manager, cfapi, cf-platform-analytics, gitops-dashboard-manager, pipeline-manager, kube-integration, tasker-kubernetes, runtime-environment-manager) start requiring postgres connection.
disablePostgresForEventbus: "true"
postgresql:
# -- Disable postgresql subchart installation
enabled: false
```
##### Migrating from built-in PostgreSQL to external PostgreSQL
> **Note!** `PostgreSQL` is storing audit logs and analytics data for Codefresh.
We recommend using `pg_dumpall`/`pg_dump` and `psql`/`pg_restore` tools to migrate ALL the data from built-in PostgreSQL to external PostgreSQL.
The connection string or `POSTGRES_*` environment variables for built-in PostgreSQL can be obtained in `cfapi` secret.
[pg_dumpall](https://www.postgresql.org/docs/current/app-pg-dumpall.html)
[pg_dump](https://www.postgresql.org/docs/current/app-pgdump.html)
[pg_restore](https://www.postgresql.org/docs/current/app-pgrestore.html)
##### Using SSL with a PostgreSQL
Provide the following env vars to enforce SSL connection to PostgresSQL:
```yaml
global:
env:
# More info in the official docs: https://www.postgresql.org/docs/current/libpq-envars.html
PGSSLMODE: "require"
helm-repo-manager:
env:
POSTGRES_DISABLE_SSL: "false"
```
> ⚠️ **Important!**<br />
> We do not support custom CA configuration for PostgreSQL, including self-signed certificates. This may cause incompatibility with some providers' default configurations.<br />
> In particular, Amazon RDS for PostgreSQL version 15 and later requires SSL encryption by default ([ref](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/PostgreSQL.Concepts.General.SSL.html#PostgreSQL.Concepts.General.SSL.Requiring)).<br />
> We recommend disabling SSL on the provider side in such cases or using the following steps to mount custom CA certificates: [Mounting private CA certs](#mounting-private-ca-certs)
#### External Redis
```yaml
global:
# -- Set redis password in plain text
redisPassword: password
# -- Set redis service port
redisPort: 6379
# -- Set redis password from existing secret
redisPasswordSecretKeyRef: {}
# E.g.
# redisPasswordSecretKeyRef:
# name: my-secret
# key: redis-password
# -- Set redis hostname in plain text. Takes precedence over `global.redisService`!
redisUrl: "my-redis.namespace.svc.cluster.local"
# -- Set redis hostname from existing secret.
redisUrlSecretKeyRef: {}
# E.g.
# redisUrlSecretKeyRef:
# name: my-secret
# key: redis-url
redis:
# -- Disable redis subchart installation
enabled: false
```
> If ElastiCache is used, set `REDIS_TLS` to `true` in `.Values.global.env`
> ⚠️ ElastiCache with **Cluster mode** is not supported!
##### Migrating from built-in Redis to external Redis
> **Note!** `Redis` among cache is storing data about CRON triggers.
> assuming Codefresh is installed in `codefresh` namespace with `cf` release name
- Get the redis password
```console
kubectl get secret cf-redis -n codefresh -o json | jq -r '.data["redis-password"]' | base64 -d
```
- Exec into built-in Redis pod
```console
kubectl -n codefresh --stdin --tty exec pod/cf-redis-master-0 -- /bin/bash
# Create a dump of the existing data
redis-cli -a <REDIS_PASSWORD> SAVE
```
- Copy the dump file from the pod to local machine
```console
kubectl -n codefresh cp pod/cf-redis-master-0:/data/dump.rdb ./dump.rdb
```
- Import the dump file to external Redis (based on your Redis distribution)
[Restore an RDB file](https://redis.io/tutorials/guides/import/#restore-an-rdb-file)
#### External Redis with MTLS
In order to use [MTLS (Mutual TLS) for Redis](https://redis.io/docs/management/security/encryption/), you need:
* Create a K8S secret that contains the certificate (ca, certificate and private key).
```console
cat ca.crt tls.crt > tls.crt
kubectl create secret tls my-redis-tls --cert=tls.crt --key=tls.key --dry-run=client -o yaml | kubectl apply -f -
```
* Add `.Values.global.volumes` and `.Values.global.volumeMounts` to mount the secret into all the services.
```yaml
global:
volumes:
redis-tls:
enabled: true
type: secret
# Existing secret with TLS certificates (keys: `ca.crt` , `tls.crt`, `tls.key`)
nameOverride: my-redis-tls
optional: true
volumeMounts:
redis-tls:
path:
- mountPath: /etc/ssl/redis
env:
REDIS_TLS: true
REDIS_CA_PATH: /etc/ssl/redis/ca.crt
REDIS_CLIENT_CERT_PATH : /etc/ssl/redis/tls.crt
REDIS_CLIENT_KEY_PATH: /etc/ssl/redis/tls.key
# Set these env vars like that if self-signed certificate is used to avoid x509 errors
REDIS_REJECT_UNAUTHORIZED: false
REDIS_TLS_SKIP_VERIFY: true
```
#### External RabbitMQ
```yaml
global:
# -- Set rabbitmq protocol (`amqp/amqps`)
rabbitmqProtocol: amqp
# -- Set rabbitmq username in plain text
rabbitmqUsername: user
# -- Set rabbitmq username from existing secret
rabbitmqUsernameSecretKeyRef: {}
# E.g.
# rabbitmqUsernameSecretKeyRef:
# name: my-secret
# key: rabbitmq-username
# -- Set rabbitmq password in plain text
rabbitmqPassword: password
# -- Set rabbitmq password from existing secret
rabbitmqPasswordSecretKeyRef: {}
# E.g.
# rabbitmqPasswordSecretKeyRef:
# name: my-secret
# key: rabbitmq-password
# -- Set rabbitmq service address in plain text. Takes precedence over `global.rabbitService`!
rabbitmqHostname: "my-rabbitmq.namespace.svc.cluster.local:5672"
# -- Set rabbitmq service address from existing secret.
rabbitmqHostnameSecretKeyRef: {}
# E.g.
# rabbitmqHostnameSecretKeyRef:
# name: my-secret
# key: rabbitmq-hostname
rabbitmq:
# -- Disable rabbitmq subchart installation
enabled: false
```
#### External Consul
```yaml
global:
# -- Set consul service address
consulHost: "my-consul-headless.namespace.svc.cluster.local"
consul:
# -- Disable consul subchart installation
enabled: false
```
##### Migrating from built-in Consul to external Consul
> **Note!** `Consul` is containg data about Windows runtimes only. If you don't use Windows runtimes in your Codefresh instance, you can skip this migration.
> assuming Codefresh is installed in `codefresh` namespace with `cf` release name
- Port-forward to built-in Consul
```console
kubectl port-forward svc/cf-consul 8500:8500 -n codefresh
```
- Export data from built-in Consul
```console
curl -s http://localhost:8500/v1/snapshot > consul.backup
```
- Port-forward to external Consul
```console
kubectl port-forward svc/my-external-consul-service 8500:8500 -n my-namespace
```
- Import data to external Consul
```console
curl -v -T consul.backup http://localhost:8500/v1/snapshot
```
#### External Nats
```yaml
global:
# -- Set nats service address
queueServers: "nats://my-nats.namespace.svc.cluster.local:4222"
nats:
# -- Disable nats subchart installation
enabled: false
```
#### BoltDB data in Cronus service
`Cronus` service is using embedded `BoltDB` database to store CRON triggers data. The data is stored at `/var/boltdb/events.db` file inside the `cf-cronus` pod.
There is no option to externalize `Cronus` storage at the moment.
In case of migration to another k8s cluster, you may need to copy the `events.db` file from the existing `cf-cronus` pod and mount it to the new `cf-cronus` pod to preserve the CRON triggers data.
- Copy `events.db` file from `cf-cronus` pod
```console
# Old cluster
kubectl -n codefresh cp pod/cf-cronus-0:/var/boltdb/events.db ./events.db
```
- Copy `events.db` file to the new `cf-cronus` pod
```console
# New cluster
kubectl -n codefresh cp ./events.db pod/cf-cronus-0:/var/boltdb/events.db
```
### Configuring Ingress-NGINX
> [!WARNING]
> **⚠️ ⚠️ ⚠️ Ingress-NGINX is [deprecated](https://kubernetes.io/blog/2025/11/11/ingress-nginx-retirement/) since March 2026!**
> It is DISABLED by default in the chart since version 2.11.0 and will be removed in the future releases!
**If enabled**, the chart deploys the [ingress-nginx](https://github.com/kubernetes/ingress-nginx/tree/main) and exposes controller behind a Service of `Type=LoadBalancer`
All installation options for `ingress-nginx` are described at [Configuration](https://github.com/kubernetes/ingress-nginx/tree/main/charts/ingress-nginx#configuration)
Relevant examples for Codefesh are below:
#### ELB with SSL Termination (Classic Load Balancer)
*certificate provided from ACM*
```yaml
ingress-nginx:
enable: true
controller:
service:
annotations:
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: "tcp"
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "443"
service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: '3600'
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: < CERTIFICATE ARN >
targetPorts:
http: http
https: http
# -- Ingress
ingress:
tls:
# -- Disable TLS
enabled: false
```
#### NLB (Network Load Balancer)
*certificate provided as base64 string or as exisiting k8s secret*
```yaml
ingress-nginx:
enable: true
controller:
service:
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: nlb
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: tcp
service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: '3600'
service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: 'true'
# -- Ingress
ingress:
tls:
# -- Enable TLS
enabled: true
# -- Default secret name to be created with provided `cert` and `key` below
secretName: "star.codefresh.io"
# -- Certificate (base64 encoded)
cert: "LS0tLS1CRUdJTiBDRVJ...."
# -- Private key (base64 encoded)
key: "LS0tLS1CRUdJTiBSU0E..."
# -- Existing `kubernetes.io/tls` type secret with TLS certificates (keys: `tls.crt`, `tls.key`)
existingSecret: ""
```
### Configuration with ALB (Application Load Balancer)
*[Application Load Balancer](https://github.com/kubernetes-sigs/aws-load-balancer-controller/tree/main/helm/aws-load-balancer-controller) should be deployed to the cluster*
```yaml
ingress:
# -- ALB contoller ingress class
ingressClassName: alb
annotations:
alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig":{ "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}'
alb.ingress.kubernetes.io/backend-protocol: HTTP
alb.ingress.kubernetes.io/certificate-arn: <ARN>
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]'
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/success-codes: 200,404
alb.ingress.kubernetes.io/target-type: ip
services:
# For ALB /* asterisk is required in path
internal-gateway:
- /*
```
### Configuration with Private Registry
If you install/upgrade Codefresh on an air-gapped environment without access to public registries (i.e. `quay.io`/`docker.io`) or Codefresh Enterprise registry at `gcr.io`, you will have to mirror the images to your organization’s container registry.
- Obtain [image list](https://github.com/codefresh-io/onprem-images/tree/master/releases) for specific release
- [Push images](https://github.com/codefresh-io/onprem-images/blob/master/push-to-registry.sh) to private docker registry
- Specify image registry in values
```yaml
global:
imageRegistry: myregistry.domain.com
```
There are 3 types of images, with the values above in rendered manifests images will be converted as follows:
**non-Codefresh** like:
```yaml
bitnami/mongo:4.2
registry.k8s.io/ingress-nginx/controller:v1.4.0
postgres:13
```
converted to:
```yaml
myregistry.domain.com/bitnami/mongodb:4.2
myregistry.domain.com/ingress-nginx/controller:v1.2.0
myregistry.domain.com/postgres:13
```
Codefresh **public** images like:
```yaml
quay.io/codefresh/dind:20.10.13-1.25.2
quay.io/codefresh/engine:1.147.8
quay.io/codefresh/cf-docker-builder:1.1.14
```
converted to:
```yaml
myregistry.domain.com/codefresh/dind:20.10.13-1.25.2
myregistry.domain.com/codefresh/engine:1.147.8
myregistry.domain.com/codefresh/cf-docker-builder:1.1.14
```
Codefresh **private** images like:
```yaml
gcr.io/codefresh-enterprise/codefresh/cf-api:21.153.6
gcr.io/codefresh-enterprise/codefresh/cf-ui:14.69.38
gcr.io/codefresh-enterprise/codefresh/pipeline-manager:3.121.7
```
converted to:
```yaml
myregistry.domain.com/codefresh/cf-api:21.153.6
myregistry.domain.com/codefresh/cf-ui:14.69.38
myregistry.domain.com/codefresh/pipeline-manager:3.121.7
```
Use the example below to override repository for all templates:
```yaml
global:
imagePullSecrets:
- cf-registry
ingress-nginx:
controller:
image:
registry: myregistry.domain.com
image: codefresh/controller
mongodb:
image:
repository: codefresh/mongodb
postgresql:
image:
repository: codefresh/postgresql
consul:
image:
repository: codefresh/consul
redis:
image:
repository: codefresh/redis
rabbitmq:
image:
repository: codefresh/rabbitmq
nats:
image:
repository: codefresh/nats
builder:
container:
image:
repository: codefresh/docker
runner:
container:
image:
repository: codefresh/docker
internal-gateway:
container:
image:
repository: codefresh/nginx-unprivileged
helm-repo-manager:
chartmuseum:
image:
repository: myregistry.domain.com/codefresh/chartmuseum
cf-platform-analytics-platform:
redis:
image:
repository: codefresh/redis
```
### Configuration with multi-role CF-API
The chart installs cf-api as a single deployment. Though, at a larger scale, we do recommend to split cf-api to multiple roles (one deployment per role) as follows:
```yaml
global:
# -- Change internal cfapi service address
cfapiService: cfapi-internal
# -- Change endpoints cfapi service address
cfapiEndpointsService: cfapi-endpoints
cfapi: &cf-api
# -- Disable default cfapi deployment
enabled: false
# -- (optional) Enable the autoscaler
# The value will be merged into each cfapi role. So you can specify it once.
hpa:
enabled: true
# Enable cf-api roles
cfapi-auth:
<<: *cf-api
enabled: true
cfapi-internal:
<<: *cf-api
enabled: true
cfapi-ws:
<<: *cf-api
enabled: true
cfapi-admin:
<<: *cf-api
enabled: true