This repository has been archived by the owner on Mar 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Nested Spire with External Agent (#117)
- Loading branch information
Showing
18 changed files
with
383 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
spire-server: | ||
controllerManager: | ||
enabled: false | ||
nodeAttestor: | ||
k8sPsat: | ||
serviceAccountAllowList: | ||
- spire-system:spire-agent-upstream | ||
bundleConfigMap: spire-bundle-upstream | ||
notifier: | ||
k8sbundle: | ||
namespace: spire-system | ||
|
||
spire-agent: | ||
enabled: false | ||
|
||
spiffe-csi-driver: | ||
enabled: false | ||
|
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
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
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
90 changes: 90 additions & 0 deletions
90
charts/spire/charts/spire-server/templates/pre-delete-hook.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,90 @@ | ||
{{- if .Values.upstreamAuthority.spire.enabled }} | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ include "spire-server.serviceAccountName" . }}-pre-delete | ||
namespace: {{ include "spire-server.namespace" . }} | ||
labels: | ||
{{- include "spire-server.labels" . | nindent 4 }} | ||
annotations: | ||
"helm.sh/hook": pre-delete | ||
"helm.sh/hook-delete-policy": before-hook-creation, hook-succeeded, hook-failed | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: {{ include "spire-server.fullname" . }}-pre-delete | ||
namespace: {{ include "spire-server.namespace" . }} | ||
annotations: | ||
"helm.sh/hook": pre-delete | ||
"helm.sh/hook-delete-policy": before-hook-creation, hook-succeeded, hook-failed | ||
rules: | ||
- apiGroups: ["apps"] | ||
resources: ["statefulsets"] | ||
resourceNames: [{{ include "spire-server.fullname" . | quote }}] | ||
verbs: ["get", "delete"] | ||
- apiGroups: [""] | ||
resources: ["pods"] | ||
verbs: ["get", "list", "watch"] | ||
--- | ||
kind: RoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: {{ include "spire-server.fullname" . }}-pre-delete | ||
namespace: {{ include "spire-server.namespace" . }} | ||
annotations: | ||
"helm.sh/hook": pre-delete | ||
"helm.sh/hook-delete-policy": before-hook-creation, hook-succeeded, hook-failed | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ include "spire-server.serviceAccountName" . }}-pre-delete | ||
namespace: {{ include "spire-server.namespace" . }} | ||
roleRef: | ||
kind: Role | ||
name: {{ include "spire-server.fullname" . }}-pre-delete | ||
apiGroup: rbac.authorization.k8s.io | ||
--- | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: {{ include "spire-server.fullname" . }}-pre-delete | ||
namespace: {{ include "spire-server.namespace" . }} | ||
labels: | ||
{{- include "spire-server.labels" . | nindent 4 }} | ||
annotations: | ||
"helm.sh/hook": pre-delete | ||
"helm.sh/hook-delete-policy": before-hook-creation, hook-succeeded, hook-failed | ||
spec: | ||
template: | ||
metadata: | ||
name: {{ include "spire-server.fullname" . }}-pre-delete | ||
spec: | ||
restartPolicy: Never | ||
serviceAccountName: {{ include "spire-server.serviceAccountName" . }}-pre-delete | ||
securityContext: | ||
{{- toYaml .Values.podSecurityContext | nindent 8 }} | ||
containers: | ||
- name: pre-delete-job | ||
securityContext: | ||
{{- toYaml .Values.securityContext | nindent 10 }} | ||
image: {{ template "spire-lib.kubectl-image" (dict "appVersion" $.Chart.AppVersion "image" .Values.tools.kubectl.image "global" .Values.global "KubeVersion" .Capabilities.KubeVersion.Version) }} | ||
args: | ||
- delete | ||
- -n | ||
- {{ include "spire-server.namespace" . }} | ||
- statefulset | ||
- {{ include "spire-server.fullname" . }} | ||
- --wait | ||
- name: pre-delete-check | ||
securityContext: | ||
{{- toYaml .Values.securityContext | nindent 10 }} | ||
image: {{ template "spire-lib.kubectl-image" (dict "appVersion" $.Chart.AppVersion "image" .Values.tools.kubectl.image "global" .Values.global "KubeVersion" .Capabilities.KubeVersion.Version) }} | ||
args: | ||
- wait | ||
- --for=delete | ||
- pod | ||
- -l | ||
- app.kubernetes.io/instance={{ include "spire-server.name" . }},app.kubernetes.io/name={{ .Release.Name }},app.kubernetes.io/component=server | ||
- -n | ||
- {{ include "spire-server.namespace" . }} | ||
{{- end }} |
Oops, something went wrong.