-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow additional CRs to be managed by the chart (#117)
* Add support for the new spire-controller-manager class feature Signed-off-by: Kevin Fox <[email protected]> * Fix docs. Swich nested deployment to use controller manager Signed-off-by: Kevin Fox <[email protected]> * Incorperate feedback Signed-off-by: Kevin Fox <[email protected]> * Test with nightly Signed-off-by: Kevin Fox <[email protected]> * Fix global object naming clash Signed-off-by: Kevin Fox <[email protected]> * Fix missing dot Signed-off-by: Kevin Fox <[email protected]> * Fix naming conflict with cluster ids Signed-off-by: Kevin Fox <[email protected]> * Fix scoping issue Signed-off-by: Kevin Fox <[email protected]> * Fix typo Signed-off-by: Kevin Fox <[email protected]> * Fix webhook name collision Signed-off-by: Kevin Fox <[email protected]> * Fix webhook reference and add note to user about className Signed-off-by: Kevin Fox <[email protected]> * Upgrade has to work on the old version of the object before rename Signed-off-by: Kevin Fox <[email protected]> * Fix formatting Signed-off-by: Kevin Fox <[email protected]> * Remove extra junk from job Signed-off-by: Kevin Fox <[email protected]> * Easier local runs and wait for crds Signed-off-by: Kevin Fox <[email protected]> * Add missing crd upgrade Signed-off-by: Kevin Fox <[email protected]> * Update upgrade notes Signed-off-by: Kevin Fox <[email protected]> * Update charts/spire/charts/spire-server/templates/controller-manager-cluster-ids.yaml Co-authored-by: Marco Franssen <[email protected]> Signed-off-by: kfox1111 <[email protected]> * Incorperate feedback Signed-off-by: Kevin Fox <[email protected]> * Bump version to the released 0.4.0 Signed-off-by: kfox1111 <[email protected]> * Fix docs Signed-off-by: Kevin Fox <[email protected]> * Merge in crd changes from upstream Signed-off-by: Kevin Fox <[email protected]> * Add auto populate dns Signed-off-by: Kevin Fox <[email protected]> * Update charts/spire/README.md Co-authored-by: Faisal Memon <[email protected]> Signed-off-by: kfox1111 <[email protected]> * Add missing ClusterSPIFFEID fields There are a few options in the CRD not available via the chart. Sync them to the chart. Signed-off-by: Kevin Fox <[email protected]> * Add another missing one Signed-off-by: Kevin Fox <[email protected]> * Fix docs Signed-off-by: Kevin Fox <[email protected]> * Allow additional CRs to be managed by the chart Sometimes additional ClusterSPIFFEIDs and the other CRs are needed. Add support for the end user to manage those extra CRs via the chart. Signed-off-by: Kevin Fox <[email protected]> * Add validation Signed-off-by: Kevin Fox <[email protected]> * Fix docs Signed-off-by: Kevin Fox <[email protected]> * Add className to crs Signed-off-by: Kevin Fox <[email protected]> * Fix docs Signed-off-by: Kevin Fox <[email protected]> * Incorperate feedback Signed-off-by: Kevin Fox <[email protected]> * Fix readme formatting Signed-off-by: Kevin Fox <[email protected]> * Update charts/spire/README.md Signed-off-by: kfox1111 <[email protected]> * Incorperate feedback Signed-off-by: Kevin Fox <[email protected]> * Apply suggestions from code review Co-authored-by: Faisal Memon <[email protected]> Signed-off-by: kfox1111 <[email protected]> * Apply suggestions from code review Co-authored-by: Faisal Memon <[email protected]> Signed-off-by: kfox1111 <[email protected]> * Fix docs Signed-off-by: Kevin Fox <[email protected]> * Remove dead code Signed-off-by: Kevin Fox <[email protected]> * Fix extra newline Signed-off-by: Kevin Fox <[email protected]> * Incorperate feedback Signed-off-by: Kevin Fox <[email protected]> --------- Signed-off-by: Kevin Fox <[email protected]> Signed-off-by: kfox1111 <[email protected]> Co-authored-by: Marco Franssen <[email protected]> Co-authored-by: Faisal Memon <[email protected]>
- Loading branch information
1 parent
d936293
commit e030fa1
Showing
9 changed files
with
420 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
60 changes: 43 additions & 17 deletions
60
charts/spire/charts/spire-server/templates/controller-manager-cluster-ids.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,68 @@ | ||
{{- $root := . }} | ||
{{- with .Values.controllerManager }} | ||
{{- if and (eq (.enabled | toString) "true") (eq (.identities.enabled | toString) "true") }} | ||
{{- range $key, $value := .Values.controllerManager.identities.clusterSPIFFEIDs }} | ||
{{- range $skey, $svalue := $value }} | ||
{{- if not (has $skey (list "name" "annotations" "labels" "enabled" "admin" "dnsNameTemplates" "downstream" "federatesWith" "jwtTTL" "namespaceSelector" "podSelector" "spiffeIDTemplate" "ttl" "workloadSelectorTemplates" "autoPopulateDNSNames")) }} | ||
{{- fail (printf "Unsupported property specified: %s" $skey) }} | ||
{{- end }} | ||
{{- end }} | ||
{{- range $rprop := list "spiffeIDTemplate" }} | ||
{{- if not (hasKey $value $rprop) }} | ||
{{- fail (printf "Required property %s was not specified" $rprop) }} | ||
{{- end }} | ||
{{- end }} | ||
{{- if eq ($root.Values.controllerManager.enabled | toString) "true" }} | ||
{{- if or (not (hasKey $value "enabled")) (eq ($value.enabled | toString) "true") }} | ||
--- | ||
apiVersion: spire.spiffe.io/v1alpha1 | ||
kind: ClusterSPIFFEID | ||
metadata: | ||
name: {{ $root.Release.Namespace }}-{{ include "spire-controller-manager.fullname" $root }}-service-account-based | ||
namespace: {{ include "spire-server.namespace" $root }} | ||
name: {{ $root.Release.Namespace }}-{{ $root.Release.Name }}-{{ $key }} | ||
{{- with $value.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with $value.labels }} | ||
labels: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
spiffeIDTemplate: {{ .identities.spiffeIDTemplate | quote }} | ||
{{- with .identities.federatesWith }} | ||
className: {{ include "spire-server.controller-manager-class-name" $root | quote }} | ||
spiffeIDTemplate: {{ $value.spiffeIDTemplate | quote }} | ||
{{- with $value.federatesWith }} | ||
federatesWith: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with .identities.podSelector }} | ||
{{- with $value.podSelector }} | ||
podSelector: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with .identities.namespaceSelector }} | ||
{{- with $value.namespaceSelector }} | ||
namespaceSelector: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with .identities.dnsNameTemplates }} | ||
{{- with $value.dnsNameTemplates }} | ||
dnsNameTemplates: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with .identities.workloadSelectorTemplates }} | ||
{{- with $value.workloadSelectorTemplates }} | ||
workloadSelectorTemplates: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with .identities.ttl }} | ||
{{- with $value.ttl }} | ||
ttl: {{ . | quote }} | ||
{{- end }} | ||
{{- with .identities.jwtTTL }} | ||
{{- with $value.jwtTTL }} | ||
jwtTtl: {{ . | quote }} | ||
{{- end }} | ||
admin: {{ .identities.admin }} | ||
downstream: {{ .identities.downstream }} | ||
autoPopulateDNSNames: {{ .identities.autoPopulateDNSNames }} | ||
className: {{ include "spire-server.controller-manager-class-name" $root | quote}} | ||
{{- end }} | ||
{{- with $value.admin }} | ||
admin: {{ . }} | ||
{{- end }} | ||
{{- with $value.downstream }} | ||
downstream: {{ . }} | ||
{{- end }} | ||
{{- with $value.autoPopulateDNSNames }} | ||
autoPopulateDNSNames: {{ . }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
45 changes: 45 additions & 0 deletions
45
charts/spire/charts/spire-server/templates/controller-manager-ftd.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{{- $root := . }} | ||
{{- range $key, $value := .Values.controllerManager.identities.clusterFederatedTrustDomains }} | ||
{{- range $skey, $svalue := $value }} | ||
{{- if not (has $skey (list "name" "annotations" "labels" "enabled" "bundleEndpointProfile" "bundleEndpointURL" "trustDomain" "trustDomainBundle")) }} | ||
{{- fail (printf "Unsupported property specified: %s" $skey) }} | ||
{{- end }} | ||
{{- end }} | ||
{{- range $rprop := list "bundleEndpointProfile" "bundleEndpointURL" "trustDomain" }} | ||
{{- if not (hasKey $value $rprop) }} | ||
{{- fail (printf "Required property %s was not specified" $rprop) }} | ||
{{- end }} | ||
{{- end }} | ||
{{- if eq ($root.Values.controllerManager.enabled | toString) "true" }} | ||
{{- if or (not (hasKey $value "enabled")) (eq ($value.enabled | toString) "true") }} | ||
--- | ||
apiVersion: spire.spiffe.io/v1alpha1 | ||
kind: ClusterFederatedTrustDomain | ||
metadata: | ||
name: {{ $root.Release.Namespace }}-{{ $root.Release.Name }}-{{ $key }} | ||
{{- with $value.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with $value.labels }} | ||
labels: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
className: {{ include "spire-server.controller-manager-class-name" $root | quote }} | ||
{{- with $value.bundleEndpointProfile }} | ||
bundleEndpointProfile: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with $value.bundleEndpointURL }} | ||
bundleEndpointURL: {{ . | quote }} | ||
{{- end }} | ||
{{- with $value.trustDomain }} | ||
trustDomain: {{ . | quote }} | ||
{{- end }} | ||
{{- with $value.trustDomainBundle }} | ||
trustDomainBundle: {{ . | quote }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
63 changes: 63 additions & 0 deletions
63
charts/spire/charts/spire-server/templates/controller-manager-static-entries.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{{- $root := . }} | ||
{{- range $key, $value := .Values.controllerManager.identities.clusterStaticEntries }} | ||
{{- range $skey, $svalue := $value }} | ||
{{- if not (has $skey (list "name" "annotations" "labels" "enabled" "admin" "dnsNames" "downstream" "federatesWith" "hint" "jwtSVIDTTL" "parentID" "selectors" "spiffeID" "x509SVIDTTL")) }} | ||
{{- fail (printf "Unsupported property specified: %s" $skey) }} | ||
{{- end }} | ||
{{- end }} | ||
{{- range $rprop := list "spiffeID" "selectors" "parentID" }} | ||
{{- if not (hasKey $value $rprop) }} | ||
{{- fail (printf "Required property %s was not specified" $rprop) }} | ||
{{- end }} | ||
{{- end }} | ||
{{- if eq ($root.Values.controllerManager.enabled | toString) "true" }} | ||
{{- if or (not (hasKey $value "enabled")) (eq ($value.enabled | toString) "true") }} | ||
--- | ||
apiVersion: spire.spiffe.io/v1alpha1 | ||
kind: ClusterStaticEntry | ||
metadata: | ||
name: {{ $root.Release.Namespace }}-{{ $root.Release.Name }}-{{ $key }} | ||
{{- with $value.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with $value.labels }} | ||
labels: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
className: {{ include "spire-server.controller-manager-class-name" $root | quote }} | ||
spiffeID: {{ $value.spiffeID | quote }} | ||
{{- with $value.federatesWith }} | ||
federatesWith: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with $value.selectors }} | ||
selectors: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with $value.parentID }} | ||
parentID: {{ . | quote }} | ||
{{- end }} | ||
{{- with $value.dnsNames }} | ||
dnsNames: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with $value.hint }} | ||
hint: {{ . | quote }} | ||
{{- end }} | ||
{{- with $value.x509SVIDTTL }} | ||
x509SVIDTTL: {{ . | quote }} | ||
{{- end }} | ||
{{- with $value.jwtSVIDTTL }} | ||
jwtSVIDTTL: {{ . | quote }} | ||
{{- end }} | ||
{{- with $value.admin }} | ||
admin: {{ . }} | ||
{{- end }} | ||
{{- with $value.downstream }} | ||
downstream: {{ . }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters