Browse Source

[390506] support update strategy

- Update Makefile to more closely resemble UCP standards
- Add tools for downloading helm-toolkit
- Support update strategy

Change-Id: I21d50ade416552eeb6be9bbebbfc1effd1ae7f15
Scott Hussey 1 year ago
parent
commit
651cb8f816

+ 6
- 6
Makefile View File

@@ -26,13 +26,15 @@ $(CHARTS):
26 26
 	@echo "===== Processing [$@] chart ====="
27 27
 	@make $(TASK)-$@
28 28
 
29
-init-%:
30
-	if [ -f $*/Makefile ]; then make -C $*; fi
31
-	if [ -f $*/requirements.yaml ]; then helm dep up $*; fi
29
+init-%: clean
30
+	DEP_UP_LIST=$* tools/helm_tk.sh $(HELM)
32 31
 
33 32
 lint-%: init-%
34 33
 	if [ -d $* ]; then $(HELM) lint $*; fi
35 34
 
35
+dryrun-%: init-%
36
+	$(HELM) template $*
37
+
36 38
 build-%: lint-%
37 39
 	if [ -d $* ]; then $(HELM) package $*; fi
38 40
 
@@ -45,6 +47,4 @@ clean:
45 47
 .PHONY: $(EXCLUDES) $(CHARTS)
46 48
 
47 49
 .PHONY: charts
48
-charts: clean
49
-	$(HELM) dep up $(CHART)
50
-	$(HELM) package $(CHART)
50
+charts: clean build-$(CHART)

+ 1
- 0
divingbell/templates/daemonset-ethtool.yaml View File

@@ -25,6 +25,7 @@ kind: DaemonSet
25 25
 metadata:
26 26
   name: {{ $daemonset }}
27 27
 spec:
28
+{{ tuple $envAll $daemonset | include "helm-toolkit.snippets.kubernetes_upgrades_daemonset" | indent 2 }}
28 29
   template:
29 30
     metadata:
30 31
       labels:

+ 1
- 0
divingbell/templates/daemonset-mounts.yaml View File

@@ -25,6 +25,7 @@ kind: DaemonSet
25 25
 metadata:
26 26
   name: {{ $daemonset }}
27 27
 spec:
28
+{{ tuple $envAll $daemonset | include "helm-toolkit.snippets.kubernetes_upgrades_daemonset" | indent 2 }}
28 29
   template:
29 30
     metadata:
30 31
       labels:

+ 1
- 0
divingbell/templates/daemonset-sysctl.yaml View File

@@ -25,6 +25,7 @@ kind: DaemonSet
25 25
 metadata:
26 26
   name: {{ $daemonset }}
27 27
 spec:
28
+{{ tuple $envAll $daemonset | include "helm-toolkit.snippets.kubernetes_upgrades_daemonset" | indent 2 }}
28 29
   template:
29 30
     metadata:
30 31
       labels:

+ 1
- 0
divingbell/templates/daemonset-uamlite.yaml View File

@@ -25,6 +25,7 @@ kind: DaemonSet
25 25
 metadata:
26 26
   name: {{ $daemonset }}
27 27
 spec:
28
+{{ tuple $envAll $daemonset | include "helm-toolkit.snippets.kubernetes_upgrades_daemonset" | indent 2 }}
28 29
   template:
29 30
     metadata:
30 31
       labels:

+ 22
- 0
divingbell/values.yaml View File

@@ -24,3 +24,25 @@ images:
24 24
 conf:
25 25
   chroot_mnt_path: '/mnt'
26 26
   log_colors: False
27
+
28
+pod:
29
+  lifecycle:
30
+    upgrades:
31
+      daemonsets:
32
+        pod_replacement_strategy: RollingUpdate
33
+        ethtool:
34
+          enabled: true
35
+          min_ready_seconds: 0
36
+          max_unavailable: 100%
37
+        mounts:
38
+          enabled: true
39
+          min_ready_seconds: 0
40
+          max_unavailable: 100%
41
+        uamlite:
42
+          enabled: true
43
+          min_ready_seconds: 0
44
+          max_unavailable: 100%
45
+        sysctl:
46
+          enabled: true
47
+          min_ready_seconds: 0
48
+          max_unavailable: 100%

+ 65
- 0
tools/helm_tk.sh View File

@@ -0,0 +1,65 @@
1
+#!/bin/bash
2
+# Copyright 2018 AT&T Intellectual Property.  All other rights reserved.
3
+#
4
+# Licensed under the Apache License, Version 2.0 (the "License");
5
+# you may not use this file except in compliance with the License.
6
+# You may obtain a copy of the License at
7
+#
8
+#     http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+# Unless required by applicable law or agreed to in writing, software
11
+# distributed under the License is distributed on an "AS IS" BASIS,
12
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+# See the License for the specific language governing permissions and
14
+# limitations under the License.
15
+#
16
+# Script to setup helm-toolkit and helm dep up the shipyard chart
17
+#
18
+HELM=$1
19
+HTK_REPO=${HTK_REPO:-"https://github.com/openstack/openstack-helm"}
20
+HTK_PATH=${HTK_PATH:-""}
21
+DEP_UP_LIST=${DEP_UP_LIST:-"divingbell"}
22
+
23
+if [[ ! -z $(echo $http_proxy) ]]
24
+then
25
+  export no_proxy=$no_proxy,127.0.0.1
26
+fi
27
+
28
+set -x
29
+
30
+function helm_serve {
31
+  if [[ -d "$HOME/.helm" ]]; then
32
+     echo ".helm directory found"
33
+  else
34
+     ${HELM} init --client-only
35
+  fi
36
+  if [[ -z $(curl -s 127.0.0.1:8879 | grep 'Helm Repository') ]]; then
37
+     ${HELM} serve & > /dev/null
38
+     while [[ -z $(curl -s 127.0.0.1:8879 | grep 'Helm Repository') ]]; do
39
+        sleep 1
40
+        echo "Waiting for Helm Repository"
41
+     done
42
+  else
43
+     echo "Helm serve already running"
44
+  fi
45
+
46
+  if ${HELM} repo list | grep -q "^stable" ; then
47
+     ${HELM} repo remove stable
48
+  fi
49
+
50
+  ${HELM} repo add local http://localhost:8879/charts
51
+}
52
+
53
+mkdir -p build
54
+pushd build
55
+git clone --depth 1 $HTK_REPO || true
56
+pushd openstack-helm/$HTK_PATH
57
+
58
+git pull
59
+helm_serve
60
+make helm-toolkit
61
+popd && popd
62
+for c in $DEP_UP_LIST
63
+do
64
+  ${HELM} dep up $c
65
+done

Loading…
Cancel
Save