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

[Manifest] Cache - Fix upgrade manifest #3338

Merged
merged 16 commits into from
Mar 25, 2020
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
13 changes: 12 additions & 1 deletion backend/src/cache/deployer/deploy-cache-service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ set -ex
echo "Start deploying cache service to existing cluster:"

NAMESPACE=${NAMESPACE_TO_WATCH:-default}
mutatingWebhookConfigName="cache-webhook"
export CA_FILE="ca_cert"
rm -f ${CA_FILE}
touch ${CA_FILE}
Expand All @@ -35,6 +36,16 @@ echo "Signed certificate generated for cache server"
NAMESPACE="$NAMESPACE" ./webhook-patch-ca-bundle.sh --cert_input_path "${CA_FILE}" <./cache-configmap.yaml.template >./cache-configmap-ca-bundle.yaml
echo "CA_BUNDLE patched successfully"

checkWebhookConfig() {
webhookconfig=$(kubectl get mutatingwebhookconfigurations -n ${NAMESPACE} ${mutatingWebhookConfigName})
}

# Create MutatingWebhookConfiguration
cat ./cache-configmap-ca-bundle.yaml
kubectl apply -f ./cache-configmap-ca-bundle.yaml --namespace "${NAMESPACE}"

while true; do
if ! checkWebhookConfig; then
kubectl apply -f ./cache-configmap-ca-bundle.yaml --namespace "${NAMESPACE}"
fi
sleep 10
done
24 changes: 0 additions & 24 deletions manifests/kustomize/base/cache-deployer/cache-deployer-job.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: cache-deployer-statefulset
labels:
app: cache-deployer
spec:
replicas: 1
serviceName: cache-deployer
selector:
matchLabels:
app: cache-deployer
template:
metadata:
labels:
app: cache-deployer
spec:
containers:
- name: main
image: gcr.io/ml-pipeline/cache-deployer:latest
imagePullPolicy: Always
env:
- name: NAMESPACE_TO_WATCH
valueFrom:
fieldRef:
fieldPath: metadata.namespace
serviceAccountName: kubeflow-pipelines-cache-deployer-sa
restartPolicy: Always
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please explain the reason to restart a successfully completed deployer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

StatefulSet and Deployment only support restartPolicy: Always. In this scenario the script will keep running. Seems like Job is still the most fit role. But regarding upgrade issue, is there any way we can delete the deployer-job after it finish?

volumeClaimTemplates: []
2 changes: 1 addition & 1 deletion manifests/kustomize/base/cache-deployer/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ resources:
- cache-deployer-clusterrole.yaml
- cache-deployer-clusterrolebinding.yaml
- cache-deployer-sa.yaml
- cache-deployer-job.yaml
- cache-deployer-statefulset.yaml

2 changes: 1 addition & 1 deletion manifests/kustomize/base/cache/cache-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
spec:
containers:
- name: server
image: gcr.io/ml-pipeline-test/cache-server:latest
image: gcr.io/ml-pipeline/cache-server:latest
env:
- name: DBCONFIG_DRIVER
valueFrom:
Expand Down