This PS also pins the remaining components of the kubelet, moves the K8s version to 1.6.4 and restores CentOS 7 operation. Change-Id: Ia32c9e02dbf9451c13addce436f6e36f5a0a622f
46 lines
1.7 KiB
Bash
Executable File
46 lines
1.7 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Copyright 2017 The Openstack-Helm Authors.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
set -xe
|
|
|
|
echo 'Checking cgroups'
|
|
if ls -dZ /sys/fs/cgroup | grep -q :svirt_sandbox_file_t: ; then
|
|
echo 'Invocation error: use -v /sys/fs/cgroup:/sys/fs/cgroup:ro parameter to docker run.'
|
|
exit 1
|
|
fi
|
|
|
|
echo 'Setting up K8s version to deploy'
|
|
: ${KUBE_VERSION:="default"}
|
|
sed -i "s|KUBE_VERSION=.*|KUBE_VERSION=${KUBE_VERSION}|g" /etc/kube-version
|
|
|
|
echo 'Setting up device to use for kube-api'
|
|
: ${KUBE_BIND_DEV:="autodetect"}
|
|
sed -i "s|KUBE_BIND_DEV=.*|KUBE_BIND_DEV=${KUBE_BIND_DEV}|g" /etc/kubeapi-device
|
|
|
|
echo 'Setting up container image to use for kubelet'
|
|
: ${KUBELET_CONTAINER:="this_one"}
|
|
sed -i "s|KUBELET_CONTAINER=.*|KUBELET_CONTAINER=${KUBELET_CONTAINER}|g" /etc/kubelet-container
|
|
|
|
echo 'Setting whether this node is a master, or slave, K8s node'
|
|
: ${KUBE_ROLE:="master"}
|
|
sed -i "s|KUBE_ROLE=.*|KUBE_ROLE=${KUBE_ROLE}|g" /etc/kube-role
|
|
|
|
echo 'Setting any kubeadm join commands'
|
|
: ${KUBEADM_JOIN_ARGS:="no_command_supplied"}
|
|
sed -i "s|KUBEADM_JOIN_ARGS=.*|KUBEADM_JOIN_ARGS=\"${KUBEADM_JOIN_ARGS}\"|g" /etc/kubeadm-join-command-args
|
|
|
|
echo 'Starting Systemd'
|
|
exec /bin/systemd --system
|