-
Notifications
You must be signed in to change notification settings - Fork 1
Add stackit-pod-identity-webhook image and configuration #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
f3333d2
1c3d5d7
0f65310
5d86145
c9b9220
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| apiVersion: v1 | ||
| name: stackit-pod-identity-webhook | ||
| version: 0.1.0 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: stackit-pod-identity-webhook | ||
| namespace: {{ .Release.Namespace }} | ||
| labels: | ||
| app.kubernetes.io/name: stackit-pod-identity-webhook | ||
| high-availability-config.resources.gardener.cloud/type: server | ||
| spec: | ||
| replicas: {{ .Values.replicaCount }} | ||
| selector: | ||
| matchLabels: | ||
| app.kubernetes.io/name: stackit-pod-identity-webhook | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app.kubernetes.io/name: stackit-pod-identity-webhook | ||
| workload-identity.stackit.cloud/skip-pod-identity-webhook: "true" | ||
| gardener.cloud/role: controlplane | ||
| networking.gardener.cloud/to-dns: allowed | ||
| networking.resources.gardener.cloud/to-kube-apiserver-tcp-443: allowed | ||
| spec: | ||
| topologySpreadConstraints: | ||
| - maxSkew: 1 | ||
| topologyKey: "topology.kubernetes.io/zone" | ||
| whenUnsatisfiable: DoNotSchedule | ||
| labelSelector: | ||
| matchLabels: | ||
| app.kubernetes.io/name: stackit-pod-identity-webhook | ||
| - maxSkew: 1 | ||
| topologyKey: "kubernetes.io/hostname" | ||
| whenUnsatisfiable: ScheduleAnyway | ||
| labelSelector: | ||
| matchLabels: | ||
| app.kubernetes.io/name: stackit-pod-identity-webhook | ||
| automountServiceAccountToken: false | ||
| podSecurityContext: | ||
| runAsNonRoot: true | ||
| runAsUser: 1239 | ||
| runAsGroup: 1239 | ||
| fsGroup: 1239 | ||
| securityContext: | ||
| allowPrivilegeEscalation: false | ||
| capabilities: | ||
| drop: | ||
| - ALL | ||
| readOnlyRootFilesystem: true | ||
| priorityClassName: gardener-system-200 | ||
| containers: | ||
| - name: stackit-pod-identity-webhook | ||
| securityContext: | ||
| allowPrivilegeEscalation: false | ||
| capabilities: | ||
| drop: | ||
| - ALL | ||
| readOnlyRootFilesystem: true | ||
| image: {{ index .Values.images "stackit-pod-identity-webhook" }} | ||
jastBytes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| args: | ||
| - --cert-dir=/etc/webhook/certs | ||
| - --port={{ .Values.webhook.port }} | ||
| env: | ||
| - name: KUBECONFIG | ||
| value: /var/run/secrets/gardener.cloud/shoot/generic-kubeconfig/kubeconfig | ||
| ports: | ||
| - name: https | ||
| containerPort: {{ .Values.webhook.port }} | ||
| protocol: TCP | ||
| - name: metrics | ||
| containerPort: 8080 | ||
| protocol: TCP | ||
| - name: health | ||
| containerPort: 8081 | ||
| protocol: TCP | ||
| livenessProbe: | ||
| httpGet: | ||
| path: /healthz | ||
| port: health | ||
| readinessProbe: | ||
| httpGet: | ||
| path: /readyz | ||
| port: health | ||
| resources: | ||
| limits: | ||
| memory: 128Mi | ||
| requests: | ||
| cpu: 50m | ||
| memory: 64Mi | ||
| volumeMounts: | ||
| - name: certs | ||
| mountPath: /etc/webhook/certs | ||
| readOnly: true | ||
| - mountPath: /var/run/secrets/gardener.cloud/shoot/generic-kubeconfig | ||
| name: kubeconfig | ||
| readOnly: true | ||
| volumes: | ||
| - name: certs | ||
| secret: | ||
| secretName: {{ .Values.webhook.tlsSecretName }} | ||
| - name: kubeconfig | ||
| projected: | ||
| defaultMode: 420 | ||
| sources: | ||
| - secret: | ||
| items: | ||
| - key: kubeconfig | ||
| path: kubeconfig | ||
| name: {{ .Values.global.genericTokenKubeconfigSecretName }} | ||
| optional: false | ||
| - secret: | ||
| items: | ||
| - key: token | ||
| path: token | ||
| name: shoot-access-pod-identity-webhook | ||
| optional: false | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| apiVersion: policy/v1 | ||
| kind: PodDisruptionBudget | ||
| metadata: | ||
| name: stackit-pod-identity-webhook | ||
| namespace: {{ .Release.Namespace }} | ||
| labels: | ||
| app.kubernetes.io/name: stackit-pod-identity-webhook | ||
| spec: | ||
| maxUnavailable: 1 | ||
| selector: | ||
| matchLabels: | ||
| app.kubernetes.io/name: stackit-pod-identity-webhook | ||
| unhealthyPodEvictionPolicy: AlwaysAllow |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| apiVersion: v1 | ||
| kind: Service | ||
jastBytes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| metadata: | ||
| name: stackit-pod-identity-webhook | ||
| namespace: {{ .Release.Namespace }} | ||
| labels: | ||
| app.kubernetes.io/name: stackit-pod-identity-webhook | ||
| endpoint-slice-hints.resources.gardener.cloud/consider: "true" | ||
| annotations: | ||
| networking.resources.gardener.cloud/from-all-webhook-targets-allowed-ports: '[{"protocol":"TCP","port":{{ .Values.webhook.port }}}]' | ||
| service.kubernetes.io/topology-mode: auto | ||
| spec: | ||
| type: ClusterIP | ||
| ports: | ||
| - port: 443 | ||
| targetPort: {{ .Values.webhook.port }} | ||
| protocol: TCP | ||
| name: https | ||
| selector: | ||
| app.kubernetes.io/name: stackit-pod-identity-webhook | ||
| trafficDistribution: PreferClose | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| apiVersion: autoscaling.k8s.io/v1 | ||
| kind: VerticalPodAutoscaler | ||
| metadata: | ||
| name: stackit-pod-identity-webhook | ||
| namespace: {{ .Release.Namespace }} | ||
| spec: | ||
| targetRef: | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| name: stackit-pod-identity-webhook | ||
| updatePolicy: | ||
| updateMode: Auto | ||
| resourcePolicy: | ||
| containerPolicies: | ||
| - containerName: stackit-pod-identity-webhook | ||
| minAllowed: | ||
| memory: 80M | ||
| maxAllowed: | ||
| cpu: {{ .Values.vpa.resourcePolicy.maxAllowed.cpu }} | ||
| memory: {{ .Values.vpa.resourcePolicy.maxAllowed.memory }} | ||
| controlledValues: RequestsOnly |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| replicaCount: 2 | ||
|
|
||
| images: | ||
| stackit-pod-identity-webhook: image-repository:image-tag | ||
|
|
||
| webhook: | ||
| port: 9443 | ||
| # The secret name containing tls.crt and tls.key for the webhook server | ||
| tlsSecretName: "stackit-pod-identity-webhook-certs" | ||
|
|
||
| vpa: | ||
| resourcePolicy: | ||
| maxAllowed: | ||
| cpu: 1 | ||
| memory: 512Mi |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| apiVersion: v1 | ||
jastBytes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| name: stackit-pod-identity-webhook | ||
| version: 0.1.0 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| apiVersion: admissionregistration.k8s.io/v1 | ||
| kind: MutatingWebhookConfiguration | ||
| metadata: | ||
| name: stackit-pod-identity-webhook | ||
| labels: | ||
| app.kubernetes.io/name: stackit-pod-identity-webhook | ||
| webhooks: | ||
| - name: stackit-pod-identity-webhook.stackit.cloud | ||
| clientConfig: | ||
| url: {{ .Values.webhook.url | quote }} | ||
| caBundle: {{ .Values.webhook.caBundle | quote }} | ||
| rules: | ||
| - operations: ["CREATE"] | ||
| apiGroups: [""] | ||
| apiVersions: ["v1"] | ||
| resources: ["pods"] | ||
| admissionReviewVersions: ["v1"] | ||
| sideEffects: None | ||
| failurePolicy: Fail | ||
| namespaceSelector: | ||
| matchExpressions: | ||
| - key: kubernetes.io/metadata.name | ||
| operator: NotIn | ||
| values: ["kube-system", "garden"] | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @MichaelEischer and me were not sure if this is necessary or what the expected default excludes should be here to not mess up things? |
||
| - key: workload-identity.stackit.cloud/skip-pod-identity-webhook | ||
| operator: DoesNotExist | ||
| objectSelector: | ||
| matchExpressions: | ||
| - key: workload-identity.stackit.cloud/skip-pod-identity-webhook | ||
| operator: DoesNotExist | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRole | ||
| metadata: | ||
| name: extensions.gardener.cloud:provider-stackit:pod-identity-webhook | ||
| rules: | ||
| - apiGroups: [""] | ||
| resources: ["serviceaccounts"] | ||
| verbs: ["get", "list", "watch"] | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRoleBinding | ||
| metadata: | ||
| name: extensions.gardener.cloud:provider-stackit:pod-identity-webhook | ||
| subjects: | ||
| - kind: ServiceAccount # from shoot access secret | ||
| name: pod-identity-webhook | ||
| namespace: kube-system | ||
| roleRef: | ||
| kind: ClusterRole | ||
| name: extensions.gardener.cloud:provider-stackit:pod-identity-webhook | ||
| apiGroup: rbac.authorization.k8s.io |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| webhook: | ||
| caBundle: "" # will be set by valuesprovider | ||
| controlPlaneNamespace: "" # will be set by valuesprovider |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -135,3 +135,6 @@ images: | |
| - name: stackit-alb-controller-manager | ||
| repository: reg3.infra.ske.eu01.stackit.cloud/temp/alb-controller-manager | ||
| tag: "1245" | ||
| - name: stackit-pod-identity-webhook | ||
| repository: reg3.infra.ske.eu01.stackit.cloud/stackitcloud/stackit-pod-identity-webhook | ||
| tag: "726f2f0@sha256:fca1f67cd7e6a515e795a34ae45d0c239379d051e494dc202033f6987b41b154" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the record (as discussed in chat): the |
||
Uh oh!
There was an error while loading. Please reload this page.