summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Hussey <sh8121@att.com>2018-03-22 09:55:25 -0500
committerCraig Anderson <craig.anderson@att.com>2018-03-23 22:56:44 +0000
commit651cb8f816dd2e1fa1eb2ad641a8c532f3ac630b (patch)
tree005bab9032fe13064eebd5f031fbc272897dec76
parent9e7028416e8b6798c1b2bf04770bd165e398b5c1 (diff)
[390506] support update strategy
- Update Makefile to more closely resemble UCP standards - Add tools for downloading helm-toolkit - Support update strategy Change-Id: I21d50ade416552eeb6be9bbebbfc1effd1ae7f15
-rw-r--r--Makefile12
-rw-r--r--divingbell/templates/daemonset-ethtool.yaml1
-rw-r--r--divingbell/templates/daemonset-mounts.yaml1
-rw-r--r--divingbell/templates/daemonset-sysctl.yaml1
-rw-r--r--divingbell/templates/daemonset-uamlite.yaml1
-rw-r--r--divingbell/values.yaml22
-rwxr-xr-xtools/helm_tk.sh65
7 files changed, 97 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index be00a53..089a50c 100644
--- a/Makefile
+++ b/Makefile
@@ -26,13 +26,15 @@ $(CHARTS):
26 @echo "===== Processing [$@] chart =====" 26 @echo "===== Processing [$@] chart ====="
27 @make $(TASK)-$@ 27 @make $(TASK)-$@
28 28
29init-%: 29init-%: clean
30 if [ -f $*/Makefile ]; then make -C $*; fi 30 DEP_UP_LIST=$* tools/helm_tk.sh $(HELM)
31 if [ -f $*/requirements.yaml ]; then helm dep up $*; fi
32 31
33lint-%: init-% 32lint-%: init-%
34 if [ -d $* ]; then $(HELM) lint $*; fi 33 if [ -d $* ]; then $(HELM) lint $*; fi
35 34
35dryrun-%: init-%
36 $(HELM) template $*
37
36build-%: lint-% 38build-%: lint-%
37 if [ -d $* ]; then $(HELM) package $*; fi 39 if [ -d $* ]; then $(HELM) package $*; fi
38 40
@@ -45,6 +47,4 @@ clean:
45.PHONY: $(EXCLUDES) $(CHARTS) 47.PHONY: $(EXCLUDES) $(CHARTS)
46 48
47.PHONY: charts 49.PHONY: charts
48charts: clean 50charts: clean build-$(CHART)
49 $(HELM) dep up $(CHART)
50 $(HELM) package $(CHART)
diff --git a/divingbell/templates/daemonset-ethtool.yaml b/divingbell/templates/daemonset-ethtool.yaml
index 903a919..8490cbf 100644
--- a/divingbell/templates/daemonset-ethtool.yaml
+++ b/divingbell/templates/daemonset-ethtool.yaml
@@ -25,6 +25,7 @@ kind: DaemonSet
25metadata: 25metadata:
26 name: {{ $daemonset }} 26 name: {{ $daemonset }}
27spec: 27spec:
28{{ tuple $envAll $daemonset | include "helm-toolkit.snippets.kubernetes_upgrades_daemonset" | indent 2 }}
28 template: 29 template:
29 metadata: 30 metadata:
30 labels: 31 labels:
diff --git a/divingbell/templates/daemonset-mounts.yaml b/divingbell/templates/daemonset-mounts.yaml
index ce09d8d..5d22d89 100644
--- a/divingbell/templates/daemonset-mounts.yaml
+++ b/divingbell/templates/daemonset-mounts.yaml
@@ -25,6 +25,7 @@ kind: DaemonSet
25metadata: 25metadata:
26 name: {{ $daemonset }} 26 name: {{ $daemonset }}
27spec: 27spec:
28{{ tuple $envAll $daemonset | include "helm-toolkit.snippets.kubernetes_upgrades_daemonset" | indent 2 }}
28 template: 29 template:
29 metadata: 30 metadata:
30 labels: 31 labels:
diff --git a/divingbell/templates/daemonset-sysctl.yaml b/divingbell/templates/daemonset-sysctl.yaml
index 7fba82f..217fa60 100644
--- a/divingbell/templates/daemonset-sysctl.yaml
+++ b/divingbell/templates/daemonset-sysctl.yaml
@@ -25,6 +25,7 @@ kind: DaemonSet
25metadata: 25metadata:
26 name: {{ $daemonset }} 26 name: {{ $daemonset }}
27spec: 27spec:
28{{ tuple $envAll $daemonset | include "helm-toolkit.snippets.kubernetes_upgrades_daemonset" | indent 2 }}
28 template: 29 template:
29 metadata: 30 metadata:
30 labels: 31 labels:
diff --git a/divingbell/templates/daemonset-uamlite.yaml b/divingbell/templates/daemonset-uamlite.yaml
index 453e636..7baa706 100644
--- a/divingbell/templates/daemonset-uamlite.yaml
+++ b/divingbell/templates/daemonset-uamlite.yaml
@@ -25,6 +25,7 @@ kind: DaemonSet
25metadata: 25metadata:
26 name: {{ $daemonset }} 26 name: {{ $daemonset }}
27spec: 27spec:
28{{ tuple $envAll $daemonset | include "helm-toolkit.snippets.kubernetes_upgrades_daemonset" | indent 2 }}
28 template: 29 template:
29 metadata: 30 metadata:
30 labels: 31 labels:
diff --git a/divingbell/values.yaml b/divingbell/values.yaml
index cbb28dc..e070554 100644
--- a/divingbell/values.yaml
+++ b/divingbell/values.yaml
@@ -24,3 +24,25 @@ images:
24conf: 24conf:
25 chroot_mnt_path: '/mnt' 25 chroot_mnt_path: '/mnt'
26 log_colors: False 26 log_colors: False
27
28pod:
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%
diff --git a/tools/helm_tk.sh b/tools/helm_tk.sh
new file mode 100755
index 0000000..9ed74a0
--- /dev/null
+++ b/tools/helm_tk.sh
@@ -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#
18HELM=$1
19HTK_REPO=${HTK_REPO:-"https://github.com/openstack/openstack-helm"}
20HTK_PATH=${HTK_PATH:-""}
21DEP_UP_LIST=${DEP_UP_LIST:-"divingbell"}
22
23if [[ ! -z $(echo $http_proxy) ]]
24then
25 export no_proxy=$no_proxy,127.0.0.1
26fi
27
28set -x
29
30function 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
53mkdir -p build
54pushd build
55git clone --depth 1 $HTK_REPO || true
56pushd openstack-helm/$HTK_PATH
57
58git pull
59helm_serve
60make helm-toolkit
61popd && popd
62for c in $DEP_UP_LIST
63do
64 ${HELM} dep up $c
65done