| Giorgi Lekveishvili | 84835c9 | 2023-06-20 19:00:15 +0400 | [diff] [blame] | 1 | apiVersion: v1 |
| 2 | kind: ServiceAccount |
| 3 | metadata: |
| 4 | name: {{ include "cert-manager-webhook-gandi.fullname" . }} |
| 5 | namespace: {{ .Values.certManager.namespace | quote }} |
| 6 | labels: |
| 7 | app: {{ include "cert-manager-webhook-gandi.name" . }} |
| 8 | chart: {{ include "cert-manager-webhook-gandi.chart" . }} |
| 9 | release: {{ .Release.Name }} |
| 10 | heritage: {{ .Release.Service }} |
| 11 | --- |
| 12 | # Grant the webhook permission to read the ConfigMap containing the Kubernetes |
| 13 | # apiserver's requestheader-ca-certificate |
| 14 | # This ConfigMap is automatically created by the Kubernetes apiserver |
| 15 | apiVersion: rbac.authorization.k8s.io/v1 |
| 16 | kind: RoleBinding |
| 17 | metadata: |
| 18 | name: {{ include "cert-manager-webhook-gandi.fullname" . }}:webhook-authentication-reader |
| 19 | namespace: kube-system |
| 20 | labels: |
| 21 | app: {{ include "cert-manager-webhook-gandi.name" . }} |
| 22 | chart: {{ include "cert-manager-webhook-gandi.chart" . }} |
| 23 | release: {{ .Release.Name }} |
| 24 | heritage: {{ .Release.Service }} |
| 25 | roleRef: |
| 26 | apiGroup: rbac.authorization.k8s.io |
| 27 | kind: Role |
| 28 | name: extension-apiserver-authentication-reader |
| 29 | subjects: |
| 30 | - apiGroup: "" |
| 31 | kind: ServiceAccount |
| 32 | name: {{ include "cert-manager-webhook-gandi.fullname" . }} |
| 33 | namespace: {{ .Values.certManager.namespace | quote }} |
| 34 | --- |
| 35 | # apiserver gets the auth-delegator role to delegate auth decisions to |
| 36 | # the core apiserver |
| 37 | apiVersion: rbac.authorization.k8s.io/v1 |
| 38 | kind: ClusterRoleBinding |
| 39 | metadata: |
| 40 | name: {{ include "cert-manager-webhook-gandi.fullname" . }}:auth-delegator |
| 41 | labels: |
| 42 | app: {{ include "cert-manager-webhook-gandi.name" . }} |
| 43 | chart: {{ include "cert-manager-webhook-gandi.chart" . }} |
| 44 | release: {{ .Release.Name }} |
| 45 | heritage: {{ .Release.Service }} |
| 46 | roleRef: |
| 47 | apiGroup: rbac.authorization.k8s.io |
| 48 | kind: ClusterRole |
| 49 | name: system:auth-delegator |
| 50 | subjects: |
| 51 | - apiGroup: "" |
| 52 | kind: ServiceAccount |
| 53 | name: {{ include "cert-manager-webhook-gandi.fullname" . }} |
| 54 | namespace: {{ .Values.certManager.namespace | quote}} |
| 55 | --- |
| 56 | # Grant cert-manager permission to validate using our apiserver |
| 57 | apiVersion: rbac.authorization.k8s.io/v1 |
| 58 | kind: ClusterRole |
| 59 | metadata: |
| 60 | name: {{ include "cert-manager-webhook-gandi.fullname" . }}:domain-solver |
| 61 | labels: |
| 62 | app: {{ include "cert-manager-webhook-gandi.name" . }} |
| 63 | chart: {{ include "cert-manager-webhook-gandi.chart" . }} |
| 64 | release: {{ .Release.Name }} |
| 65 | heritage: {{ .Release.Service }} |
| 66 | rules: |
| 67 | - apiGroups: |
| 68 | - {{ .Values.groupName }} |
| 69 | resources: |
| 70 | - "*" |
| 71 | verbs: |
| 72 | - "create" |
| 73 | --- |
| 74 | apiVersion: rbac.authorization.k8s.io/v1 |
| 75 | kind: ClusterRoleBinding |
| 76 | metadata: |
| 77 | name: {{ include "cert-manager-webhook-gandi.fullname" . }}:domain-solver |
| 78 | labels: |
| 79 | app: {{ include "cert-manager-webhook-gandi.name" . }} |
| 80 | chart: {{ include "cert-manager-webhook-gandi.chart" . }} |
| 81 | release: {{ .Release.Name }} |
| 82 | heritage: {{ .Release.Service }} |
| 83 | roleRef: |
| 84 | apiGroup: rbac.authorization.k8s.io |
| 85 | kind: ClusterRole |
| 86 | name: {{ include "cert-manager-webhook-gandi.fullname" . }}:domain-solver |
| 87 | subjects: |
| 88 | - apiGroup: "" |
| 89 | kind: ServiceAccount |
| 90 | name: {{ .Values.certManager.serviceAccountName }} |
| 91 | namespace: {{ .Values.certManager.namespace | quote }} |
| 92 | --- |
| 93 | apiVersion: rbac.authorization.k8s.io/v1 |
| 94 | kind: Role |
| 95 | metadata: |
| 96 | name: {{ include "cert-manager-webhook-gandi.fullname" . }}:secret-reader |
| 97 | namespace: {{ .Values.certManager.namespace | quote }} |
| 98 | rules: |
| 99 | - apiGroups: |
| 100 | - "" |
| 101 | resources: |
| 102 | - "secrets" |
| 103 | resourceNames: |
| 104 | - "gandi-credentials" |
| 105 | verbs: |
| 106 | - "get" |
| 107 | - "watch" |
| 108 | --- |
| 109 | apiVersion: rbac.authorization.k8s.io/v1 |
| 110 | kind: RoleBinding |
| 111 | metadata: |
| 112 | name: {{ include "cert-manager-webhook-gandi.fullname" . }}:secret-reader |
| 113 | namespace: {{ .Values.certManager.namespace | quote }} |
| 114 | roleRef: |
| 115 | apiGroup: rbac.authorization.k8s.io |
| 116 | kind: Role |
| 117 | name: {{ include "cert-manager-webhook-gandi.fullname" . }}:secret-reader |
| 118 | subjects: |
| 119 | - apiGroup: "" |
| 120 | kind: ServiceAccount |
| 121 | name: {{ include "cert-manager-webhook-gandi.fullname" . }} |
| 122 | namespace: {{ .Values.certManager.namespace | quote }} |
| 123 | {{- if .Values.features.apiPriorityAndFairness }} |
| 124 | --- |
| 125 | # Grant cert-manager-webhook-gandi permission to read the flow control mechanism (APF) |
| 126 | # API Priority and Fairness is enabled by default in Kubernetes 1.20 |
| 127 | # https://kubernetes.io/docs/concepts/cluster-administration/flow-control/ |
| 128 | apiVersion: rbac.authorization.k8s.io/v1 |
| 129 | kind: ClusterRole |
| 130 | metadata: |
| 131 | name: {{ include "cert-manager-webhook-gandi.fullname" . }}:flowcontrol-solver |
| 132 | labels: |
| 133 | app: {{ include "cert-manager-webhook-gandi.name" . }} |
| 134 | chart: {{ include "cert-manager-webhook-gandi.chart" . }} |
| 135 | release: {{ .Release.Name }} |
| 136 | heritage: {{ .Release.Service }} |
| 137 | rules: |
| 138 | - apiGroups: |
| 139 | - "flowcontrol.apiserver.k8s.io" |
| 140 | resources: |
| 141 | - "prioritylevelconfigurations" |
| 142 | - "flowschemas" |
| 143 | verbs: |
| 144 | - "list" |
| 145 | - "watch" |
| 146 | --- |
| 147 | apiVersion: rbac.authorization.k8s.io/v1 |
| 148 | kind: ClusterRoleBinding |
| 149 | metadata: |
| 150 | name: {{ include "cert-manager-webhook-gandi.fullname" . }}:flowcontrol-solver |
| 151 | labels: |
| 152 | app: {{ include "cert-manager-webhook-gandi.name" . }} |
| 153 | chart: {{ include "cert-manager-webhook-gandi.chart" . }} |
| 154 | release: {{ .Release.Name }} |
| 155 | heritage: {{ .Release.Service }} |
| 156 | roleRef: |
| 157 | apiGroup: rbac.authorization.k8s.io |
| 158 | kind: ClusterRole |
| 159 | name: {{ include "cert-manager-webhook-gandi.fullname" . }}:flowcontrol-solver |
| 160 | subjects: |
| 161 | - apiGroup: "" |
| 162 | kind: ServiceAccount |
| 163 | name: {{ include "cert-manager-webhook-gandi.fullname" . }} |
| 164 | namespace: {{ .Values.certManager.namespace | quote }} |
| 165 | {{- end }} |