Skip to content

Commit c07628b

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Support hyperkube_prefix label"
2 parents 4ce323f + fc1f27a commit c07628b

File tree

17 files changed

+77
-16
lines changed

17 files changed

+77
-16
lines changed

doc/source/user/index.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,8 @@ the table are linked to more details elsewhere in the user guide.
357357
+---------------------------------------+--------------------+---------------+
358358
| `grafana_admin_passwd`_ | (any string) | "admin" |
359359
+---------------------------------------+--------------------+---------------+
360+
| `hyperkube_prefix`_ | see below | see below |
361+
+---------------------------------------+--------------------+---------------+
360362
| `kube_tag`_ | see below | see below |
361363
+---------------------------------------+--------------------+---------------+
362364
| `cloud_provider_tag`_ | see below | see below |
@@ -1279,6 +1281,15 @@ _`container_infra_prefix`
12791281
* quay.io/k8scsi/csi-resizer:v0.3.0
12801282
* quay.io/k8scsi/csi-node-driver-registrar:v1.1.0
12811283

1284+
_`hyperkube_prefix`
1285+
This label allows users to specify a custom prefix for Hyperkube container
1286+
source since official Hyperkube images have been discontinued for `kube_tag`
1287+
greater than 1.18.x. If you wish you use 1.19.x onwards, you may want to use
1288+
unofficial sources like `docker.io/rancher/`, `ghcr.io/openstackmagnum/` or
1289+
your own container registry. If `container_infra_prefix` label is defined, it
1290+
still takes precedence over this label.
1291+
Default: k8s.gcr.io/
1292+
12821293
_`kube_tag`
12831294
This label allows users to select a specific Kubernetes release based on its
12841295
container tag for `Fedora CoreOS image
@@ -1289,6 +1300,7 @@ _`kube_tag`
12891300
Stein default: v1.11.6
12901301
Train default: v1.15.7
12911302
Ussuri default: v1.18.2
1303+
Victoria default: v1.18.16
12921304

12931305
_`heapster_enabled`
12941306
heapster_enabled is used to enable disable the installation of heapster.

magnum/drivers/common/templates/kubernetes/fragments/configure-kubernetes-master.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ ExecStart=/bin/bash -c '/usr/bin/podman run --name kube-apiserver \\
9292
--volume /etc/ssl/certs:/etc/ssl/certs:ro \\
9393
--volume /run:/run \\
9494
--volume /etc/pki/tls/certs:/usr/share/ca-certificates:ro \\
95-
\${CONTAINER_INFRA_PREFIX:-k8s.gcr.io/}hyperkube:\${KUBE_TAG} \\
95+
\${CONTAINER_INFRA_PREFIX:-\${HYPERKUBE_PREFIX}}hyperkube:\${KUBE_TAG} \\
9696
kube-apiserver \\
9797
\$KUBE_LOGTOSTDERR \$KUBE_LOG_LEVEL \$KUBE_ETCD_SERVERS \$KUBE_API_ADDRESS \$KUBELET_PORT \$KUBE_SERVICE_ADDRESSES \$KUBE_ADMISSION_CONTROL \$KUBE_API_ARGS'
9898
ExecStop=-/usr/bin/podman stop kube-apiserver
@@ -121,7 +121,7 @@ ExecStart=/bin/bash -c '/usr/bin/podman run --name kube-controller-manager \\
121121
--volume /etc/ssl/certs:/etc/ssl/certs:ro \\
122122
--volume /run:/run \\
123123
--volume /etc/pki/tls/certs:/usr/share/ca-certificates:ro \\
124-
\${CONTAINER_INFRA_PREFIX:-k8s.gcr.io/}hyperkube:\${KUBE_TAG} \\
124+
\${CONTAINER_INFRA_PREFIX:-\${HYPERKUBE_PREFIX}}hyperkube:\${KUBE_TAG} \\
125125
kube-controller-manager \\
126126
--secure-port=0 \\
127127
\$KUBE_LOGTOSTDERR \$KUBE_LOG_LEVEL \$KUBE_MASTER \$KUBE_CONTROLLER_MANAGER_ARGS'
@@ -151,7 +151,7 @@ ExecStart=/bin/bash -c '/usr/bin/podman run --name kube-scheduler \\
151151
--volume /etc/ssl/certs:/etc/ssl/certs:ro \\
152152
--volume /run:/run \\
153153
--volume /etc/pki/tls/certs:/usr/share/ca-certificates:ro \\
154-
\${CONTAINER_INFRA_PREFIX:-k8s.gcr.io/}hyperkube:\${KUBE_TAG} \\
154+
\${CONTAINER_INFRA_PREFIX:-\${HYPERKUBE_PREFIX}}hyperkube:\${KUBE_TAG} \\
155155
kube-scheduler \\
156156
\$KUBE_LOGTOSTDERR \$KUBE_LOG_LEVEL \$KUBE_MASTER \$KUBE_SCHEDULER_ARGS'
157157
ExecStop=-/usr/bin/podman stop kube-scheduler
@@ -207,7 +207,7 @@ ExecStart=/bin/bash -c '/usr/bin/podman run --name kubelet \\
207207
--volume /var/run/lock:/var/run/lock:z \\
208208
--volume /opt/cni/bin:/opt/cni/bin:z \\
209209
--volume /etc/machine-id:/etc/machine-id \\
210-
\${CONTAINER_INFRA_PREFIX:-k8s.gcr.io/}hyperkube:\${KUBE_TAG} \\
210+
\${CONTAINER_INFRA_PREFIX:-\${HYPERKUBE_PREFIX}}hyperkube:\${KUBE_TAG} \\
211211
kubelet \\
212212
\$KUBE_LOGTOSTDERR \$KUBE_LOG_LEVEL \$KUBELET_API_SERVER \$KUBELET_ADDRESS \$KUBELET_PORT \$KUBELET_HOSTNAME \$KUBELET_ARGS'
213213
ExecStop=-/usr/bin/podman stop kubelet
@@ -240,7 +240,7 @@ ExecStart=/bin/bash -c '/usr/bin/podman run --name kube-proxy \\
240240
--volume /sys/fs/cgroup/systemd:/sys/fs/cgroup/systemd \\
241241
--volume /lib/modules:/lib/modules:ro \\
242242
--volume /etc/pki/tls/certs:/usr/share/ca-certificates:ro \\
243-
\${CONTAINER_INFRA_PREFIX:-k8s.gcr.io/}hyperkube:\${KUBE_TAG} \\
243+
\${CONTAINER_INFRA_PREFIX:-\${HYPERKUBE_PREFIX}}hyperkube:\${KUBE_TAG} \\
244244
kube-proxy \\
245245
\$KUBE_LOGTOSTDERR \$KUBE_LOG_LEVEL \$KUBE_MASTER \$KUBE_PROXY_ARGS'
246246
ExecStop=-/usr/bin/podman stop kube-proxy

magnum/drivers/common/templates/kubernetes/fragments/configure-kubernetes-minion.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ ExecStart=/bin/bash -c '/usr/bin/podman run --name kubelet \\
105105
--volume /var/run/lock:/var/run/lock:z \\
106106
--volume /opt/cni/bin:/opt/cni/bin:z \\
107107
--volume /etc/machine-id:/etc/machine-id \\
108-
\${CONTAINER_INFRA_PREFIX:-k8s.gcr.io/}hyperkube:\${KUBE_TAG} \\
108+
\${CONTAINER_INFRA_PREFIX:-\${HYPERKUBE_PREFIX}}hyperkube:\${KUBE_TAG} \\
109109
kubelet \\
110110
\$KUBE_LOGTOSTDERR \$KUBE_LOG_LEVEL \$KUBELET_API_SERVER \$KUBELET_ADDRESS \$KUBELET_PORT \$KUBELET_HOSTNAME \$KUBELET_ARGS'
111111
ExecStop=-/usr/bin/podman stop kubelet
@@ -138,7 +138,7 @@ ExecStart=/bin/bash -c '/usr/bin/podman run --name kube-proxy \\
138138
--volume /sys/fs/cgroup/systemd:/sys/fs/cgroup/systemd \\
139139
--volume /lib/modules:/lib/modules:ro \\
140140
--volume /etc/pki/tls/certs:/usr/share/ca-certificates:ro \\
141-
\${CONTAINER_INFRA_PREFIX:-k8s.gcr.io/}hyperkube:\${KUBE_TAG} \\
141+
\${CONTAINER_INFRA_PREFIX:-\${HYPERKUBE_PREFIX}}hyperkube:\${KUBE_TAG} \\
142142
kube-proxy \\
143143
\$KUBE_LOGTOSTDERR \$KUBE_LOG_LEVEL \$KUBE_MASTER \$KUBE_PROXY_ARGS'
144144
ExecStop=-/usr/bin/podman stop kube-proxy

magnum/drivers/common/templates/kubernetes/fragments/enable-services-master.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ do
3636
done
3737

3838
if [ "$(echo $USE_PODMAN | tr '[:upper:]' '[:lower:]')" == "true" ]; then
39-
KUBE_DIGEST=$($ssh_cmd podman image inspect ${CONTAINER_INFRA_PREFIX:-k8s.gcr.io/}hyperkube:${KUBE_TAG} --format "{{.Digest}}")
39+
KUBE_DIGEST=$($ssh_cmd podman image inspect ${CONTAINER_INFRA_PREFIX:-${HYPERKUBE_PREFIX}}hyperkube:${KUBE_TAG} --format "{{.Digest}}")
4040
if [ -n "${KUBE_IMAGE_DIGEST}" ] && [ "${KUBE_IMAGE_DIGEST}" != "${KUBE_DIGEST}" ]; then
4141
printf "The sha256 ${KUBE_DIGEST} of current hyperkube image cannot match the given one: ${KUBE_IMAGE_DIGEST}."
4242
exit 1

magnum/drivers/common/templates/kubernetes/fragments/install-clients.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set +x
66
. /etc/sysconfig/heat-params
77
set -x
88

9-
hyperkube_image="${CONTAINER_INFRA_PREFIX:-"k8s.gcr.io/"}hyperkube:${KUBE_TAG}"
9+
hyperkube_image="${CONTAINER_INFRA_PREFIX:-${HYPERKUBE_PREFIX}}hyperkube:${KUBE_TAG}"
1010
ssh_cmd="ssh -F /srv/magnum/.ssh/config root@localhost"
1111
mkdir -p /srv/magnum/bin/
1212
i=0

magnum/drivers/common/templates/kubernetes/fragments/upgrade-kubernetes.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,23 @@ if [ "${new_kube_tag}" != "${KUBE_TAG}" ]; then
3737
${ssh_cmd} podman rm ${service}
3838
done
3939

40-
${ssh_cmd} podman rmi ${CONTAINER_INFRA_PREFIX:-k8s.gcr.io/}hyperkube:${KUBE_TAG}
40+
${ssh_cmd} podman rmi ${CONTAINER_INFRA_PREFIX:-${HYPERKUBE_PREFIX}}hyperkube:${KUBE_TAG}
4141
echo "KUBE_TAG=$new_kube_tag" >> /etc/sysconfig/heat-params
4242

4343
for service in ${SERVICE_LIST}; do
4444
${ssh_cmd} systemctl start ${service}
4545
done
4646

4747
i=0
48-
until [ "`${ssh_cmd} podman image exists ${CONTAINER_INFRA_PREFIX:-k8s.gcr.io/}hyperkube:${new_kube_tag} && echo $?`" = 0 ]
48+
until [ "`${ssh_cmd} podman image exists ${CONTAINER_INFRA_PREFIX:-${HYPERKUBE_PREFIX}}hyperkube:${new_kube_tag} && echo $?`" = 0 ]
4949
do
5050
i=$((i+1))
5151
[ $i -lt 30 ] || break;
5252
echo "Pulling image: hyperkube:${new_kube_tag}"
5353
sleep 5s
5454
done
5555

56-
KUBE_DIGEST=$($ssh_cmd podman image inspect ${CONTAINER_INFRA_PREFIX:-k8s.gcr.io/}hyperkube:${new_kube_tag} --format "{{.Digest}}")
56+
KUBE_DIGEST=$($ssh_cmd podman image inspect ${CONTAINER_INFRA_PREFIX:-${HYPERKUBE_PREFIX}}hyperkube:${new_kube_tag} --format "{{.Digest}}")
5757
if [ -n "${new_kube_image_digest}" ] && [ "${new_kube_image_digest}" != "${KUBE_DIGEST}" ]; then
5858
printf "The sha256 ${KUBE_DIGEST} of current hyperkube image cannot match the given one: ${new_kube_image_digest}."
5959
exit 1

magnum/drivers/common/templates/kubernetes/fragments/write-heat-params-master.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ REGION_NAME="$REGION_NAME"
7575
HTTP_PROXY="$HTTP_PROXY"
7676
HTTPS_PROXY="$HTTPS_PROXY"
7777
NO_PROXY="$NO_PROXY"
78+
HYPERKUBE_PREFIX="$HYPERKUBE_PREFIX"
7879
KUBE_TAG="$KUBE_TAG"
7980
CLOUD_PROVIDER_TAG="$CLOUD_PROVIDER_TAG"
8081
CLOUD_PROVIDER_ENABLED="$CLOUD_PROVIDER_ENABLED"

magnum/drivers/common/templates/kubernetes/fragments/write-heat-params.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ HTTP_PROXY="$HTTP_PROXY"
5656
HTTPS_PROXY="$HTTPS_PROXY"
5757
NO_PROXY="$NO_PROXY"
5858
WAIT_CURL="$WAIT_CURL"
59+
HYPERKUBE_PREFIX="$HYPERKUBE_PREFIX"
5960
KUBE_TAG="$KUBE_TAG"
6061
FLANNEL_NETWORK_CIDR="$FLANNEL_NETWORK_CIDR"
6162
PODS_NETWORK_CIDR="$PODS_NETWORK_CIDR"

magnum/drivers/heat/k8s_fedora_template_def.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ def get_params(self, context, cluster_template, cluster, **kwargs):
7575
extra_params['cloud_provider_enabled'] = cloud_provider_enabled
7676

7777
label_list = ['coredns_tag',
78+
'hyperkube_prefix',
7879
'kube_tag', 'container_infra_prefix',
7980
'availability_zone',
8081
'cgroup_driver',

magnum/drivers/k8s_fedora_atomic_v1/templates/kubecluster.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,11 @@ parameters:
444444
type: string
445445
description: url for keystone
446446

447+
hyperkube_prefix:
448+
type: string
449+
description: prefix to use for hyperkube images
450+
default: k8s.gcr.io/
451+
447452
kube_tag:
448453
type: string
449454
description: tag of the k8s containers used to provision the kubernetes cluster
@@ -1222,6 +1227,7 @@ resources:
12221227
http_proxy: {get_param: http_proxy}
12231228
https_proxy: {get_param: https_proxy}
12241229
no_proxy: {get_param: no_proxy}
1230+
hyperkube_prefix: {get_param: hyperkube_prefix}
12251231
kube_tag: {get_param: master_kube_tag}
12261232
cloud_provider_tag: {get_param: cloud_provider_tag}
12271233
cloud_provider_enabled: {get_param: cloud_provider_enabled}
@@ -1457,6 +1463,7 @@ resources:
14571463
http_proxy: {get_param: http_proxy}
14581464
https_proxy: {get_param: https_proxy}
14591465
no_proxy: {get_param: no_proxy}
1466+
hyperkube_prefix: {get_param: hyperkube_prefix}
14601467
kube_tag: {get_param: minion_kube_tag}
14611468
kube_version: {get_param: kube_version}
14621469
trustee_user_id: {get_param: trustee_user_id}

0 commit comments

Comments
 (0)