forked from linkerd/linkerd2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add validation webhook for service profiles (linkerd#2623)
Add validation webhook for service profiles Fixes linkerd#2075 Todo in a follow-up PRs: remove the SP check from the CLI check. Signed-off-by: Alejandro Pedraza <[email protected]> Signed-off-by: [email protected] <[email protected]>
- Loading branch information
1 parent
4ddfa62
commit 6e9519c
Showing
41 changed files
with
2,280 additions
and
544 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 |
---|---|---|
@@ -0,0 +1,109 @@ | ||
{{with .Values -}} | ||
--- | ||
### | ||
### Service Profile Validator | ||
### | ||
--- | ||
kind: ServiceAccount | ||
apiVersion: v1 | ||
metadata: | ||
name: linkerd-sp-validator | ||
namespace: {{.Namespace}} | ||
--- | ||
kind: ClusterRole | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: linkerd-{{.Namespace}}-sp-validator | ||
rules: | ||
- apiGroups: [""] | ||
resources: ["pods"] | ||
verbs: ["list"] | ||
- apiGroups: ["admissionregistration.k8s.io"] | ||
resources: ["validatingwebhookconfigurations"] | ||
verbs: ["create", "get", "delete"] | ||
--- | ||
kind: ClusterRoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: linkerd-{{.Namespace}}-sp-validator | ||
subjects: | ||
- kind: ServiceAccount | ||
name: linkerd-sp-validator | ||
namespace: {{.Namespace}} | ||
apiGroup: "" | ||
roleRef: | ||
kind: ClusterRole | ||
name: linkerd-{{.Namespace}}-sp-validator | ||
apiGroup: rbac.authorization.k8s.io | ||
--- | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: linkerd-sp-validator | ||
namespace: {{.Namespace}} | ||
labels: | ||
{{.ControllerComponentLabel}}: sp-validator | ||
annotations: | ||
{{.CreatedByAnnotation}}: {{.CliVersion}} | ||
spec: | ||
type: ClusterIP | ||
selector: | ||
{{.ControllerComponentLabel}}: sp-validator | ||
ports: | ||
- name: sp-validator | ||
port: 443 | ||
targetPort: sp-validator | ||
--- | ||
kind: Deployment | ||
apiVersion: extensions/v1beta1 | ||
metadata: | ||
name: linkerd-sp-validator | ||
namespace: {{.Namespace}} | ||
labels: | ||
{{.ControllerComponentLabel}}: sp-validator | ||
annotations: | ||
{{.CreatedByAnnotation}}: {{.CliVersion}} | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
{{.ControllerComponentLabel}}: sp-validator | ||
template: | ||
metadata: | ||
labels: | ||
{{.ControllerComponentLabel}}: sp-validator | ||
annotations: | ||
{{.CreatedByAnnotation}}: {{.CliVersion}} | ||
spec: | ||
serviceAccountName: linkerd-sp-validator | ||
containers: | ||
- name: sp-validator | ||
image: {{.ControllerImage}} | ||
imagePullPolicy: {{.ImagePullPolicy}} | ||
args: | ||
- "sp-validator" | ||
- "-controller-namespace={{.Namespace}}" | ||
- "-log-level={{.ControllerLogLevel}}" | ||
ports: | ||
- name: sp-validator | ||
containerPort: 8443 | ||
livenessProbe: | ||
httpGet: | ||
path: /ping | ||
port: 9997 | ||
initialDelaySeconds: 10 | ||
readinessProbe: | ||
httpGet: | ||
path: /ready | ||
port: 9997 | ||
failureThreshold: 7 | ||
{{ with .SPValidatorResources -}} | ||
{{- template "resources" . }} | ||
{{ end -}} | ||
securityContext: | ||
runAsUser: {{.ControllerUID}} | ||
volumes: | ||
- name: config | ||
configMap: | ||
name: linkerd-config | ||
{{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
Oops, something went wrong.