Skip to content

Commit

Permalink
configurable custom CA
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejtomcik committed May 17, 2020
1 parent 1638e48 commit 96b4756
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions step-certificates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ chart and their default values.
| `ca.db.size` | Persistent volume size | `10Gi` |
| `ca.runAsRoot` | Run the CA as root. | `false` |
| `ca.bootstrap.postInitHook` | Extra script snippet to run after `step ca init` has completed. | `""` |
| `ca.bootstrap.rootCA.secret`| Name of the custom root CA secret (k8s tls secret) to be used. | `""` |
| `service.type` | Service type | `ClusterIP` |
| `service.port` | Incoming port to access Step CA | `443` |
| `service.targetPort` | Internal port where Step CA runs | `9000` |
Expand Down
9 changes: 9 additions & 0 deletions step-certificates/templates/bootstrap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ spec:
serviceAccountName: {{ include "step-certificates.fullname" . }}-config
restartPolicy: Never
volumes:
{{- if .Values.ca.bootstrap.rootCA.secret }}
- name: {{ include "step-certificates.fullname" . }}-ca-volume
secret:
secretName: "{{ .Values.ca.bootstrap.rootCA.secret }}"
{{- end }}
- name: bootstrap
configMap:
name: {{ include "step-certificates.fullname" . }}-bootstrap
Expand All @@ -36,4 +41,8 @@ spec:
- name: bootstrap
mountPath: /home/step/bootstrap
readOnly: true
{{- if .Values.ca.bootstrap.rootCA.secret }}
- name: {{ include "step-certificates.fullname" . }}-ca-volume
mountPath: /tmp/certs
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion step-certificates/templates/configmaps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ data:
--provisioner "{{.Values.ca.provisioner.name}}" \
--with-ca-url "{{include "step-certificates.url" .}}" \
--password-file "$TMP_CA_PASSWORD" \
--provisioner-password-file "$TMP_CA_PROVISIONER_PASSWORD" {{ if not .Values.ca.db.enabled }}--no-db{{ end }}
--provisioner-password-file "$TMP_CA_PROVISIONER_PASSWORD" {{ if not .Values.ca.db.enabled }}--no-db{{ end }} {{ if .Values.ca.bootstrap.rootCA.secret }}--root /tmp/certs/tls.crt --key /tmp/certs/tls.key{{ end }}
rm -f $TMP_CA_PASSWORD $TMP_CA_PROVISIONER_PASSWORD
Expand Down
3 changes: 3 additions & 0 deletions step-certificates/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ ca:
bootstrap:
# Add script snippets here to be executed after the step ca init has been run
postInitHook: ""
rootCA:
secret:
name:

# autocert is used to configure the autocert chart that depends on step-certificates.
autocert:
Expand Down

0 comments on commit 96b4756

Please sign in to comment.