@@ -33,7 +33,7 @@ onInstall:
3333 version: ${settings.version}
3434 - script: |
3535 var message = "Kubernetes Cluster has been successfuly upgraded! **Current version:** ${settings.version}. \n\nNo other upgrades are available.";
36- if ("${this .avail}") message += "\n\n**Next version:** ${this.avail}. \nPress \"Upgrade\" button to start the upgrade process.";
36+ if ("${settings .avail}") message += "\n\n**Next version:** ${this.avail}. \nPress \"Upgrade\" button to start the upgrade process.";
3737 return {result:"info", message:message};
3838
3939actions:
@@ -44,7 +44,7 @@ actions:
4444 chmod +x /usr/local/sbin/wait-deployment.sh
4545 kubectl get daemonset weave-net -n kube-system && {
4646 kubectl apply -f ${baseUrl}/addons/weave-pack.yaml;
47- kubectl -n kube-system wait --for=condition=Ready pod -l name=weave-net --timeout=-1s; }
47+ kubectl -n kube-system wait --for=condition=Ready pod -l name=weave-net --timeout=-1s; } ||:
4848 - cmd[${nodes.k8sm.master.id}]: |-
4949 kubectl get daemonset traefik-ingress-controller -n kube-system &>/dev/null && echo "traefik" ||:
5050 kubectl get deployment nginx-ingress-controller -n ingress-nginx &>/dev/null && echo "nginx" ||:
@@ -83,25 +83,57 @@ actions:
8383 kubectl apply -f ${baseUrl}/addons/metrics-server/resource-reader.yaml
8484 wait-deployment.sh metrics-server kube-system 1 720
8585 - cmd[${nodes.k8sm.master.id}]: |-
86- kubectl get deploy kubernetes-dashboard -n kubernetes-dashboard && {
86+ kubectl get deployment kubernetes-dashboard -n kubernetes-dashboard && {
8787 kubectl delete ns kubernetes-dashboard;
88- kubectl apply -f ${baseUrl}/addons/kubernetes-dashboard-beta.yaml;
89- kubectl apply -f ${baseUrl}/addons/ingress/${globals.ingress-dir}/dashboard-ingress-beta.yaml; }
88+ for i in {1..5}; do sleep 5; echo "Attempt ${i}/5: "; kubectl apply -f ${baseUrl}/addons/kubernetes-dashboard-beta.yaml && break; done;
89+ kubectl apply -f ${baseUrl}/addons/ingress/${globals.ingress-dir}/dashboard-ingress-beta.yaml; } ||:
90+ - cmd[${nodes.k8sm.master.id}]: |-
91+ kubectl get deployment hello-kubernetes && {
92+ kubectl apply -f ${baseUrl}/addons/helloworld.yaml;
93+ kubectl apply -f ${baseUrl}/addons/ingress/${globals.ingress-dir}/helloworld-ingress.yaml; } ||:
9094 - cmd[${nodes.k8sm.master.id}]: |-
9195 helm init --upgrade --service-account tiller
9296 helm repo update
9397 wait-deployment.sh tiller-deploy kube-system 1 720
98+ - cmd[${nodes.k8sm.master.id}]: |-
99+ kubectl get secret --namespace kubernetes-monitoring monitoring-grafana && {
100+ helm upgrade monitoring-prometheus stable/prometheus --set server.prefixURL=/prometheus --set server.baseURL=/prometheus ;
101+ wait-deployment.sh monitoring-prometheus-server kubernetes-monitoring 1 720;
102+ helm fetch stable/grafana --untar;
103+ helm upgrade monitoring-grafana --set 'grafana\.ini'.server.root_url=${env.url}grafana -f ${baseUrl}/addons/monitoring/jelastic-values.yaml grafana/. ;
104+ wait-deployment.sh monitoring-grafana kubernetes-monitoring 1 720;
105+ kubectl apply -f ${baseUrl}/addons/monitoring/${globals.ingress-dir}/prometheus-ingress.yaml;
106+ kubectl apply -f ${baseUrl}/addons/monitoring/${globals.ingress-dir}/alert-ingress.yaml;
107+ kubectl apply -f ${baseUrl}/addons/monitoring/${globals.ingress-dir}/grafana-ingress.yaml; } ||:
108+ - cmd[${nodes.k8sm.master.id}]: echo $(kubectl get NetworkPolicy,PodSecurityPolicy,DaemonSet,Deployment,ReplicaSet --all-namespaces -o 'jsonpath={range .items[*]}{.metadata.annotations.kubectl\.kubernetes\.io/last-applied-configuration}{"\n"}{end}' | grep '"apiVersion":"extensions/v1beta1"')
109+ - setGlobals:
110+ k8s_deprecated_ext: ${response.out}
111+ - if ('${globals.k8s_deprecated_ext}'):
112+ return:
113+ type: warning
114+ message: Deprecated Kubernetes Extensions API found! Please review installed components prior to Kubernetes 1.16+ cluster upgrade.
115+ - cmd[${nodes.k8sm.master.id}]: echo $(kubectl get DaemonSet,Deployment,StatefulSet,ReplicaSet --all-namespaces -o 'jsonpath={range .items[*]}{.metadata.annotations.kubectl\.kubernetes\.io/last-applied-configuration}{"\n"}{end}' | grep '"apiVersion":"apps/v1beta')
116+ - setGlobals:
117+ k8s_deprecated_app: ${response.out}
118+ - if ('${globals.k8s_deprecated_app}'):
119+ return:
120+ type: warning
121+ message: Deprecated Kubernetes Apps API found! Please review installed components prior to Kubernetes 1.16+ cluster upgrade.
94122
95123 upgrade-masters:
96124 - env.control.RedeployContainers:
97125 nodeId: ${this.id}
98126 tag: ${this.version}
99127 skipReinstall: true
100128 - cmd[${this.id}]: |-
101- wget -nv https://github.com/weaveworks/weave/releases/download/v2.5.2/weave -O /usr/bin/weave
102- chmod +x /usr/bin/weave
129+ kubectl get daemonset weave-net -n kube-system && {
130+ wget -nv https://github.com/weaveworks/weave/releases/download/v2.5.2/weave -O /usr/bin/weave;
131+ chmod +x /usr/bin/weave; } ||:
103132 wget -nv ${baseUrl}/scripts/wait-deployment.sh -O /usr/local/sbin/wait-deployment.sh
104133 chmod +x /usr/local/sbin/wait-deployment.sh
134+ [ -f "/root/wait-deployment.sh" ] && {
135+ rm -f /root/wait-deployment.sh;
136+ ln -s /usr/local/sbin/wait-deployment.sh /root/wait-deployment.sh; } ||:
105137 while true; do kubectl get nodes --no-headers | grep -qv '\sReady\s' || break ; done
106138 sleep 5
107139 - if (${this.master}):
0 commit comments