Skip to content
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

Remove PV from MySQL component #1527

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- cert-generator.yaml
- rbac.yaml
- cert-generator.yaml
- rbac.yaml
10 changes: 5 additions & 5 deletions manifests/v1beta1/components/controller/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- controller.yaml
- katib-config.yaml
- rbac.yaml
- service.yaml
- trial-templates.yaml
- controller.yaml
- katib-config.yaml
- rbac.yaml
- service.yaml
- trial-templates.yaml
6 changes: 3 additions & 3 deletions manifests/v1beta1/components/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- experiment.yaml
- suggestion.yaml
- trial.yaml
- experiment.yaml
- suggestion.yaml
- trial.yaml
4 changes: 0 additions & 4 deletions manifests/v1beta1/components/db-manager/db-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ spec:
ports:
- name: api
containerPort: 6789
readinessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:6789"]
initialDelaySeconds: 5
livenessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:6789"]
Expand Down
4 changes: 2 additions & 2 deletions manifests/v1beta1/components/db-manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- db-manager.yaml
- service.yaml
- db-manager.yaml
- service.yaml
9 changes: 4 additions & 5 deletions manifests/v1beta1/components/mysql/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- mysql.yaml
- pv.yaml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will we use the in-container FS to keep the db files?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gaocegege We mount PVC to the container FS here:

mountPath: /var/lib/mysql

It depends on the user's StorageClass, how it will store once container is deleted.

- pvc.yaml
- secret.yaml
- service.yaml
- mysql.yaml
- pvc.yaml
- secret.yaml
- service.yaml
18 changes: 12 additions & 6 deletions manifests/v1beta1/components/mysql/mysql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,24 @@ spec:
- "/bin/bash"
- "-c"
- "mysql -D ${MYSQL_DATABASE} -u root -p${MYSQL_ROOT_PASSWORD} -e 'SELECT 1'"
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 1
periodSeconds: 2
failureThreshold: 10
livenessProbe:
exec:
command:
- "/bin/bash"
- "-c"
- "mysqladmin ping -u root -p${MYSQL_ROOT_PASSWORD}"
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
periodSeconds: 2
failureThreshold: 10
startupProbe:
exec:
command:
- "/bin/bash"
- "-c"
- "mysqladmin ping -u root -p${MYSQL_ROOT_PASSWORD}"
periodSeconds: 15
failureThreshold: 60
volumeMounts:
- name: katib-mysql
mountPath: /var/lib/mysql
Expand Down
14 changes: 0 additions & 14 deletions manifests/v1beta1/components/mysql/pv.yaml

This file was deleted.

1 change: 0 additions & 1 deletion manifests/v1beta1/components/mysql/pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ metadata:
name: katib-mysql
namespace: kubeflow
spec:
storageClassName: katib
accessModes:
- ReadWriteOnce
resources:
Expand Down
6 changes: 3 additions & 3 deletions manifests/v1beta1/components/ui/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- rbac.yaml
- service.yaml
- ui.yaml
- rbac.yaml
- service.yaml
- ui.yaml
2 changes: 1 addition & 1 deletion manifests/v1beta1/components/webhook/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- webhooks.yaml
- webhooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ spec:
isCA: true
commonName: $(KATIB_SERVICE_NAME).$(KATIB_NAMESPACE).svc
dnsNames:
- $(KATIB_SERVICE_NAME).$(KATIB_NAMESPACE).svc
- $(KATIB_SERVICE_NAME).$(KATIB_NAMESPACE).svc.cluster.local
- $(KATIB_SERVICE_NAME).$(KATIB_NAMESPACE).svc
- $(KATIB_SERVICE_NAME).$(KATIB_NAMESPACE).svc.cluster.local
issuerRef:
kind: Issuer
name: katib-selfsigned-issuer
secretName: katib-webhook-cert

---

apiVersion: cert-manager.io/v1alpha2
kind: Issuer
metadata:
Expand Down
36 changes: 18 additions & 18 deletions manifests/v1beta1/installs/katib-cert-manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,28 @@ patchesStrategicMerge:
- patches/katib-cert-injection.yaml

vars:
- fieldref:
fieldPath: metadata.namespace
name: KATIB_NAMESPACE
objref:
apiVersion: v1
kind: Service
name: katib-controller
- fieldref:
fieldPath: metadata.name
name: KATIB_SERVICE_NAME
objref:
apiVersion: v1
kind: Service
name: katib-controller
- name: KATIB_CERT_NAME
objref:
- fieldref:
fieldPath: metadata.namespace
name: KATIB_NAMESPACE
objref:
apiVersion: v1
kind: Service
name: katib-controller
- fieldref:
fieldPath: metadata.name
name: KATIB_SERVICE_NAME
objref:
apiVersion: v1
kind: Service
name: katib-controller
- name: KATIB_CERT_NAME
objref:
kind: Certificate
group: cert-manager.io
version: v1alpha2
name: katib-webhook-cert
fieldref:
fieldpath: metadata.name
fieldref:
fieldpath: metadata.name

