-
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
Open
jastBytes
wants to merge
14
commits into
main
Choose a base branch
from
feat/STACKITSKE-6021-pod-identity-webhook
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
f3333d2
feat(imagevector): add stackit-pod-identity-webhook image
jastBytes 1c3d5d7
feat(charts): add stackit-pod-identity-webhook charts
jastBytes 0f65310
feat(controlplane): implement STACKIT pod identity webhook deployment
jastBytes 5d86145
test(controlplane): add tests for STACKIT pod identity webhook
jastBytes c9b9220
feat(review): apply post review suggestions
jastBytes 261f36a
feat(controlplane): hide pod identity webhook through a new feature g…
jastBytes 77d4080
feat(controlplane): update pod identity webhook image to use GHCR and…
jastBytes cfbe8a2
fix(naming): fix naming to match references
jastBytes df413aa
revert(chart): revert change of values
jastBytes ed52f33
refactor(webhook): remove topology spread constraints from deployment…
jastBytes 196dbac
Update charts/internal/seed-controlplane/charts/stackit-pod-identity-…
jastBytes e5b72c2
refactor(pod-identity-webhook): Updates the deployment and associated…
jastBytes 243a224
feat(webhook): expose metrics endpoint for identity webhook via pod l…
jastBytes 430c657
chore(config): disable pod identity webhook in component values
jastBytes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
charts/internal/seed-controlplane/charts/stackit-pod-identity-webhook/Chart.yaml
This file contains hidden or 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,3 @@ | ||
| apiVersion: v1 | ||
| name: stackit-pod-identity-webhook | ||
| version: 0.1.0 | ||
104 changes: 104 additions & 0 deletions
104
.../internal/seed-controlplane/charts/stackit-pod-identity-webhook/templates/deployment.yaml
This file contains hidden or 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,104 @@ | ||
| 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: | ||
jastBytes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| revisionHistoryLimit: 2 | ||
| 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 | ||
| prometheus.io/scrape: "true" | ||
| prometheus.io/port: {{ .Values.metrics.port | quote }} | ||
| prometheus.io/name: "{{ .Release.Name }}" | ||
| spec: | ||
| 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 }} | ||
| - --metrics-bind-address={{ .Values.metrics.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 | ||
jastBytes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| containerPort: {{ .Values.metrics.port }} | ||
| protocol: TCP | ||
| - name: health | ||
| containerPort: 8081 | ||
| protocol: TCP | ||
| livenessProbe: | ||
| httpGet: | ||
| path: /healthz | ||
| port: health | ||
| readinessProbe: | ||
| httpGet: | ||
| path: /readyz | ||
| port: health | ||
| resources: | ||
| requests: | ||
| cpu: {{ .Values.vpa.resourcePolicy.minAllowed.cpu }} | ||
| memory: {{ .Values.vpa.resourcePolicy.minAllowed.memory }} | ||
| 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-stackit-pod-identity-webhook | ||
| optional: false | ||
13 changes: 13 additions & 0 deletions
13
.../seed-controlplane/charts/stackit-pod-identity-webhook/templates/poddisruptionbudget.yaml
This file contains hidden or 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,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 |
21 changes: 21 additions & 0 deletions
21
charts/internal/seed-controlplane/charts/stackit-pod-identity-webhook/templates/service.yaml
This file contains hidden or 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,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 | ||
25 changes: 25 additions & 0 deletions
25
charts/internal/seed-controlplane/charts/stackit-pod-identity-webhook/templates/vpa.yaml
This file contains hidden or 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,25 @@ | ||
| 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: InPlaceOrRecreate | ||
| resourcePolicy: | ||
| containerPolicies: | ||
| - containerName: stackit-pod-identity-webhook | ||
| minAllowed: | ||
| cpu: {{ .Values.vpa.resourcePolicy.minAllowed.cpu }} | ||
| memory: {{ .Values.vpa.resourcePolicy.minAllowed.memory }} | ||
| maxAllowed: | ||
| cpu: {{ .Values.vpa.resourcePolicy.maxAllowed.cpu }} | ||
| memory: {{ .Values.vpa.resourcePolicy.maxAllowed.memory }} | ||
| controlledValues: RequestsAndLimits | ||
| controlledResources: | ||
| - cpu | ||
| - memory |
21 changes: 21 additions & 0 deletions
21
charts/internal/seed-controlplane/charts/stackit-pod-identity-webhook/values.yaml
This file contains hidden or 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,21 @@ | ||
| 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 | ||
| minAllowed: | ||
| cpu: 50m | ||
| memory: 64Mi | ||
|
|
||
| metrics: | ||
| port: 8080 |
This file contains hidden or 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 hidden or 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
3 changes: 3 additions & 0 deletions
3
charts/internal/shoot-system-components/charts/stackit-pod-identity-webhook/Chart.yaml
This file contains hidden or 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,3 @@ | ||
| apiVersion: v1 | ||
jastBytes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| name: stackit-pod-identity-webhook | ||
| version: 0.1.0 | ||
32 changes: 32 additions & 0 deletions
32
...omponents/charts/stackit-pod-identity-webhook/templates/mutatingwebhookconfiguration.yaml
This file contains hidden or 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,32 @@ | ||
| 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 | ||
| timeoutSeconds: 3 # Do not block control-plane API calls too long. | ||
| failurePolicy: Fail | ||
| namespaceSelector: | ||
| matchExpressions: | ||
| - key: gardener.cloud/purpose # see https://github.com/gardener/gardener/blob/master/docs/usage/shoot/shoot_status.md#constraints | ||
| operator: NotIn | ||
| values: | ||
| - kube-system | ||
| - key: workload-identity.stackit.cloud/skip-pod-identity-webhook | ||
| operator: DoesNotExist | ||
| objectSelector: | ||
| matchExpressions: | ||
| - key: workload-identity.stackit.cloud/skip-pod-identity-webhook | ||
| operator: DoesNotExist |
21 changes: 21 additions & 0 deletions
21
.../internal/shoot-system-components/charts/stackit-pod-identity-webhook/templates/rbac.yaml
This file contains hidden or 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,21 @@ | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRole | ||
| metadata: | ||
| name: extensions.gardener.cloud:provider-stackit: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:stackit-pod-identity-webhook | ||
| subjects: | ||
| - kind: ServiceAccount # from shoot access secret | ||
| name: stackit-pod-identity-webhook | ||
| namespace: kube-system | ||
| roleRef: | ||
| kind: ClusterRole | ||
| name: extensions.gardener.cloud:provider-stackit:stackit-pod-identity-webhook | ||
| apiGroup: rbac.authorization.k8s.io |
2 changes: 2 additions & 0 deletions
2
charts/internal/shoot-system-components/charts/stackit-pod-identity-webhook/values.yaml
This file contains hidden or 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,2 @@ | ||
| webhook: | ||
| caBundle: "" # will be set by valuesprovider |
This file contains hidden or 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 hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.