Skip to content

Commit

Permalink
use cert manager for pipelines cache server instead
Browse files Browse the repository at this point in the history
Signed-off-by: David van der Spek <[email protected]>
  • Loading branch information
davidspek committed Sep 18, 2023
1 parent b2575b1 commit 095c9c8
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 147 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
annotations:
cert-manager.io/inject-ca-from: kubeflow/{{ include "katib.fullname" . }}-controller-certs
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "katib.fullname" . }}-controller-certs
name: katib.kubeflow.org
labels: {{- include "katib.labels" . | nindent 4 }}
webhooks:
Expand Down
34 changes: 0 additions & 34 deletions kubeflow/helm/pipelines/templates/cache/deployer/clusterrole.yaml

This file was deleted.

This file was deleted.

55 changes: 0 additions & 55 deletions kubeflow/helm/pipelines/templates/cache/deployer/deployment.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions kubeflow/helm/pipelines/templates/cache/deployer/role.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions kubeflow/helm/pipelines/templates/cache/deployer/rolebinding.yaml

This file was deleted.

This file was deleted.

17 changes: 17 additions & 0 deletions kubeflow/helm/pipelines/templates/cache/server/certificate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: {{ include "pipelines.fullname" . }}-cache-certs
labels:
{{- include "pipelines.labels" . | nindent 4 }}
spec:
commonName: kfp-cache-cert
dnsNames:
- {{ include "pipelines.fullname" . }}-cache-server
- {{ include "pipelines.fullname" . }}-cache-server.{{ .Release.Namespace }}
- {{ include "pipelines.fullname" . }}-cache-server.{{ .Release.Namespace }}.svc
isCA: true
issuerRef:
kind: ClusterIssuer
name: kubeflow-self-signing-issuer
secretName: {{ include "pipelines.fullname" . }}-cache-server-tls
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ spec:
- --db_user=$(DBCONFIG_USER)
- --db_password=$(DBCONFIG_PASSWORD)
- --namespace_to_watch=$(NAMESPACE_TO_WATCH)
- --listen_ports=$(WEBHOOK_PORT)
- --listen_port=$(WEBHOOK_PORT)
- --tls_cert_filename=tls.crt
- --tls_key_filename=tls.key
env:
- name: NAMESPACE_TO_WATCH
value: ""
Expand All @@ -67,7 +69,7 @@ spec:
key: cacheNodeRestrictions
name: pipeline-install-config
- name: DBCONFIG_DRIVER
value: mysql
value: mysql # TODO: make configurable
- name: DBCONFIG_DB_NAME
valueFrom:
configMapKeyRef:
Expand Down Expand Up @@ -107,7 +109,7 @@ spec:
readOnly: true
volumes:
- secret:
secretName: webhook-server-tls
secretName: {{ include "pipelines.fullname" . }}-cache-server-tls
name: webhook-tls-certs
{{- with .Values.nodeSelector }}
nodeSelector:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
annotations:
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "pipelines.fullname" . }}-cache-cert
labels:
{{- include "pipelines.labels" . | nindent 4 }}
name: cache-webhook.pipelines.kubeflow.org
webhooks:
- admissionReviewVersions:
- v1beta1
clientConfig:
service:
name: {{ include "pipelines.fullname" . }}-cache-server
namespace: {{ .Release.Namespace }}
path: /mutate
failurePolicy: Ignore
name: {{ include "pipelines.fullname" . }}-cache-server.{{ .Release.Namespace }}.svc
objectSelector:
matchLabels:
pipelines.kubeflow.org/cache_enabled: "true"
rules:
- apiGroups:
- ""
apiVersions:
- v1
operations:
- CREATE
resources:
- pods
sideEffects: None
timeoutSeconds: 5

0 comments on commit 095c9c8

Please sign in to comment.