Browse Source

Merge "Fix failure of systemd service kube-ui"

changes/19/388319/1
Jenkins 5 years ago
committed by Gerrit Code Review
parent
commit
6b7ebfc36d
2 changed files with 22 additions and 5 deletions
  1. +6
    -1
      magnum/drivers/common/templates/kubernetes/fragments/kube-system-namespace-service.sh
  2. +16
    -4
      magnum/drivers/common/templates/kubernetes/fragments/kube-ui-service.sh

+ 6
- 1
magnum/drivers/common/templates/kubernetes/fragments/kube-system-namespace-service.sh View File

@ -32,7 +32,12 @@ do
sleep 5
done
/usr/bin/kubectl create -f /srv/kubernetes/kube-system-namespace.json
#check for existence of namespace
/usr/bin/kubectl get namespace kube-system
if [ "\$?" != "0" ]; then
/usr/bin/kubectl create -f /srv/kubernetes/kube-system-namespace.json
fi
EOF
}


+ 16
- 4
magnum/drivers/common/templates/kubernetes/fragments/kube-ui-service.sh View File

@ -86,8 +86,19 @@ do
sleep 5
done
/usr/bin/kubectl create -f /srv/kubernetes/manifests/kube-ui-rc.yaml --namespace=kube-system
/usr/bin/kubectl create -f /srv/kubernetes/manifests/kube-ui-svc.yaml --namespace=kube-system
#echo check for existence of kube-ui-v4 replication controller
/usr/bin/kubectl get rc kube-ui-v4 --namespace=kube-system
if [ "\$?" != "0" ]; then
/usr/bin/kubectl create -f /srv/kubernetes/manifests/kube-ui-rc.yaml --namespace=kube-system
fi
#echo check for existence of kube-ui service
/usr/bin/kubectl get service kube-ui --namespace=kube-system
if [ "\$?" != "0" ]; then
/usr/bin/kubectl create -f /srv/kubernetes/manifests/kube-ui-svc.yaml --namespace=kube-system
fi
EOF
}
@ -97,12 +108,13 @@ KUBE_UI_SERVICE=/etc/systemd/system/kube-ui.service
mkdir -p $(dirname ${KUBE_UI_SERVICE})
cat << EOF > ${KUBE_UI_SERVICE}
[Unit]
After=kube-system-namespace
After=kube-system-namespace.service
Requires=kubelet.service
Requires=kube-system-namespace.service
Wants=kube-system-namespace.service
[Service]
Type=oneshot
Environment=HOME=/root
EnvironmentFile=-/etc/kubernetes/config
ExecStart=${KUBE_UI_BIN}


Loading…
Cancel
Save