Skip to content

Commit

Permalink
feat(helm): add subjects for cert-manager certificate (#346)
Browse files Browse the repository at this point in the history
* ci(helm): fix helm e2e installer

Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>

* feat(chart): add cert subjects and bump app version 0.4.7

Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>

---------

Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>
  • Loading branch information
oliverbaehler authored Dec 8, 2023
1 parent d188f12 commit 2333253
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 8 deletions.
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,16 @@ helm-test: helm-controller-version kind ct ko-build-all
@kind create cluster --wait=60s --name capsule-charts
@kind load docker-image --name capsule-charts $(CAPSULE_PROXY_IMG):$(VERSION)
@kubectl create ns capsule-system
@kubectl create -f https://github.com/cert-manager/cert-manager/releases/download/v1.9.1/cert-manager.crds.yaml
@kubectl create -f https://github.com/prometheus-operator/prometheus-operator/releases/download/v0.58.0/bundle.yaml
@make helm-install

helm-install:
@kubectl apply --server-side=true -f https://github.com/cert-manager/cert-manager/releases/download/v1.13.2/cert-manager.yaml
@make install-capsule
@kubectl apply --server-side=true -f https://github.com/prometheus-operator/prometheus-operator/releases/download/v0.58.0/bundle.yaml
@ct install --config $(SRC_ROOT)/.github/configs/ct.yaml --namespace=capsule-system --all --debug
@kind delete cluster --name capsule-charts

helm-destroy:
@kind delete cluster --name capsule-charts

####################
# -- Testing
Expand Down
8 changes: 3 additions & 5 deletions charts/capsule-proxy/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
appVersion: 0.4.6
appVersion: 0.4.7
description: Helm Chart for Capsule Proxy, addon for Capsule, the multi-tenant Operator
name: capsule-proxy
type: application
Expand All @@ -21,7 +21,7 @@ maintainers:
- name: capsule-maintainers
email: cncf-capsule-maintainers@lists.cncf.io
annotations:
artifacthub.io/containsSecurityUpdates: "true"
artifacthub.io/containsSecurityUpdates: "false"
artifacthub.io/operator: "true"
artifacthub.io/prerelease: "false"
artifacthub.io/category: security
Expand All @@ -34,6 +34,4 @@ annotations:
url: https://capsule.clastix.io/
artifacthub.io/changes: |
- kind: added
description: artifacthub annotations
- kind: changed
description: maintainers contact
description: add subjects for cert-manager certificate
3 changes: 3 additions & 0 deletions charts/capsule-proxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ If you only need to make minor customizations, you can specify them on the comma
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | Set affinity rules for the capsule-proxy pod. |
| certManager.certificate.dnsNames | list | `[]` | Additional DNS Names to include in certificate |
| certManager.certificate.ipAddresses | list | `[]` | Additional IP Addresses to include in certificate |
| certManager.certificate.uris | list | `[]` | Additional URIs to include in certificate |
| certManager.externalCA.enabled | bool | `false` | Set if want cert manager to sign certificates with an external CA |
| certManager.externalCA.secretName | string | `""` | |
| certManager.generateCertificates | bool | `false` | Set if the cert manager will generate SSL certificates (self-signed or CA-signed) |
Expand Down
12 changes: 12 additions & 0 deletions charts/capsule-proxy/ci/cert-manager-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
options:
enableSSL: true
generateCertificates: false
certManager:
generateCertificates: true
certificate:
dnsNames:
- "localhost"
ipAddresses:
- "127.0.0.1"
uris:
- "spiffe://cluster.local/ns/sandbox/sa/example"
15 changes: 15 additions & 0 deletions charts/capsule-proxy/templates/certmanager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,23 @@ spec:
- {{ $hosts.host }}
{{- end }}
{{- end }}
{{- range $dns := .Values.certManager.certificate.dnsNames }}
- {{ $dns }}
{{- end }}
- {{ include "capsule-proxy.fullname" . }}
- {{ include "capsule-proxy.fullname" . }}.{{ .Release.Namespace }}.svc
{{- with .Values.certManager.certificate.ipAddresses }}
ipAddresses:
{{- range $ip := . }}
- {{ $ip }}
{{- end }}
{{- end }}
{{- with .Values.certManager.certificate.uris }}
uris:
{{- range $uri := . }}
- {{ $uri }}
{{- end }}
{{- end }}
issuerRef:
kind: {{ .Values.certManager.issuer.kind }}
name: {{ include "capsule-proxy.certManager.issuerName" . }}
Expand Down
7 changes: 7 additions & 0 deletions charts/capsule-proxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ certManager:
kind: Issuer # Issuer or ClusterIssuer
# -- Set the name of the ClusterIssuer if issuer kind is ClusterIssuer and if cert manager will generate CA signed SSL certificates
name: "" # Name of the ClusterIssuer
certificate:
# -- Additional DNS Names to include in certificate
dnsNames: []
# -- Additional IP Addresses to include in certificate
ipAddresses: []
# -- Additional URIs to include in certificate
uris: []


# ServiceAccount
Expand Down

0 comments on commit 2333253

Please sign in to comment.