Skip to content

Commit fc1f27a

Browse files
committed
Support hyperkube_prefix label
Additionally for k8s_fedora_coreos_v1 driver: * Introduce hyperkube_prefix which defaults to k8s.gcr.io/ * Bump default kube_tag to v1.18.16 Story: 1668998 Task: 41791 Change-Id: I38b8df45a00f1a2a1604059b8329d1dd762e05cd
1 parent 61cb345 commit fc1f27a

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
@@ -342,6 +342,8 @@ the table are linked to more details elsewhere in the user guide.
342342
+---------------------------------------+--------------------+---------------+
343343
| `grafana_admin_passwd`_ | (any string) | "admin" |
344344
+---------------------------------------+--------------------+---------------+
345+
| `hyperkube_prefix`_ | see below | see below |
346+
+---------------------------------------+--------------------+---------------+
345347
| `kube_tag`_ | see below | see below |
346348
+---------------------------------------+--------------------+---------------+
347349
| `cloud_provider_tag`_ | see below | see below |
@@ -1268,6 +1270,15 @@ _`container_infra_prefix`
12681270
* quay.io/k8scsi/csi-resizer:v0.3.0
12691271
* quay.io/k8scsi/csi-node-driver-registrar:v1.1.0
12701272

1273+
_`hyperkube_prefix`
1274+
This label allows users to specify a custom prefix for Hyperkube container
1275+
source since official Hyperkube images have been discontinued for `kube_tag`
1276+
greater than 1.18.x. If you wish you use 1.19.x onwards, you may want to use
1277+
unofficial sources like `docker.io/rancher/`, `ghcr.io/openstackmagnum/` or
1278+
your own container registry. If `container_infra_prefix` label is defined, it
1279+
still takes precedence over this label.
1280+
Default: k8s.gcr.io/
1281+
12711282
_`kube_tag`
12721283
This label allows users to select a specific Kubernetes release based on its
12731284
container tag for `Fedora Atomic
@@ -1280,6 +1291,7 @@ _`kube_tag`
12801291
Stein default: v1.11.6
12811292
Train default: v1.15.7
12821293
Ussuri default: v1.18.2
1294+
Victoria default: v1.18.16
12831295

12841296
_`heapster_enabled`
12851297
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
@@ -93,7 +93,7 @@ ExecStart=/bin/bash -c '/usr/bin/podman run --name kube-apiserver \\
9393
--volume /etc/ssl/certs:/etc/ssl/certs:ro \\
9494
--volume /run:/run \\
9595
--volume /etc/pki/tls/certs:/usr/share/ca-certificates:ro \\
96-
\${CONTAINER_INFRA_PREFIX:-k8s.gcr.io/}hyperkube:\${KUBE_TAG} \\
96+
\${CONTAINER_INFRA_PREFIX:-\${HYPERKUBE_PREFIX}}hyperkube:\${KUBE_TAG} \\
9797
kube-apiserver \\
9898
\$KUBE_LOGTOSTDERR \$KUBE_LOG_LEVEL \$KUBE_ETCD_SERVERS \$KUBE_API_ADDRESS \$KUBELET_PORT \$KUBE_SERVICE_ADDRESSES \$KUBE_ADMISSION_CONTROL \$KUBE_API_ARGS'
9999
ExecStop=-/usr/bin/podman stop kube-apiserver
@@ -122,7 +122,7 @@ ExecStart=/bin/bash -c '/usr/bin/podman run --name kube-controller-manager \\
122122
--volume /etc/ssl/certs:/etc/ssl/certs:ro \\
123123
--volume /run:/run \\
124124
--volume /etc/pki/tls/certs:/usr/share/ca-certificates:ro \\
125-
\${CONTAINER_INFRA_PREFIX:-k8s.gcr.io/}hyperkube:\${KUBE_TAG} \\
125+
\${CONTAINER_INFRA_PREFIX:-\${HYPERKUBE_PREFIX}}hyperkube:\${KUBE_TAG} \\
126126
kube-controller-manager \\
127127
--secure-port=0 \\
128128
\$KUBE_LOGTOSTDERR \$KUBE_LOG_LEVEL \$KUBE_MASTER \$KUBE_CONTROLLER_MANAGER_ARGS'
@@ -152,7 +152,7 @@ ExecStart=/bin/bash -c '/usr/bin/podman run --name kube-scheduler \\
152152
--volume /etc/ssl/certs:/etc/ssl/certs:ro \\
153153
--volume /run:/run \\
154154
--volume /etc/pki/tls/certs:/usr/share/ca-certificates:ro \\
155-
\${CONTAINER_INFRA_PREFIX:-k8s.gcr.io/}hyperkube:\${KUBE_TAG} \\
155+
\${CONTAINER_INFRA_PREFIX:-\${HYPERKUBE_PREFIX}}hyperkube:\${KUBE_TAG} \\
156156
kube-scheduler \\
157157
\$KUBE_LOGTOSTDERR \$KUBE_LOG_LEVEL \$KUBE_MASTER \$KUBE_SCHEDULER_ARGS'
158158
ExecStop=-/usr/bin/podman stop kube-scheduler
@@ -208,7 +208,7 @@ ExecStart=/bin/bash -c '/usr/bin/podman run --name kubelet \\
208208
--volume /var/run/lock:/var/run/lock:z \\
209209
--volume /opt/cni/bin:/opt/cni/bin:z \\
210210
--volume /etc/machine-id:/etc/machine-id \\
211-
\${CONTAINER_INFRA_PREFIX:-k8s.gcr.io/}hyperkube:\${KUBE_TAG} \\
211+
\${CONTAINER_INFRA_PREFIX:-\${HYPERKUBE_PREFIX}}hyperkube:\${KUBE_TAG} \\
212212
kubelet \\
213213
\$KUBE_LOGTOSTDERR \$KUBE_LOG_LEVEL \$KUBELET_API_SERVER \$KUBELET_ADDRESS \$KUBELET_PORT \$KUBELET_HOSTNAME \$KUBELET_ARGS'
214214
ExecStop=-/usr/bin/podman stop kubelet
@@ -241,7 +241,7 @@ ExecStart=/bin/bash -c '/usr/bin/podman run --name kube-proxy \\
241241
--volume /sys/fs/cgroup/systemd:/sys/fs/cgroup/systemd \\
242242
--volume /lib/modules:/lib/modules:ro \\
243243
--volume /etc/pki/tls/certs:/usr/share/ca-certificates:ro \\
244-
\${CONTAINER_INFRA_PREFIX:-k8s.gcr.io/}hyperkube:\${KUBE_TAG} \\
244+
\${CONTAINER_INFRA_PREFIX:-\${HYPERKUBE_PREFIX}}hyperkube:\${KUBE_TAG} \\
245245
kube-proxy \\
246246
\$KUBE_LOGTOSTDERR \$KUBE_LOG_LEVEL \$KUBE_MASTER \$KUBE_PROXY_ARGS'
247247
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
@@ -106,7 +106,7 @@ ExecStart=/bin/bash -c '/usr/bin/podman run --name kubelet \\
106106
--volume /var/run/lock:/var/run/lock:z \\
107107
--volume /opt/cni/bin:/opt/cni/bin:z \\
108108
--volume /etc/machine-id:/etc/machine-id \\
109-
\${CONTAINER_INFRA_PREFIX:-k8s.gcr.io/}hyperkube:\${KUBE_TAG} \\
109+
\${CONTAINER_INFRA_PREFIX:-\${HYPERKUBE_PREFIX}}hyperkube:\${KUBE_TAG} \\
110110
kubelet \\
111111
\$KUBE_LOGTOSTDERR \$KUBE_LOG_LEVEL \$KUBELET_API_SERVER \$KUBELET_ADDRESS \$KUBELET_PORT \$KUBELET_HOSTNAME \$KUBELET_ARGS'
112112
ExecStop=-/usr/bin/podman stop kubelet
@@ -139,7 +139,7 @@ ExecStart=/bin/bash -c '/usr/bin/podman run --name kube-proxy \\
139139
--volume /sys/fs/cgroup/systemd:/sys/fs/cgroup/systemd \\
140140
--volume /lib/modules:/lib/modules:ro \\
141141
--volume /etc/pki/tls/certs:/usr/share/ca-certificates:ro \\
142-
\${CONTAINER_INFRA_PREFIX:-k8s.gcr.io/}hyperkube:\${KUBE_TAG} \\
142+
\${CONTAINER_INFRA_PREFIX:-\${HYPERKUBE_PREFIX}}hyperkube:\${KUBE_TAG} \\
143143
kube-proxy \\
144144
\$KUBE_LOGTOSTDERR \$KUBE_LOG_LEVEL \$KUBE_MASTER \$KUBE_PROXY_ARGS'
145145
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
@@ -68,6 +68,7 @@ REGION_NAME="$REGION_NAME"
6868
HTTP_PROXY="$HTTP_PROXY"
6969
HTTPS_PROXY="$HTTPS_PROXY"
7070
NO_PROXY="$NO_PROXY"
71+
HYPERKUBE_PREFIX="$HYPERKUBE_PREFIX"
7172
KUBE_TAG="$KUBE_TAG"
7273
CLOUD_PROVIDER_TAG="$CLOUD_PROVIDER_TAG"
7374
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
@@ -1183,6 +1188,7 @@ resources:
11831188
http_proxy: {get_param: http_proxy}
11841189
https_proxy: {get_param: https_proxy}
11851190
no_proxy: {get_param: no_proxy}
1191+
hyperkube_prefix: {get_param: hyperkube_prefix}
11861192
kube_tag: {get_param: master_kube_tag}
11871193
cloud_provider_tag: {get_param: cloud_provider_tag}
11881194
cloud_provider_enabled: {get_param: cloud_provider_enabled}
@@ -1411,6 +1417,7 @@ resources:
14111417
http_proxy: {get_param: http_proxy}
14121418
https_proxy: {get_param: https_proxy}
14131419
no_proxy: {get_param: no_proxy}
1420+
hyperkube_prefix: {get_param: hyperkube_prefix}
14141421
kube_tag: {get_param: minion_kube_tag}
14151422
kube_version: {get_param: kube_version}
14161423
trustee_user_id: {get_param: trustee_user_id}

0 commit comments

Comments
 (0)