generated from curium-rocks/k8s-mutating-webhook
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from bryopsida/6-allow-upgrading-when-using-ce…
…rtmanager Allow upgrading when using certmanager
- Loading branch information
Showing
40 changed files
with
1,245 additions
and
711 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
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 |
---|---|---|
|
@@ -104,4 +104,5 @@ dist | |
.tern-port | ||
|
||
.dccache | ||
.DS_Store | ||
.DS_Store | ||
docs |
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,4 @@ | ||
helm | ||
node_modules | ||
coverage | ||
dist |
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,4 @@ | ||
module.exports = { | ||
semi: false, | ||
trailingComma: "none" | ||
} |
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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{{- /* Create RBAC for the hook to update its mutatingwebhook configuration | ||
Adds permission to read the referenced TLS secret for the hook which is already | ||
mounted into the pod, and to read and patch its mutatingwebhookconfiguration to update its cabundle | ||
*/}} | ||
{{- if .Values.rbacCreate }} | ||
{{- /* Read the TLS secret for the hook */}} | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
namespace: {{ .Release.Namespace }} | ||
name: {{ .Release.Name }}-tls-reader | ||
rules: | ||
- apiGroups: [""] | ||
resourceNames: ["{{ .Values.tlsSecretName }}"] | ||
resources: ["secrets"] | ||
verbs: ["get"] | ||
--- | ||
{{- /* we need to be able to mutate the validating hook, this is a cluster level/global resource, we need a clusterrole for this*/}} | ||
{{- /* this role can read/write validating webhooks*/}} | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: {{ .Release.Name }}-ca-injector | ||
rules: | ||
- apiGroups: ["admissionregistration.k8s.io"] | ||
resources: ["mutatingwebhookconfigurations"] | ||
resourceNames: ["{{ include "psa-restricted-patcher.fullname" . }}-hooks"] | ||
verbs: ["get", "update", "patch"] | ||
{{- /* bind sa to roles */}} | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: {{ .Release.Name }}-hook-read-secrets-binding | ||
namespace: {{ .Release.Namespace }} | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ include "psa-restricted-patcher.serviceAccountName" . }} | ||
namespace: {{ .Release.Namespace }} | ||
roleRef: | ||
kind: Role | ||
name: {{ .Release.Name }}-tls-reader | ||
apiGroup: rbac.authorization.k8s.io | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: {{ .Release.Name }}-hook-read-secrets-binding | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ include "psa-restricted-patcher.serviceAccountName" . }} | ||
namespace: {{ .Release.Namespace }} | ||
roleRef: | ||
kind: ClusterRole | ||
name: {{ .Release.Name }}-ca-injector | ||
apiGroup: rbac.authorization.k8s.io | ||
{{- end }} |
Oops, something went wrong.