diff --git a/chart/templates/proxy_injector.yaml b/chart/templates/proxy_injector.yaml index 47e2c5e89..60169e2d1 100644 --- a/chart/templates/proxy_injector.yaml +++ b/chart/templates/proxy_injector.yaml @@ -5,6 +5,44 @@ ### Proxy Injector ### --- +kind: ServiceAccount +apiVersion: v1 +metadata: + name: linkerd-proxy-injector + namespace: {{.Namespace}} +--- +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: linkerd-{{.Namespace}}-proxy-injector +rules: +- apiGroups: ["admissionregistration.k8s.io"] + resources: ["mutatingwebhookconfigurations"] + verbs: ["create", "get", "delete"] +- apiGroups: [""] + resources: ["namespaces"] + verbs: ["list", "get", "watch"] +- apiGroups: [""] + resources: ["pods"] + verbs: ["list"] +- apiGroups: ["apps"] + resources: ["replicasets"] + verbs: ["list", "get", "watch"] +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: linkerd-{{.Namespace}}-proxy-injector +subjects: +- kind: ServiceAccount + name: linkerd-proxy-injector + namespace: {{.Namespace}} + apiGroup: "" +roleRef: + kind: ClusterRole + name: linkerd-{{.Namespace}}-proxy-injector + apiGroup: rbac.authorization.k8s.io +--- kind: Deployment apiVersion: apps/v1 metadata: @@ -61,44 +99,6 @@ spec: configMap: name: linkerd-config --- -kind: ServiceAccount -apiVersion: v1 -metadata: - name: linkerd-proxy-injector - namespace: {{.Namespace}} ---- -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: linkerd-{{.Namespace}}-proxy-injector -rules: -- apiGroups: ["admissionregistration.k8s.io"] - resources: ["mutatingwebhookconfigurations"] - verbs: ["create", "get", "delete"] -- apiGroups: [""] - resources: ["namespaces"] - verbs: ["list", "get", "watch"] -- apiGroups: [""] - resources: ["pods"] - verbs: ["list"] -- apiGroups: ["apps"] - resources: ["replicasets"] - verbs: ["list", "get", "watch"] ---- -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: linkerd-{{.Namespace}}-proxy-injector -subjects: -- kind: ServiceAccount - name: linkerd-proxy-injector - namespace: {{.Namespace}} - apiGroup: "" -roleRef: - kind: ClusterRole - name: linkerd-{{.Namespace}}-proxy-injector - apiGroup: rbac.authorization.k8s.io ---- kind: Service apiVersion: v1 metadata: diff --git a/cli/cmd/testdata/install_no_init_container_auto_inject.golden b/cli/cmd/testdata/install_no_init_container_auto_inject.golden index e6ab2c461..7c57fe385 100644 --- a/cli/cmd/testdata/install_no_init_container_auto_inject.golden +++ b/cli/cmd/testdata/install_no_init_container_auto_inject.golden @@ -1333,6 +1333,44 @@ data: ### Proxy Injector ### --- +kind: ServiceAccount +apiVersion: v1 +metadata: + name: linkerd-proxy-injector + namespace: linkerd +--- +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: linkerd-linkerd-proxy-injector +rules: +- apiGroups: ["admissionregistration.k8s.io"] + resources: ["mutatingwebhookconfigurations"] + verbs: ["create", "get", "delete"] +- apiGroups: [""] + resources: ["namespaces"] + verbs: ["list", "get", "watch"] +- apiGroups: [""] + resources: ["pods"] + verbs: ["list"] +- apiGroups: ["apps"] + resources: ["replicasets"] + verbs: ["list", "get", "watch"] +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: linkerd-linkerd-proxy-injector +subjects: +- kind: ServiceAccount + name: linkerd-proxy-injector + namespace: linkerd + apiGroup: "" +roleRef: + kind: ClusterRole + name: linkerd-linkerd-proxy-injector + apiGroup: rbac.authorization.k8s.io +--- apiVersion: apps/v1 kind: Deployment metadata: @@ -1480,44 +1518,6 @@ spec: name: linkerd-identity-end-entity status: {} --- -kind: ServiceAccount -apiVersion: v1 -metadata: - name: linkerd-proxy-injector - namespace: linkerd ---- -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: linkerd-linkerd-proxy-injector -rules: -- apiGroups: ["admissionregistration.k8s.io"] - resources: ["mutatingwebhookconfigurations"] - verbs: ["create", "get", "delete"] -- apiGroups: [""] - resources: ["namespaces"] - verbs: ["list", "get", "watch"] -- apiGroups: [""] - resources: ["pods"] - verbs: ["list"] -- apiGroups: ["apps"] - resources: ["replicasets"] - verbs: ["list", "get", "watch"] ---- -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: linkerd-linkerd-proxy-injector -subjects: -- kind: ServiceAccount - name: linkerd-proxy-injector - namespace: linkerd - apiGroup: "" -roleRef: - kind: ClusterRole - name: linkerd-linkerd-proxy-injector - apiGroup: rbac.authorization.k8s.io ---- kind: Service apiVersion: v1 metadata: diff --git a/cli/cmd/testdata/install_output.golden b/cli/cmd/testdata/install_output.golden index 4d880148e..f6470c392 100644 --- a/cli/cmd/testdata/install_output.golden +++ b/cli/cmd/testdata/install_output.golden @@ -1278,6 +1278,44 @@ data: ### Proxy Injector ### --- +kind: ServiceAccount +apiVersion: v1 +metadata: + name: linkerd-proxy-injector + namespace: Namespace +--- +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: linkerd-Namespace-proxy-injector +rules: +- apiGroups: ["admissionregistration.k8s.io"] + resources: ["mutatingwebhookconfigurations"] + verbs: ["create", "get", "delete"] +- apiGroups: [""] + resources: ["namespaces"] + verbs: ["list", "get", "watch"] +- apiGroups: [""] + resources: ["pods"] + verbs: ["list"] +- apiGroups: ["apps"] + resources: ["replicasets"] + verbs: ["list", "get", "watch"] +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: linkerd-Namespace-proxy-injector +subjects: +- kind: ServiceAccount + name: linkerd-proxy-injector + namespace: Namespace + apiGroup: "" +roleRef: + kind: ClusterRole + name: linkerd-Namespace-proxy-injector + apiGroup: rbac.authorization.k8s.io +--- apiVersion: apps/v1 kind: Deployment metadata: @@ -1414,44 +1452,6 @@ spec: name: config status: {} --- -kind: ServiceAccount -apiVersion: v1 -metadata: - name: linkerd-proxy-injector - namespace: Namespace ---- -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: linkerd-Namespace-proxy-injector -rules: -- apiGroups: ["admissionregistration.k8s.io"] - resources: ["mutatingwebhookconfigurations"] - verbs: ["create", "get", "delete"] -- apiGroups: [""] - resources: ["namespaces"] - verbs: ["list", "get", "watch"] -- apiGroups: [""] - resources: ["pods"] - verbs: ["list"] -- apiGroups: ["apps"] - resources: ["replicasets"] - verbs: ["list", "get", "watch"] ---- -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: linkerd-Namespace-proxy-injector -subjects: -- kind: ServiceAccount - name: linkerd-proxy-injector - namespace: Namespace - apiGroup: "" -roleRef: - kind: ClusterRole - name: linkerd-Namespace-proxy-injector - apiGroup: rbac.authorization.k8s.io ---- kind: Service apiVersion: v1 metadata: