@@ -4,8 +4,6 @@ metadata:
4
4
name: "${ CLUSTER_NAME} -control-plane"
5
5
spec:
6
6
kubeadmConfigSpec:
7
- clusterConfiguration:
8
- kubernetesVersion: "${ KUBERNETES_VERSION} "
9
7
initConfiguration:
10
8
nodeRegistration:
11
9
kubeletExtraArgs:
15
13
kubeletExtraArgs:
16
14
v: "8"
17
15
verbosity: 8
18
- preKubeadmCommands:
19
- - bash -c /tmp/kubeadm-bootstrap.sh
20
- files:
21
- - path: /etc/kubernetes/cloud.conf
22
- owner: root
23
- permissions: "0600"
24
- content: ${ OPENSTACK_CLOUD_PROVIDER_CONF_B64}
25
- encoding: base64
26
- - path: /etc/certs/cacert
27
- owner: root
28
- permissions: "0600"
29
- content: ${ OPENSTACK_CLOUD_CACERT_B64}
30
- encoding: base64
31
- - path: /tmp/kubeadm-bootstrap.sh
32
- owner: "root:root"
33
- permissions: "0744"
34
- content: |
35
- #!/bin/bash
36
-
37
- set -o nounset
38
- set -o pipefail
39
- set -o errexit
40
- set -e
41
-
42
- [[ $(id -u) != 0 ]] && SUDO="sudo" || SUDO=""
43
-
44
- # This script installs binaries and containers that are a result of the CI and release builds.
45
- # It runs '... --version' commands to verify that the binaries are correctly installed
46
-
47
- LINE_SEPARATOR="*************************************************"
48
- echo "$LINE_SEPARATOR"
49
-
50
- echo "$(date): stopping kubelet"
51
- ${ SUDO} systemctl stop kubelet
52
-
53
- echo "$(date): debug output"
54
- ps aux
55
- top -b -n 1
56
-
57
- CI_VERSION=${ CI_VERSION:-" ${KUBERNETES_VERSION}" }
58
- if [[ "${ CI_VERSION} " != "" ]]; then
59
- CI_DIR=/tmp/k8s-ci
60
- mkdir -p $CI_DIR
61
- # replace + with %2B for the URL
62
- CI_URL="https://storage.googleapis.com/kubernetes-release-dev/ci/${ CI_VERSION//+/% 2B} -bazel/bin/linux/amd64"
63
- declare -a BINARIES_TO_TEST=("kubectl" "kubelet" "kubeadm")
64
- declare -a CONTAINERS_TO_TEST=("kube-apiserver" "kube-controller-manager" "kube-scheduler" "kube-proxy")
65
- CONTAINER_EXT="tar"
66
-
67
- echo "* testing CI version $CI_VERSION"
68
-
69
- for CI_BINARY in "${ BINARIES_TO_TEST[@]} "; do
70
- echo "$(date): downloading binary $CI_URL/$CI_BINARY"
71
- # move old binary away to avoid err "Text file busy"
72
- ${ SUDO} mv /usr/bin/${ CI_BINARY} /usr/bin/${ CI_BINARY} .bak
73
- ${ SUDO} curl --retry 5 -sS "${ CI_URL} /${ CI_BINARY} " -o "${ CI_DIR} /${ CI_BINARY} "
74
- ${ SUDO} cp ${ CI_DIR} /${ CI_BINARY} /usr/bin/${ CI_BINARY}
75
- ${ SUDO} chmod +x /usr/bin/${ CI_BINARY}
76
- echo "$(date): downloading binary $CI_URL/$CI_BINARY finished"
77
- done
78
-
79
- for CI_CONTAINER in "${ CONTAINERS_TO_TEST[@]} "; do
80
- echo "$(date): downloading container $CI_URL/$CI_CONTAINER.$CONTAINER_EXT"
81
- ${ SUDO} curl --retry 5 -sS "${ CI_URL} /$CI_CONTAINER.$CONTAINER_EXT" -o "$CI_DIR/$CI_CONTAINER.$CONTAINER_EXT"
82
- ${ SUDO} ctr -n k8s.io images import "$CI_DIR/$CI_CONTAINER.$CONTAINER_EXT" || echo "* ignoring expected 'ctr images import' result"
83
- ${ SUDO} ctr -n k8s.io images tag k8s.gcr.io/$CI_CONTAINER-amd64:"${ CI_VERSION//+/_} " k8s.gcr.io/$CI_CONTAINER:"${ CI_VERSION//+/_} "
84
- ${ SUDO} ctr -n k8s.io images tag k8s.gcr.io/$CI_CONTAINER-amd64:"${ CI_VERSION//+/_} " gcr.io/kubernetes-ci-images/$CI_CONTAINER:"${ CI_VERSION//+/_} "
85
- echo "$(date): downloading container $CI_URL/$CI_CONTAINER.$CONTAINER_EXT finished"
86
- done
87
- fi
88
-
89
- echo "$(date): checking binary versions"
90
-
91
- echo "ctr version: " $(ctr version)
92
- echo "kubeadm version: " $(kubeadm version -o=short)
93
- echo "kubectl version: " $(kubectl version --client=true --short=true)
94
- echo "kubelet version: " $(kubelet --version)
95
-
96
- echo "$LINE_SEPARATOR"
97
- version: "${ KUBERNETES_VERSION} "
98
16
---
99
17
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3
100
18
kind: KubeadmConfigTemplate
@@ -104,92 +22,3 @@ spec:
104
22
template:
105
23
spec:
106
24
verbosity: 8
107
- preKubeadmCommands:
108
- - bash -c /tmp/kubeadm-bootstrap.sh
109
- files:
110
- - content: ${ OPENSTACK_CLOUD_PROVIDER_CONF_B64}
111
- encoding: base64
112
- owner: root
113
- path: /etc/kubernetes/cloud.conf
114
- permissions: "0600"
115
- - content: ${ OPENSTACK_CLOUD_CACERT_B64}
116
- encoding: base64
117
- owner: root
118
- path: /etc/certs/cacert
119
- permissions: "0600"
120
- - path: /tmp/kubeadm-bootstrap.sh
121
- owner: "root:root"
122
- permissions: "0744"
123
- content: |
124
- #!/bin/bash
125
-
126
- set -o nounset
127
- set -o pipefail
128
- set -o errexit
129
- set -e
130
-
131
- [[ $(id -u) != 0 ]] && SUDO="sudo" || SUDO=""
132
-
133
- # This script installs binaries and containers that are a result of the CI and release builds.
134
- # It runs '... --version' commands to verify that the binaries are correctly installed
135
-
136
- LINE_SEPARATOR="*************************************************"
137
- echo "$LINE_SEPARATOR"
138
-
139
- echo "$(date): stopping kubelet"
140
- ${ SUDO} systemctl stop kubelet
141
-
142
- echo "$(date): debug output"
143
- ps aux
144
- top -b -n 1
145
-
146
- CI_VERSION=${ CI_VERSION:-" ${KUBERNETES_VERSION}" }
147
- if [[ "${ CI_VERSION} " != "" ]]; then
148
- CI_DIR=/tmp/k8s-ci
149
- mkdir -p $CI_DIR
150
- # replace + with %2B for the URL
151
- CI_URL="https://storage.googleapis.com/kubernetes-release-dev/ci/${ CI_VERSION//+/% 2B} -bazel/bin/linux/amd64"
152
- declare -a BINARIES_TO_TEST=("kubectl" "kubelet" "kubeadm")
153
- declare -a CONTAINERS_TO_TEST=("kube-proxy")
154
- CONTAINER_EXT="tar"
155
-
156
- echo "* testing CI version $CI_VERSION"
157
-
158
- for CI_BINARY in "${ BINARIES_TO_TEST[@]} "; do
159
- echo "$(date): downloading binary $CI_URL/$CI_BINARY"
160
- # move old binary away to avoid err "Text file busy"
161
- ${ SUDO} mv /usr/bin/${ CI_BINARY} /usr/bin/${ CI_BINARY} .bak
162
- ${ SUDO} curl --retry 5 -sS "${ CI_URL} /${ CI_BINARY} " -o "${ CI_DIR} /${ CI_BINARY} "
163
- ${ SUDO} cp ${ CI_DIR} /${ CI_BINARY} /usr/bin/${ CI_BINARY}
164
- ${ SUDO} chmod +x /usr/bin/${ CI_BINARY}
165
- echo "$(date): downloading binary $CI_URL/$CI_BINARY finished"
166
- done
167
-
168
- for CI_CONTAINER in "${ CONTAINERS_TO_TEST[@]} "; do
169
- echo "$(date): downloading container $CI_URL/$CI_CONTAINER.$CONTAINER_EXT"
170
- ${ SUDO} curl --retry 5 -sS "${ CI_URL} /$CI_CONTAINER.$CONTAINER_EXT" -o "$CI_DIR/$CI_CONTAINER.$CONTAINER_EXT"
171
- ${ SUDO} ctr -n k8s.io images import "$CI_DIR/$CI_CONTAINER.$CONTAINER_EXT" || echo "* ignoring expected 'ctr images import' result"
172
- ${ SUDO} ctr -n k8s.io images tag k8s.gcr.io/$CI_CONTAINER-amd64:"${ CI_VERSION//+/_} " k8s.gcr.io/$CI_CONTAINER:"${ CI_VERSION//+/_} "
173
- ${ SUDO} ctr -n k8s.io images tag k8s.gcr.io/$CI_CONTAINER-amd64:"${ CI_VERSION//+/_} " gcr.io/kubernetes-ci-images/$CI_CONTAINER:"${ CI_VERSION//+/_} "
174
- echo "$(date): downloading container $CI_URL/$CI_CONTAINER.$CONTAINER_EXT finished"
175
- done
176
- fi
177
-
178
- echo "$(date): checking binary versions"
179
-
180
- echo "ctr version: " $(ctr version)
181
- echo "kubeadm version: " $(kubeadm version -o=short)
182
- echo "kubectl version: " $(kubectl version --client=true --short=true)
183
- echo "kubelet version: " $(kubelet --version)
184
-
185
- echo "$LINE_SEPARATOR"
186
- ---
187
- apiVersion: cluster.x-k8s.io/v1alpha3
188
- kind: MachineDeployment
189
- metadata:
190
- name: "${ CLUSTER_NAME} -md-0"
191
- spec:
192
- clusterName: "${ CLUSTER_NAME} "
193
- template:
194
- spec:
195
- version: "${ KUBERNETES_VERSION} "
0 commit comments