Skip to content

Commit 9a75949

Browse files
upd values.yaml
1 parent b8bcf89 commit 9a75949

12 files changed

+283
-191
lines changed

README.md

Lines changed: 83 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,35 @@
1-
### How to build CF onprem chart locally
1+
# Codefresh On-Premises
22

3-
```shell
4-
# Optionally: update runtime images from SAAS system/default-plan runtime first
5-
./update_re_images.sh
3+
## Prerequisites
64

7-
helm dependency update codefresh --debug
8-
helm package codefresh
9-
```
5+
- Kubernetes 1.19+
6+
- Helm 3.2.0+
7+
- PV provisioner support in the underlying infrastructure
8+
- GCR Service Account JSON `sa.json` (provided by Codefresh)
9+
- Firebase secret (provided by Codefresh)
10+
11+
## Get Repo Info
1012

11-
### How to install CF onprem chart locally
13+
```console
14+
helm repo add codefresh-onprem https://chartmuseum.codefresh.io/codefresh
15+
helm repo update
16+
```
1217

13-
See [kcfi README.md](https://github.com/codefresh-io/kcfi#example---codefresh-onprem-installation)
18+
## Install Chart
1419

15-
or with HELM:
20+
**Important:** only helm3 is supported
1621

1722
- obtain GCR Service Account JSON and Firebase secret from Codefresh:
23+
1824
```shell
25+
GCR_SA_KEY_B64=$(cat sa.json | base64)
1926
DOCKER_CFG_VAR=$(echo -n "_json_key:$(echo ${GCR_SA_KEY_B64} | base64 -d)" | base64 | tr -d '\n')
20-
REGISTRY="gcr.io"
21-
VALUES_MAIN="values-main.yaml"
22-
CF_APP_HOST="myonprem.local"
27+
FIREBASE_SECRET="<token>"
28+
VALUES_MAIN="cf-values.yaml"
29+
CF_APP_HOST="onprem.example.com"
2330
```
2431

25-
- feed them into `values-main.yaml`:
32+
- Edit default `values.yaml` or create empty `cf-values.yaml`
2633

2734
```shell
2835
cat <<EOF > ${VALUES_MAIN}
@@ -36,16 +43,72 @@ firebaseSecret: ${FIREBASE_SECRET}
3643
3744
dockerconfigjson:
3845
auths:
39-
${REGISTRY}:
46+
gcr.io:
4047
auth: ${DOCKER_CFG_VAR}
4148
EOF
4249
```
4350

44-
```shell
45-
helm repo add codefresh-onprem https://chartmuseum.codefresh.io/codefresh
46-
helm pull codefresh-onprem/codefresh
47-
helm upgrade --install cf codefresh-onprem/codefresh -f values-main.yaml --create-namespace --namespace codefresh --debug
51+
- Install Chart
52+
```console
53+
helm upgrade --install cf codefresh-onprem/codefresh -f cf-values.yaml --create-namespace --namespace codefresh --debug
4854
```
4955

50-
### Additional docs
56+
The command deploys Codefresh On-Premises on the Kubernetes cluster in the default configuration.
57+
58+
_See [configuration](#configuration) below._
59+
60+
_See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command documentation._
61+
62+
## Configuration
63+
64+
65+
## Parameters
66+
67+
### Tags
68+
69+
| Name | Description | Value |
70+
| -------------------- | ----------------------------------------------------- | -------------------------------------------------- |
71+
| `tags.cf-infra` | Enable Codefresh Classic services(charts) | `true` |
72+
| `tags.argo-platform` | (WIP) Enable Codefresh Argo-Platform services(charts) | `false` |
73+
| `firebaseUrl` | Firebase URL for logs streaming | `https://codefresh-on-prem.firebaseio.com/on-prem` |
74+
| `firebaseSecret` | Firebase Secret | `placeholder` |
75+
76+
77+
### Global parameters
78+
79+
| Name | Description | Value |
80+
| ----------------------------- | --------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ |
81+
| `global.appUrl` | Application root url | `onprem.codefresh.local` |
82+
| `global.seedJobs` | Instantiate databases with seed data. Used in on-prem environments. `true/false` | `nil` |
83+
| `global.certsJobs` | Generate self-signed certificates for Builder/Runner. Used in on-prem environments. `true/false` | `nil` |
84+
| `global.privateRegistry` | When using private docker registry, enable this flag | `false` |
85+
| `global.dockerRegistry` | Replaces/adds docker registry prefix for images when `privateRegistry` is enabled (has to be with trailing "/") | `""` |
86+
| `global.rabbitService` | Default Internal RabbitMQ service address | `rabbitmq` |
87+
| `global.rabbitmqHostname` | External RabbitMQ service address | `nil` |
88+
| `global.rabbitmqUsername` | Default RabbitMQ username | `user` |
89+
| `global.rabbitmqPassword` | Default RabbitMQ password | `cVz9ZdJKYm7u` |
90+
| `global.mongoURI` | Default Internal MongoDB URI | `mongodb://cfuser:mTiXcU2wafr9@cf-mongodb:27017` |
91+
| `global.mongodbDatabase` | Default MongoDB database name | `codefresh` |
92+
| `global.mongodbRootUser` | Default MongoDB root user | `root` |
93+
| `global.mongodbRootPassword` | Default MongoDB root password | `XT9nmM8dZD` |
94+
| `global.mongodbImage` | Default Image used in seed-jobs | `bitnami/mongodb:4.2` |
95+
| `global.redisService` | Default Internal Redis service address | `redis-master` |
96+
| `global.redisPort` | Default Internal Redis port number | `6379` |
97+
| `global.redisUrl` | Default External Redis service address | `nil` |
98+
| `global.redisPassword` | Default Internal Redis password | `hoC9szf7NtrU` |
99+
| `global.runtimeRedisHost` | Default for OfflineLogging feature | `cf-redis-master` |
100+
| `global.runtimeRedisPassword` | Default for OfflineLogging feature | `hoC9szf7NtrU` |
101+
| `global.runtimeRedisDb` | Default for OfflineLogging feature | `1` |
102+
| `global.runtimeRedisPort` | Default for OfflineLogging feature | `6379` |
103+
| `global.runtimeMongoURI` | Default for OfflineLogging feature | `mongodb://cfuser:mTiXcU2wafr9@cf-mongodb:27017` |
104+
| `global.runtimeMongoDb` | Default for OfflineLogging feature | `codefresh` |
105+
| `global.postgresService` | Default Internal Postgresql service address | `cf-postgresql` |
106+
| `global.postgresHostname` | Default External Postgresql service address | `nil` |
107+
| `global.postgresUser` | Default Internal Postgresql username | `postgres` |
108+
| `global.postgresPassword` | Default Internal Postgresql password | `eC9arYka4ZbH` |
109+
| `global.postgresDatabase` | Default Internal Postgresql database name | `codefresh` |
110+
| `global.postgresPort` | Default Internal Postgresql port number | `5432` |
111+
112+
113+
## Additional Documentation
51114
[Codefresh On-Premises](https://codefresh.io/docs/docs/administration/codefresh-on-prem/)

codefresh/Chart.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,6 @@ dependencies:
5858
version: 1.0.2
5959
tags:
6060
- cf-infra
61-
- name: runner
62-
repository: https://chartmuseum.codefresh.io/runner
63-
condition: runner.enabled
64-
version: 1.0.0
65-
tags:
66-
- cf-infra
6761
- name: ingress-nginx
6862
version: 4.1.0
6963
repository: 'https://kubernetes.github.io/ingress-nginx'

codefresh/templates/configmaps/runtime-envs-cm.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,4 @@ metadata:
1010
heritage: {{ .Release.Service | quote }}
1111
data:
1212
runtimeEnvironments.json: |
13-
{{- if .Values.getRuntimeEnvs }}
1413
{{ include "runtime-environment-config" . | indent 4 }}
15-
{{- else }}
16-
{}
17-
{{- end }}

codefresh/templates/hooks/migrate-hermes-store.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ spec:
2929
{{- end }}
3030
containers:
3131
- name: {{ template "fullname" . }}-migrate-hermes-store
32-
{{- if .Values.global.privateRegistry }}
32+
{{- if .Values.global.privateRegistry }}
3333
image: "{{ .Values.global.dockerRegistry }}codefresh/hermes-store-backup:0.2"
3434
{{- else }}
3535
image: "codefresh/hermes-store-backup:0.2"
@@ -59,6 +59,6 @@ spec:
5959
- "/bin/bash"
6060
- "-c"
6161
- |
62-
{{ .Files.Get (print .Values.migrateHermesDataScript) | indent 12 }}
62+
{{ .Files.Get "files/on-prem/migrateHermesDataScript" | indent 12 }}
6363
restartPolicy: Never
6464
{{- end }}

codefresh/templates/hooks/set-mongo-compat-version.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ spec:
2828
{{- end }}
2929
containers:
3030
- name: {{ template "fullname" . }}-set-mdb-compat-ver
31-
{{- if .Values.global.privateRegistry }}
31+
{{- if .Values.global.privateRegistry }}
3232
image: "{{ .Values.global.dockerRegistry }}{{ .Values.global.mongodbImage }}"
3333
{{- else }}
3434
image: {{ .Values.global.mongodbImage }}
@@ -45,7 +45,7 @@ spec:
4545
- "/bin/bash"
4646
- "-c"
4747
- |
48-
{{ .Files.Get (print .Values.setMdbCompatVerScript ) | indent 12 }}
48+
{{ .Files.Get "files/on-prem/setMdbCompatVerScript" | indent 12 }}
4949
restartPolicy: Never
50-
{{- end }}
50+
{{- end }}
5151
{{- end }}

codefresh/templates/hooks/update-default-runtimes.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,36 +46,36 @@ spec:
4646
- name: MONGO_URI_RE_MANAGER
4747
value: {{ include "calculateMongoURI" (dict "dbName" "runtime-environment-manager" "mongoURI" .Values.global.mongoURI) }}
4848
- name: DIND_IMAGE
49-
value: {{ include "buildImageName" (dict "registry" .Values.global.dockerRegistry "imageFullName" .Values.DIND_IMAGE) }}
49+
value: {{ include "buildImageName" (dict "registry" .Values.global.dockerRegistry "imageFullName" .Values.runtimeImages.DIND_IMAGE) }}
5050
- name: ENGINE_IMAGE
51-
value: {{ include "buildImageName" (dict "registry" .Values.global.dockerRegistry "imageFullName" .Values.ENGINE_IMAGE) }}
51+
value: {{ include "buildImageName" (dict "registry" .Values.global.dockerRegistry "imageFullName" .Values.runtimeImages.ENGINE_IMAGE) }}
5252
- name: DOCKER_PUSHER_IMAGE
53-
value: {{ include "buildImageName" (dict "registry" .Values.global.dockerRegistry "imageFullName" .Values.DOCKER_PUSHER_IMAGE) }}
53+
value: {{ include "buildImageName" (dict "registry" .Values.global.dockerRegistry "imageFullName" .Values.runtimeImages.DOCKER_PUSHER_IMAGE) }}
5454
- name: DOCKER_PULLER_IMAGE
55-
value: {{ include "buildImageName" (dict "registry" .Values.global.dockerRegistry "imageFullName" .Values.DOCKER_PULLER_IMAGE) }}
55+
value: {{ include "buildImageName" (dict "registry" .Values.global.dockerRegistry "imageFullName" .Values.runtimeImages.DOCKER_PULLER_IMAGE) }}
5656
- name: DOCKER_BUILDER_IMAGE
57-
value: {{ include "buildImageName" (dict "registry" .Values.global.dockerRegistry "imageFullName" .Values.DOCKER_BUILDER_IMAGE) }}
57+
value: {{ include "buildImageName" (dict "registry" .Values.global.dockerRegistry "imageFullName" .Values.runtimeImages.DOCKER_BUILDER_IMAGE) }}
5858
- name: CONTAINER_LOGGER_IMAGE
59-
value: {{ include "buildImageName" (dict "registry" .Values.global.dockerRegistry "imageFullName" .Values.CONTAINER_LOGGER_IMAGE) }}
59+
value: {{ include "buildImageName" (dict "registry" .Values.global.dockerRegistry "imageFullName" .Values.runtimeImages.CONTAINER_LOGGER_IMAGE) }}
6060
- name: GIT_CLONE_IMAGE
61-
value: {{ include "buildImageName" (dict "registry" .Values.global.dockerRegistry "imageFullName" .Values.GIT_CLONE_IMAGE) }}
61+
value: {{ include "buildImageName" (dict "registry" .Values.global.dockerRegistry "imageFullName" .Values.runtimeImages.GIT_CLONE_IMAGE) }}
6262
- name: DOCKER_TAG_PUSHER_IMAGE
63-
value: {{ include "buildImageName" (dict "registry" .Values.global.dockerRegistry "imageFullName" .Values.DOCKER_TAG_PUSHER_IMAGE) }}
63+
value: {{ include "buildImageName" (dict "registry" .Values.global.dockerRegistry "imageFullName" .Values.runtimeImages.DOCKER_TAG_PUSHER_IMAGE) }}
6464
- name: FS_OPS_IMAGE
65-
value: {{ include "buildImageName" (dict "registry" .Values.global.dockerRegistry "imageFullName" .Values.FS_OPS_IMAGE) }}
65+
value: {{ include "buildImageName" (dict "registry" .Values.global.dockerRegistry "imageFullName" .Values.runtimeImages.FS_OPS_IMAGE) }}
6666
- name: COMPOSE_IMAGE
67-
value: {{ include "buildImageName" (dict "registry" .Values.global.dockerRegistry "imageFullName" .Values.COMPOSE_IMAGE) }}
67+
value: {{ include "buildImageName" (dict "registry" .Values.global.dockerRegistry "imageFullName" .Values.runtimeImages.COMPOSE_IMAGE) }}
6868
- name: KUBE_DEPLOY
69-
value: {{ include "buildImageName" (dict "registry" .Values.global.dockerRegistry "imageFullName" .Values.KUBE_DEPLOY) }}
69+
value: {{ include "buildImageName" (dict "registry" .Values.global.dockerRegistry "imageFullName" .Values.runtimeImages.KUBE_DEPLOY) }}
7070
- name: TEMPLATE_ENGINE
71-
value: {{ include "buildImageName" (dict "registry" .Values.global.dockerRegistry "imageFullName" .Values.TEMPLATE_ENGINE) }}
71+
value: {{ include "buildImageName" (dict "registry" .Values.global.dockerRegistry "imageFullName" .Values.runtimeImages.TEMPLATE_ENGINE) }}
7272
- name: PIPELINE_DEBUGGER_IMAGE
73-
value: {{ include "buildImageName" (dict "registry" .Values.global.dockerRegistry "imageFullName" .Values.PIPELINE_DEBUGGER_IMAGE) }}
73+
value: {{ include "buildImageName" (dict "registry" .Values.global.dockerRegistry "imageFullName" .Values.runtimeImages.PIPELINE_DEBUGGER_IMAGE) }}
7474
command:
7575
- "/bin/bash"
7676
- "-c"
7777
- |
78-
{{ .Files.Get (print .Values.updateDefREImgScript ) | indent 12 }}
78+
{{ .Files.Get "files/on-prem/updateDefREImgScript" | indent 12 }}
7979
volumeMounts:
8080
{{- if $.Values.global.mongoTLS }}
8181
- mountPath: /etc/ssl/mongodb/

codefresh/templates/jobs/certs-job.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ spec:
2929
containers:
3030
{{- if not .Values.global.clientCertsCA }}
3131
- name: {{ template "fullname" . }}-certs
32-
image: "{{ include "buildImageName" (dict "registry" .Values.global.dockerRegistry "imageFullName" .Values.kubectlImage) }}"
32+
image: "{{ include "buildImageName" (dict "registry" .Values.global.dockerRegistry "imageFullName" .Values.certsJobsImage) }}"
3333
imagePullPolicy: IfNotPresent
3434
command: ["/bin/sh", "/opt/codefresh/gen-runtime-certs"]
3535
env:
@@ -48,7 +48,7 @@ spec:
4848
{{- end }}
4949
{{- if not .Values.webTLS }}
5050
- name: {{ template "fullname" . }}-tls
51-
image: "{{ include "buildImageName" (dict "registry" .Values.global.dockerRegistry "imageFullName" .Values.kubectlImage) }}"
51+
image: "{{ include "buildImageName" (dict "registry" .Values.global.dockerRegistry "imageFullName" .Values.certsJobsImage) }}"
5252
imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }}
5353
command: ["/bin/sh", "/opt/codefresh/gen-website-tls"]
5454
env:

codefresh/templates/jobs/mongo-seed-job.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ spec:
5454
- "/bin/bash"
5555
- "-exc"
5656
- |
57-
{{ .Files.Get (print .Values.mongoSeedJobScript ) | indent 12 }}
57+
{{ .Files.Get "files/on-prem/mongoSeedJobScript" | indent 12 }}
5858
volumeMounts:
5959
- name: seed
6060
mountPath: "/etc/admin/accounts.json"

codefresh/templates/jobs/postgres-clean-cronjob.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,5 @@ spec:
6464
- "/bin/bash"
6565
- "-c"
6666
- |
67-
{{ .Files.Get (print .Values.postgresCleanJobScript ) | indent 16 }}
67+
{{ .Files.Get "files/on-prem/postgresCleanJobScript" | indent 16 }}
6868
{{- end }}

codefresh/templates/jobs/postgres-seed-job.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,5 @@ spec:
9696
- "/bin/bash"
9797
- "-exc"
9898
- |
99-
{{ .Files.Get (print .Values.postgresSeedJobScript ) | indent 12 }}
99+
{{ .Files.Get "files/on-prem/postgresSeedScript" | indent 12 }}
100100
{{- end }}

0 commit comments

Comments
 (0)