Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup Helm values #2767

Merged
merged 3 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions INSTALL.EKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,14 @@ Use the following Helm command to install Korifi:
```sh
helm install korifi https://github.com/cloudfoundry/korifi/releases/download/v<VERSION>/korifi-<VERSION>.tgz \
--namespace="$KORIFI_NAMESPACE" \
--set=global.generateIngressCertificates=true \
--set=global.rootNamespace="${ROOT_NAMESPACE}" \
--set=generateIngressCertificates=true \
--set=rootNamespace="${ROOT_NAMESPACE}" \
--set=adminUserName="${ADMIN_USERNAME}" \
--set=api.apiServer.url="api.${BASE_DOMAIN}" \
--set=global.defaultAppDomainName="apps.${BASE_DOMAIN}" \
--set=global.containerRepositoryPrefix="${ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${CLUSTER_NAME}/" \
--set=global.containerRegistrySecrets={} \
--set=global.eksContainerRegistryRoleARN="${ECR_ROLE_ARN}" \
--set=defaultAppDomainName="apps.${BASE_DOMAIN}" \
--set=containerRepositoryPrefix="${ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${CLUSTER_NAME}/" \
--set=containerRegistrySecrets={} \
--set=eksContainerRegistryRoleARN="${ECR_ROLE_ARN}" \
--set=kpackImageBuilder.builderRepository="${KPACK_BUILDER_REPO}" \
--wait
```
Expand Down
4 changes: 2 additions & 2 deletions INSTALL.kind.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ No changes here, follow the [common instructions](./INSTALL.md#install-korifi).
If using DockerHub as recommended above, set the following values:

- `kpackImageBuilder.builderRepository`: `index.docker.io/<username>/kpack-builder`;
- `global.containerRepositoryPrefix`: `index.docker.io/<username>/`;
- `containerRepositoryPrefix`: `index.docker.io/<username>/`;

Remember to set `global.generateIngressCertificates` to `true` if you want to use self-signed TLS certificates.
Remember to set `generateIngressCertificates` to `true` if you want to use self-signed TLS certificates.

If `$KORIFI_NAMESPACE` doesn't exist yet, you can add the `--create-namespace` flag to the `helm` invocation.

Expand Down
18 changes: 9 additions & 9 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ Make sure the value of `--docker-server` is a valid [URI authority](https://data

### TLS certificates

Self-signed TLS certificates are generated automatically by the installation if `global.generateIngressCertificates` has been set to `true`.
Self-signed TLS certificates are generated automatically by the installation if `generateIngressCertificates` has been set to `true`.

If you want to generate certificates yourself, you should not set the `global.generateIngressCertificates` value, and instead provide your certificates to Korifi by creating two TLS secrets in `$KORIFI_NAMESPACE`:
If you want to generate certificates yourself, you should not set the `generateIngressCertificates` value, and instead provide your certificates to Korifi by creating two TLS secrets in `$KORIFI_NAMESPACE`:

1. `korifi-api-ingress-cert`;
1. `korifi-workloads-ingress-cert`.
Expand All @@ -139,7 +139,7 @@ kubectl --namespace "$KORIFI_NAMESPACE" create secret generic <registry-ca-secre
--from-file=ca.crt=</path/to/ca-certificate>
```

You can then specify the `<registry-ca-secret-name>` using the `global.containerRegistryCACertSecret`.
You can then specify the `<registry-ca-secret-name>` using the `containerRegistryCACertSecret`.

> **Warning**
> Kpack does not support self-signed/internal CA configuration out of the box (see [pivotal/kpack#207](https://github.com/pivotal/kpack/issues/207)).
Expand All @@ -156,17 +156,17 @@ For example:
```sh
helm install korifi https://github.com/cloudfoundry/korifi/releases/download/v<VERSION>/korifi-<VERSION>.tgz \
--namespace="$KORIFI_NAMESPACE" \
--set=global.generateIngressCertificates=true \
--set=global.rootNamespace="$ROOT_NAMESPACE" \
--set=generateIngressCertificates=true \
--set=rootNamespace="$ROOT_NAMESPACE" \
--set=adminUserName="$ADMIN_USERNAME" \
--set=api.apiServer.url="api.$BASE_DOMAIN" \
--set=global.defaultAppDomainName="apps.$BASE_DOMAIN" \
--set=global.containerRepositoryPrefix=europe-docker.pkg.dev/my-project/korifi/ \
--set=defaultAppDomainName="apps.$BASE_DOMAIN" \
--set=containerRepositoryPrefix=europe-docker.pkg.dev/my-project/korifi/ \
--set=kpackImageBuilder.builderRepository=europe-docker.pkg.dev/my-project/korifi/kpack-builder \
--wait
```

`global.containerRepositoryPrefix` is used to determine the container repository for the package and droplet images produced by Korifi.
`containerRepositoryPrefix` is used to determine the container repository for the package and droplet images produced by Korifi.
In particular, the app GUID and image type (`packages` or `droplets`) are appended to form the name of the repository.
For example:

Expand Down Expand Up @@ -200,7 +200,7 @@ Make sure your ingress targets a service with name `korifi-api-svc` and port `44
Create DNS entries for the Korifi API and for the apps running on Korifi. They should match the Helm values used to [deploy Korifi](#deploy-korifi):

- The Korifi API entry should match the `api.apiServer.url` value. In our example, that would be `api.korifi.example.org`.
- The apps entry should be a wildcard matching the `global.defaultAppDomainName` value. In our example, `*.apps.korifi.example.org`.
- The apps entry should be a wildcard matching the `defaultAppDomainName` value. In our example, `*.apps.korifi.example.org`.

The DNS entries should point to the load balancer endpoint created by Contour when installed. To discover your endpoint, run:

Expand Down
34 changes: 16 additions & 18 deletions README.helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,6 @@ See [_Customizing the Chart Before Installing_](https://helm.sh/docs/intro/using

Here are all the values that can be set for the chart:

- `global`: Global values that are shared between Korifi and its subcharts.
- `containerRegistrySecret` (_String_): Deprecated in favor of containerRegistrySecrets.
- `containerRegistrySecrets` (_Array_): List of `Secret` names to use when pushing or pulling from package, droplet and kpack builder repositories. Required if eksContainerRegistryRoleARN not set. Ignored if eksContainerRegistryRoleARN is set.
- `containerRepositoryPrefix` (_String_): The prefix of the container repository where package and droplet images will be pushed. This is suffixed with the app GUID and `-packages` or `-droplets`. For example, a value of `index.docker.io/korifi/` will result in `index.docker.io/korifi/<appGUID>-packages` and `index.docker.io/korifi/<appGUID>-droplets` being pushed.
- `debug` (_Boolean_): Enables remote debugging with [Delve](https://github.com/go-delve/delve).
- `defaultAppDomainName` (_String_): Base domain name for application URLs.
- `eksContainerRegistryRoleARN` (_String_): Amazon Resource Name (ARN) of the IAM role to use to access the ECR registry from an EKS deployed Korifi. Required if containerRegistrySecret not set.
- `generateIngressCertificates` (_Boolean_): Use `cert-manager` to generate self-signed certificates for the API and app endpoints.
- `logLevel` (_String_): Sets level of logging for api and controllers components. Can be 'info' or 'debug'.
- `reconcilers`:
- `app` (_String_): ID of the workload runner to set on all `AppWorkload` objects. Defaults to `statefulset-runner`.
- `build` (_String_): ID of the image builder to set on all `BuildWorkload` objects. Has to match `api.builderName`. Defaults to `kpack-image-builder`.
- `rootNamespace` (_String_): Root of the Cloud Foundry namespace hierarchy.
- `adminUserName` (_String_): Name of the admin user that will be bound to the Cloud Foundry Admin role.
- `api`:
- `apiServer`:
Expand All @@ -36,16 +23,11 @@ Here are all the values that can be set for the chart:
- `authProxy`: Needed if using a cluster authentication proxy, e.g. [Pinniped](https://pinniped.dev/).
- `caCert` (_String_): Proxy's PEM-encoded CA certificate (*not* as Base64).
- `host` (_String_): Must be a host string, a host:port pair, or a URL to the base of the apiserver.
- `builderName` (_String_): ID of the builder used to build apps. Defaults to `kpack-image-builder`.
- `expose` (_Boolean_): Expose the API component via Contour. Set to false if you want to expose the API using other means.
- `image` (_String_): Reference to the API container image.
- `include` (_Boolean_): Deploy the API component.
- `lifecycle`: Default lifecycle for apps.
- `stack` (_String_): Stack.
- `stagingRequirements`:
- `buildCacheMB` (_Integer_): Persistent disk in MB for caching staging artifacts across builds.
- `diskMB` (_Integer_): Ephemeral Disk request in MB for staging apps.
- `memoryMB` (_Integer_): Memory request in MB for staging.
- `type` (_String_): Lifecycle type (only `buildpack` accepted currently).
- `replicas` (_Integer_): Number of replicas.
- `resources`: [`ResourceRequirements`](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#resourcerequirements-v1-core) for the API.
Expand All @@ -56,6 +38,9 @@ Here are all the values that can be set for the chart:
- `cpu` (_String_): CPU request.
- `memory` (_String_): Memory request.
- `userCertificateExpirationWarningDuration` (_String_): Issue a warning if the user certificate provided for login has a long expiry. See [`time.ParseDuration`](https://pkg.go.dev/time#ParseDuration) for details on the format.
- `containerRegistrySecret` (_String_): Deprecated in favor of containerRegistrySecrets.
- `containerRegistrySecrets` (_Array_): List of `Secret` names to use when pushing or pulling from package, droplet and kpack builder repositories. Required if eksContainerRegistryRoleARN not set. Ignored if eksContainerRegistryRoleARN is set.
- `containerRepositoryPrefix` (_String_): The prefix of the container repository where package and droplet images will be pushed. This is suffixed with the app GUID and `-packages` or `-droplets`. For example, a value of `index.docker.io/korifi/` will result in `index.docker.io/korifi/<appGUID>-packages` and `index.docker.io/korifi/<appGUID>-droplets` being pushed.
- `contourRouter`:
- `include` (_Boolean_): Deploy the `contour-router` component.
- `controllers`:
Expand All @@ -77,6 +62,10 @@ Here are all the values that can be set for the chart:
- `memory` (_String_): Memory request.
- `taskTTL` (_String_): How long before the `CFTask` object is deleted after the task has completed. See [`time.ParseDuration`](https://pkg.go.dev/time#ParseDuration) for details on the format, an additional `d` suffix for days is supported.
- `workloadsTLSSecret` (_String_): TLS secret used when setting up an app routes.
- `debug` (_Boolean_): Enables remote debugging with [Delve](https://github.com/go-delve/delve).
- `defaultAppDomainName` (_String_): Base domain name for application URLs.
- `eksContainerRegistryRoleARN` (_String_): Amazon Resource Name (ARN) of the IAM role to use to access the ECR registry from an EKS deployed Korifi. Required if containerRegistrySecret not set.
- `generateIngressCertificates` (_Boolean_): Use `cert-manager` to generate self-signed certificates for the API and app endpoints.
- `helm`:
- `hooksImage` (_String_): Image for the helm hooks containing kubectl
- `jobTaskRunner`:
Expand Down Expand Up @@ -106,6 +95,15 @@ Here are all the values that can be set for the chart:
- `requests`: Resource requests.
- `cpu` (_String_): CPU request.
- `memory` (_String_): Memory request.
- `logLevel` (_String_): Sets level of logging for api and controllers components. Can be 'info' or 'debug'.
- `reconcilers`:
- `app` (_String_): ID of the workload runner to set on all `AppWorkload` objects. Defaults to `statefulset-runner`.
- `build` (_String_): ID of the image builder to set on all `BuildWorkload` objects. Defaults to `kpack-image-builder`.
- `rootNamespace` (_String_): Root of the Cloud Foundry namespace hierarchy.
- `stagingRequirements`:
- `buildCacheMB` (_Integer_): Persistent disk in MB for caching staging artifacts across builds.
- `diskMB` (_Integer_): Ephemeral Disk request in MB for staging apps.
- `memoryMB` (_Integer_): Memory request in MB for staging.
- `statefulsetRunner`:
- `include` (_Boolean_): Deploy the `statefulset-runner` component.
- `replicas` (_Integer_): Number of replicas.
Expand Down
2 changes: 1 addition & 1 deletion api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ manifests: install-controller-gen install-yq
output:rbac:artifacts:config=../helm/korifi/api \
rbac:roleName=korifi-api-system-role

$(YQ) -i 'with(.metadata | select(.namespace == "ROOT_NAMESPACE"); .namespace="{{ .Values.global.rootNamespace }}")' ../helm/korifi/api/role.yaml
$(YQ) -i 'with(.metadata | select(.namespace == "ROOT_NAMESPACE"); .namespace="{{ .Values.rootNamespace }}")' ../helm/korifi/api/role.yaml

test: install-ginkgo
../scripts/run-tests.sh --skip-package=test
Expand Down
28 changes: 14 additions & 14 deletions helm/korifi/api/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,35 @@ data:
readTimeout: {{ .Values.api.apiServer.timeouts.read }}
readHeaderTimeout: {{ .Values.api.apiServer.timeouts.readHeader }}
writeTimeout: {{ .Values.api.apiServer.timeouts.write }}
rootNamespace: {{ .Values.global.rootNamespace }}
builderName: {{ .Values.global.reconcilers.build }}
runnerName: {{ .Values.global.reconcilers.run }}
rootNamespace: {{ .Values.rootNamespace }}
builderName: {{ .Values.reconcilers.build }}
runnerName: {{ .Values.reconcilers.run }}
defaultLifecycleConfig:
type: {{ .Values.api.lifecycle.type }}
stack: {{ .Values.api.lifecycle.stack }}
stagingMemoryMB: {{ .Values.api.lifecycle.stagingRequirements.memoryMB }}
containerRepositoryPrefix: {{ .Values.global.containerRepositoryPrefix | quote }}
{{- if not .Values.global.eksContainerRegistryRoleARN }}
{{- if .Values.global.containerRegistrySecrets }}
stagingMemoryMB: {{ .Values.stagingRequirements.memoryMB }}
containerRepositoryPrefix: {{ .Values.containerRepositoryPrefix | quote }}
{{- if not .Values.eksContainerRegistryRoleARN }}
{{- if .Values.containerRegistrySecrets }}
packageRegistrySecretNames:
{{- range .Values.global.containerRegistrySecrets }}
{{- range .Values.containerRegistrySecrets }}
- {{ . | quote }}
{{- end }}
{{- else if .Values.global.containerRegistrySecret }}
{{- else if .Values.containerRegistrySecret }}
packageRegistrySecretNames:
- {{ .Values.global.containerRegistrySecret | quote }}
- {{ .Values.containerRegistrySecret | quote }}
{{- else }}
{{ required "global.containerRegistrySecrets is required when global.eksContainerRegistryRoleARN is not set" .Values.global.containerRegistrySecrets }}
{{ required "containerRegistrySecrets is required when eksContainerRegistryRoleARN is not set" .Values.containerRegistrySecrets }}
{{- end }}
{{- end }}
defaultDomainName: {{ .Values.global.defaultAppDomainName }}
defaultDomainName: {{ .Values.defaultAppDomainName }}
userCertificateExpirationWarningDuration: {{ .Values.api.userCertificateExpirationWarningDuration }}
{{- if .Values.api.authProxy }}
authProxyHost: {{ .Values.api.authProxy.host | quote }}
authProxyCACert: {{ .Values.api.authProxy.caCert | quote }}
{{- end }}
logLevel: {{ .Values.global.logLevel }}
{{- if .Values.global.eksContainerRegistryRoleARN }}
logLevel: {{ .Values.logLevel }}
{{- if .Values.eksContainerRegistryRoleARN }}
containerRegistryType: "ECR"
{{- end }}
role_mappings_config.yaml: |
Expand Down
8 changes: 4 additions & 4 deletions helm/korifi/api/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
- name: TLSCONFIG
value: /etc/korifi-tls-config
image: {{ .Values.api.image }}
{{- if .Values.global.debug }}
{{- if .Values.debug }}
command:
- "/dlv"
args:
Expand All @@ -49,7 +49,7 @@ spec:
- mountPath: /etc/korifi-tls-config
name: korifi-tls-config
readOnly: true
{{- if .Values.global.containerRegistryCACertSecret }}
{{- if .Values.containerRegistryCACertSecret }}
- mountPath: /etc/ssl/certs/registry-ca.crt
name: korifi-registry-ca-cert
subPath: ca.crt
Expand All @@ -64,8 +64,8 @@ spec:
- name: korifi-tls-config
secret:
secretName: korifi-api-internal-cert
{{- if .Values.global.containerRegistryCACertSecret }}
{{- if .Values.containerRegistryCACertSecret }}
- name: korifi-registry-ca-cert
secret:
secretName: {{ .Values.global.containerRegistryCACertSecret }}
secretName: {{ .Values.containerRegistryCACertSecret }}
{{- end }}
2 changes: 1 addition & 1 deletion helm/korifi/api/ingress-cert.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.global.generateIngressCertificates }}
{{- if .Values.generateIngressCertificates }}
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
Expand Down
6 changes: 3 additions & 3 deletions helm/korifi/api/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ kind: ServiceAccount
metadata:
name: korifi-api-system-serviceaccount
namespace: {{ .Release.Namespace }}
{{- if .Values.global.eksContainerRegistryRoleARN }}
{{- if .Values.eksContainerRegistryRoleARN }}
annotations:
eks.amazonaws.com/role-arn: {{ .Values.global.eksContainerRegistryRoleARN }}
eks.amazonaws.com/role-arn: {{ .Values.eksContainerRegistryRoleARN }}
{{- end }}

---
Expand All @@ -27,7 +27,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: korifi-api-system-rolebinding
namespace: {{ .Values.global.rootNamespace }}
namespace: {{ .Values.rootNamespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
Expand Down
2 changes: 1 addition & 1 deletion helm/korifi/api/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: korifi-api-system-role
namespace: '{{ .Values.global.rootNamespace }}'
namespace: '{{ .Values.rootNamespace }}'
rules:
- apiGroups:
- ""
Expand Down
2 changes: 1 addition & 1 deletion helm/korifi/api/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
type: ClusterIP

---
{{- if .Values.global.debug }}
{{- if .Values.debug }}
apiVersion: v1
kind: Service
metadata:
Expand Down
26 changes: 13 additions & 13 deletions helm/korifi/controllers/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ data:
includeJobTaskRunner: {{ .Values.jobTaskRunner.include }}
includeStatefulsetRunner: {{ .Values.statefulsetRunner.include }}
includeContourRouter: {{ .Values.contourRouter.include }}
builderName: {{ .Values.global.reconcilers.build }}
runnerName: {{ .Values.global.reconcilers.run }}
builderName: {{ .Values.reconcilers.build }}
runnerName: {{ .Values.reconcilers.run }}
cfProcessDefaults:
memoryMB: {{ .Values.controllers.processDefaults.memoryMB }}
diskQuotaMB: {{ .Values.controllers.processDefaults.diskQuotaMB }}
cfRootNamespace: {{ .Values.global.rootNamespace }}
{{- if not .Values.global.eksContainerRegistryRoleARN }}
{{- if .Values.global.containerRegistrySecrets }}
cfRootNamespace: {{ .Values.rootNamespace }}
{{- if not .Values.eksContainerRegistryRoleARN }}
{{- if .Values.containerRegistrySecrets }}
containerRegistrySecretNames:
{{- range .Values.global.containerRegistrySecrets }}
{{- range .Values.containerRegistrySecrets }}
- {{ . | quote }}
{{- end }}
{{- else }}
containerRegistrySecretNames:
- {{ .Values.global.containerRegistrySecret | quote }}
- {{ .Values.containerRegistrySecret | quote }}
{{- end }}
{{- end }}
taskTTL: {{ .Values.controllers.taskTTL }}
Expand All @@ -40,17 +40,17 @@ data:
{{- end }}
maxRetainedPackagesPerApp: {{ .Values.controllers.maxRetainedPackagesPerApp }}
maxRetainedBuildsPerApp: {{ .Values.controllers.maxRetainedBuildsPerApp }}
logLevel: {{ .Values.global.logLevel }}
logLevel: {{ .Values.logLevel }}
{{- if .Values.kpackImageBuilder.include }}
clusterBuilderName: {{ .Values.kpackImageBuilder.clusterBuilderName | default "cf-kpack-cluster-builder" }}
builderReadinessTimeout: {{ required "builderReadinessTimeout is required" .Values.kpackImageBuilder.builderReadinessTimeout }}
containerRepositoryPrefix: {{ .Values.global.containerRepositoryPrefix | quote }}
containerRepositoryPrefix: {{ .Values.containerRepositoryPrefix | quote }}
builderServiceAccount: kpack-service-account
cfStagingResources:
buildCacheMB: {{ .Values.api.lifecycle.stagingRequirements.buildCacheMB }}
diskMB: {{ .Values.api.lifecycle.stagingRequirements.diskMB }}
memoryMB: {{ .Values.api.lifecycle.stagingRequirements.memoryMB }}
{{- if .Values.global.eksContainerRegistryRoleARN }}
buildCacheMB: {{ .Values.stagingRequirements.buildCacheMB }}
diskMB: {{ .Values.stagingRequirements.diskMB }}
memoryMB: {{ .Values.stagingRequirements.memoryMB }}
{{- if .Values.eksContainerRegistryRoleARN }}
containerRegistryType: "ECR"
{{- end }}
{{- end }}
Expand Down
Loading
Loading