configurations:
- params.yaml
32 changes: 15 additions & 17 deletions manifests/v1beta1/installs/katib-cert-manager/params.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
varReference:
- path: spec/http/route/destination/host
kind: VirtualService
- path: spec/commonName
kind: Certificate
- path: spec/dnsNames
kind: Certificate
- path: spec/issuerRef/name
kind: Certificate
- path: metadata/annotations
kind: MutatingWebhookConfiguration
- path: metadata/annotations
kind: ValidatingWebhookConfiguration
- path: spec/commonName
kind: Certificate
- path: spec/dnsNames
kind: Certificate
- path: spec/issuerRef/name
kind: Certificate
- path: metadata/annotations
kind: MutatingWebhookConfiguration
- path: metadata/annotations
kind: ValidatingWebhookConfiguration
nameReference:
- kind: Issuer
group: cert-manager.io
fieldSpecs:
- kind: Certificate
- kind: Issuer
group: cert-manager.io
path: spec/issuerRef/name
fieldSpecs:
- kind: Certificate
group: cert-manager.io
path: spec/issuerRef/name
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ images:
newName: docker.io/kubeflowkatib/cert-generator
newTag: latest
patchesStrategicMerge:
- db-manager-patch.yaml
- patches/db-manager.yaml
# Modify katib-mysql-secrets with parameters for the DB.
secretGenerator:
- name: katib-mysql-secrets
Expand Down
17 changes: 3 additions & 14 deletions manifests/v1beta1/installs/katib-openshift/kustomization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,11 @@
# - No Job is spawned to generate TLS key for `katib-controller` Service
# - Instead, the Service and WebhookConfigurations linked to it are annotated
# for OpenShift service controller to handle TLS certification.
# - PersistentVolumeClaim has empty `.spec.storageClassName` to allow dynamic
# provisioning with default StorageClass
#
# Requires OpenShift version: 4.4+
#
# Note: PersistentVolume should not be created, as OpenShift installations typically
# have PVC dynamic provisioning configured or need some extra administrative effort
# to provision a PV manually.
#
# To achieve this, run:
#
#
# `kustomize build ./manifests/v1beta1/installs/katib-openshift | oc apply -f - -l type!=local`
---
apiVersion: kustomize.config.k8s.io/v1beta1
Expand Down Expand Up @@ -51,6 +46,7 @@ patchesJson6902:
version: v1
kind: Service
name: katib-controller
namespace: kubeflow
path: patches/service-serving-cert.yaml
# Annotate WebhookConfigurations to delegate `caBundle` population to OpenShift service controller
# https://docs.openshift.com/container-platform/4.6/security/certificates/service-serving-certificate.html#add-service-certificate-mutating-webhook_service-serving-certificate
Expand All @@ -66,10 +62,3 @@ patchesJson6902:
kind: MutatingWebhookConfiguration
name: katib.kubeflow.org
path: patches/webhook-inject-cabundle.yaml
# Remove PVC's storageClassName to provision it with the default StorageClass by default
- target:
group: ""
version: v1
kind: PersistentVolumeClaim
name: katib-mysql
path: patches/pvc-unset-storageClass.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---
- op: "add"
path: "/metadata/annotations"
value:
service.beta.openshift.io/serving-cert-secret-name: katib-webhook-cert
path: "/metadata/annotations/service.beta.openshift.io~1serving-cert-secret-name"
value: katib-webhook-cert
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
- op: "add"
path: "/metadata/annotations"
value:
Expand Down
24 changes: 8 additions & 16 deletions manifests/v1beta1/installs/katib-with-kubeflow/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,16 @@ images:
newTag: latest

patchesStrategicMerge:
- patches/remove-resources-patch.yaml

patchesJson6902:
- path: patches/mysql-pvc.yaml
target:
version: v1
name: katib-mysql
kind: PersistentVolumeClaim
namespace: kubeflow
- patches/remove-namespace.yaml

vars:
- fieldref:
fieldPath: metadata.namespace
name: KATIB_UI_NAMESPACE
objref:
apiVersion: apps/v1
kind: Deployment
name: katib-ui
- fieldref:
fieldPath: metadata.namespace
name: KATIB_UI_NAMESPACE
objref:
apiVersion: apps/v1
kind: Deployment
name: katib-ui

configurations:
- params.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$patch: delete
apiVersion: v1
kind: Namespace
metadata:
name: kubeflow

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/v1beta1/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ set -o xtrace
SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/../..

cd ${SCRIPT_ROOT}
kustomize build manifests/v1beta1/installs/katib-standalone --load_restrictor none | kubectl apply -f -
kustomize build manifests/v1beta1/installs/katib-standalone | kubectl apply -f -
2 changes: 1 addition & 1 deletion scripts/v1beta1/undeploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ sleep 10
SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/../..

cd ${SCRIPT_ROOT}
kustomize build manifests/v1beta1/installs/katib-standalone --load_restrictor none | kubectl delete -f -
kustomize build manifests/v1beta1/installs/katib-standalone | kubectl delete -f -