"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "magnum/drivers/common/templates/kubernetes/fragments/configure-kubernetes-master.sh" between
magnum-8.1.0.tar.gz and magnum-8.2.0.tar.gz

About: OpenStack Magnum makes container orchestration engines such as Docker and Kubernetes available as first class resources in OpenStack.
The "Stein" series (maintained release).

configure-kubernetes-master.sh  (magnum-8.1.0):configure-kubernetes-master.sh  (magnum-8.2.0)
skipping to change at line 29 skipping to change at line 29
_prefix=${CONTAINER_INFRA_PREFIX:-docker.io/openstackmagnum/} _prefix=${CONTAINER_INFRA_PREFIX:-docker.io/openstackmagnum/}
rm -rf /etc/cni/net.d/* rm -rf /etc/cni/net.d/*
rm -rf /var/lib/cni/* rm -rf /var/lib/cni/*
rm -rf /opt/cni/* rm -rf /opt/cni/*
mkdir -p /opt/cni mkdir -p /opt/cni
mkdir -p /etc/cni/net.d/ mkdir -p /etc/cni/net.d/
_addtl_mounts=',{"type":"bind","source":"/opt/cni","destination":"/opt/cni","opt ions":["bind","rw","slave","mode=777"]},{"type":"bind","source":"/var/lib/docker ","destination":"/var/lib/docker","options":["bind","rw","slave","mode=755"]}' _addtl_mounts=',{"type":"bind","source":"/opt/cni","destination":"/opt/cni","opt ions":["bind","rw","slave","mode=777"]},{"type":"bind","source":"/var/lib/docker ","destination":"/var/lib/docker","options":["bind","rw","slave","mode=755"]}'
if [ "$NETWORK_DRIVER" = "calico" ]; then if [ "$NETWORK_DRIVER" = "calico" ]; then
echo "net.ipv4.conf.all.rp_filter = 1" >> /etc/sysctl.conf
sysctl -p
if [ "`systemctl status NetworkManager.service | grep -o "Active: active"`" = "Active: active" ]; then if [ "`systemctl status NetworkManager.service | grep -o "Active: active"`" = "Active: active" ]; then
CALICO_NM=/etc/NetworkManager/conf.d/calico.conf CALICO_NM=/etc/NetworkManager/conf.d/calico.conf
[ -f ${CALICO_NM} ] || { [ -f ${CALICO_NM} ] || {
echo "Writing File: $CALICO_NM" echo "Writing File: $CALICO_NM"
mkdir -p $(dirname ${CALICO_NM}) mkdir -p $(dirname ${CALICO_NM})
cat << EOF > ${CALICO_NM} cat << EOF > ${CALICO_NM}
[keyfile] [keyfile]
unmanaged-devices=interface-name:cali*;interface-name:tunl* unmanaged-devices=interface-name:cali*;interface-name:tunl*
EOF EOF
} }
systemctl restart NetworkManager systemctl restart NetworkManager
echo "net.ipv4.conf.all.rp_filter = 1" >> /etc/sysctl.conf
sysctl -p
fi fi
fi fi
atomic install --storage ostree --system --set=ADDTL_MOUNTS=${_addtl_mounts} --s ystem-package=no --name=kubelet ${_prefix}kubernetes-kubelet:${KUBE_TAG} atomic install --storage ostree --system --set=ADDTL_MOUNTS=${_addtl_mounts} --s ystem-package=no --name=kubelet ${_prefix}kubernetes-kubelet:${KUBE_TAG}
atomic install --storage ostree --system --system-package=no --name=kube-apiserv er ${_prefix}kubernetes-apiserver:${KUBE_TAG} atomic install --storage ostree --system --system-package=no --name=kube-apiserv er ${_prefix}kubernetes-apiserver:${KUBE_TAG}
atomic install --storage ostree --system --system-package=no --name=kube-control ler-manager ${_prefix}kubernetes-controller-manager:${KUBE_TAG} atomic install --storage ostree --system --system-package=no --name=kube-control ler-manager ${_prefix}kubernetes-controller-manager:${KUBE_TAG}
atomic install --storage ostree --system --system-package=no --name=kube-schedul er ${_prefix}kubernetes-scheduler:${KUBE_TAG} atomic install --storage ostree --system --system-package=no --name=kube-schedul er ${_prefix}kubernetes-scheduler:${KUBE_TAG}
atomic install --storage ostree --system --system-package=no --name=kube-proxy $ {_prefix}kubernetes-proxy:${KUBE_TAG} atomic install --storage ostree --system --system-package=no --name=kube-proxy $ {_prefix}kubernetes-proxy:${KUBE_TAG}
CERT_DIR=/etc/kubernetes/certs CERT_DIR=/etc/kubernetes/certs
skipping to change at line 86 skipping to change at line 86
user: user:
as-user-extra: {} as-user-extra: {}
EOF EOF
sed -i ' sed -i '
/^KUBE_ALLOW_PRIV=/ s/=.*/="--allow-privileged='"$KUBE_ALLOW_PRIV"'"/ /^KUBE_ALLOW_PRIV=/ s/=.*/="--allow-privileged='"$KUBE_ALLOW_PRIV"'"/
/^KUBE_MASTER=/ s|=.*|="--master=http://127.0.0.1:8080"| /^KUBE_MASTER=/ s|=.*|="--master=http://127.0.0.1:8080"|
' /etc/kubernetes/config ' /etc/kubernetes/config
KUBE_API_ARGS="--runtime-config=api/all=true" KUBE_API_ARGS="--runtime-config=api/all=true"
KUBE_API_ARGS="$KUBE_API_ARGS --allow-privileged=$KUBE_ALLOW_PRIV"
KUBE_API_ARGS="$KUBE_API_ARGS --kubelet-preferred-address-types=InternalIP,Hostn ame,ExternalIP" KUBE_API_ARGS="$KUBE_API_ARGS --kubelet-preferred-address-types=InternalIP,Hostn ame,ExternalIP"
KUBE_API_ARGS="$KUBE_API_ARGS $KUBEAPI_OPTIONS" KUBE_API_ARGS="$KUBE_API_ARGS $KUBEAPI_OPTIONS"
if [ "$TLS_DISABLED" == "True" ]; then if [ "$TLS_DISABLED" == "True" ]; then
KUBE_API_ADDRESS="--insecure-bind-address=0.0.0.0 --insecure-port=$KUBE_API_ PORT" KUBE_API_ADDRESS="--insecure-bind-address=0.0.0.0 --insecure-port=$KUBE_API_ PORT"
else else
KUBE_API_ADDRESS="--bind-address=0.0.0.0 --secure-port=$KUBE_API_PORT" KUBE_API_ADDRESS="--bind-address=0.0.0.0 --secure-port=$KUBE_API_PORT"
# insecure port is used internaly # insecure port is used internaly
KUBE_API_ADDRESS="$KUBE_API_ADDRESS --insecure-bind-address=127.0.0.1 --inse cure-port=8080" KUBE_API_ADDRESS="$KUBE_API_ADDRESS --insecure-bind-address=127.0.0.1 --inse cure-port=8080"
KUBE_API_ARGS="$KUBE_API_ARGS --authorization-mode=Node,RBAC --tls-cert-file =$CERT_DIR/server.crt" KUBE_API_ARGS="$KUBE_API_ARGS --authorization-mode=Node,RBAC --tls-cert-file =$CERT_DIR/server.crt"
KUBE_API_ARGS="$KUBE_API_ARGS --tls-private-key-file=$CERT_DIR/server.key" KUBE_API_ARGS="$KUBE_API_ARGS --tls-private-key-file=$CERT_DIR/server.key"
skipping to change at line 185 skipping to change at line 186
fi fi
sed -i ' sed -i '
/^KUBELET_ADDRESSES=/ s/=.*/="--machines='""'"/ /^KUBELET_ADDRESSES=/ s/=.*/="--machines='""'"/
/^KUBE_CONTROLLER_MANAGER_ARGS=/ s#\(KUBE_CONTROLLER_MANAGER_ARGS\).*#\1="'" ${KUBE_CONTROLLER_MANAGER_ARGS}"'"# /^KUBE_CONTROLLER_MANAGER_ARGS=/ s#\(KUBE_CONTROLLER_MANAGER_ARGS\).*#\1="'" ${KUBE_CONTROLLER_MANAGER_ARGS}"'"#
' /etc/kubernetes/controller-manager ' /etc/kubernetes/controller-manager
sed -i '/^KUBE_SCHEDULER_ARGS=/ s/=.*/="--leader-elect=true"/' /etc/kubernetes/s cheduler sed -i '/^KUBE_SCHEDULER_ARGS=/ s/=.*/="--leader-elect=true"/' /etc/kubernetes/s cheduler
mkdir -p /etc/kubernetes/manifests mkdir -p /etc/kubernetes/manifests
HOSTNAME_OVERRIDE=$(hostname --short | sed 's/\.novalocal//') KUBELET_ARGS="--register-node=true --pod-manifest-path=/etc/kubernetes/manifests
KUBELET_ARGS="--register-node=true --pod-manifest-path=/etc/kubernetes/manifests --cadvisor-port=0 --hostname-override=${INSTANCE_NAME}"
--cadvisor-port=0 --hostname-override=${HOSTNAME_OVERRIDE}"
KUBELET_ARGS="${KUBELET_ARGS} --pod-infra-container-image=${CONTAINER_INFRA_PREF IX:-gcr.io/google_containers/}pause:3.0" KUBELET_ARGS="${KUBELET_ARGS} --pod-infra-container-image=${CONTAINER_INFRA_PREF IX:-gcr.io/google_containers/}pause:3.0"
KUBELET_ARGS="${KUBELET_ARGS} --cluster_dns=${DNS_SERVICE_IP} --cluster_domain=$ {DNS_CLUSTER_DOMAIN}" KUBELET_ARGS="${KUBELET_ARGS} --cluster_dns=${DNS_SERVICE_IP} --cluster_domain=$ {DNS_CLUSTER_DOMAIN}"
KUBELET_ARGS="${KUBELET_ARGS} --volume-plugin-dir=/var/lib/kubelet/volumeplugins " KUBELET_ARGS="${KUBELET_ARGS} --volume-plugin-dir=/var/lib/kubelet/volumeplugins "
KUBELET_ARGS="${KUBELET_ARGS} ${KUBELET_OPTIONS}" KUBELET_ARGS="${KUBELET_ARGS} ${KUBELET_OPTIONS}"
if [ "$(echo "${CLOUD_PROVIDER_ENABLED}" | tr '[:upper:]' '[:lower:]')" = "true" ]; then if [ "$(echo "${CLOUD_PROVIDER_ENABLED}" | tr '[:upper:]' '[:lower:]')" = "true" ]; then
KUBELET_ARGS="${KUBELET_ARGS} --cloud-provider=external" KUBELET_ARGS="${KUBELET_ARGS} --cloud-provider=external"
fi fi
# For using default log-driver, other options should be ignored # For using default log-driver, other options should be ignored
sed -i 's/\-\-log\-driver\=journald//g' /etc/sysconfig/docker sed -i 's/\-\-log\-driver\=journald//g' /etc/sysconfig/docker
if [ -n "${INSECURE_REGISTRY_URL}" ]; then if [ -n "${INSECURE_REGISTRY_URL}" ]; then
echo "INSECURE_REGISTRY='--insecure-registry ${INSECURE_REGISTRY_URL}'" >> / etc/sysconfig/docker echo "INSECURE_REGISTRY='--insecure-registry ${INSECURE_REGISTRY_URL}'" >> / etc/sysconfig/docker
fi fi
KUBELET_ARGS="${KUBELET_ARGS} --network-plugin=cni --cni-conf-dir=/etc/cni/net.d --cni-bin-dir=/opt/cni/bin" KUBELET_ARGS="${KUBELET_ARGS} --network-plugin=cni --cni-conf-dir=/etc/cni/net.d --cni-bin-dir=/opt/cni/bin"
KUBELET_ARGS="${KUBELET_ARGS} --register-with-taints=CriticalAddonsOnly=True:NoS chedule,dedicated=master:NoSchedule" KUBELET_ARGS="${KUBELET_ARGS} --register-with-taints=CriticalAddonsOnly=True:NoS chedule,dedicated=master:NoSchedule"
KUBELET_ARGS="${KUBELET_ARGS} --node-labels=node-role.kubernetes.io/master=\"\""
KUBELET_KUBECONFIG=/etc/kubernetes/kubelet-config.yaml KUBELET_KUBECONFIG=/etc/kubernetes/kubelet-config.yaml
HOSTNAME_OVERRIDE=$(hostname --short | sed 's/\.novalocal//')
cat << EOF >> ${KUBELET_KUBECONFIG} cat << EOF >> ${KUBELET_KUBECONFIG}
apiVersion: v1 apiVersion: v1
clusters: clusters:
- cluster: - cluster:
certificate-authority: ${CERT_DIR}/ca.crt certificate-authority: ${CERT_DIR}/ca.crt
server: http://127.0.0.1:8080 server: http://127.0.0.1:8080
name: kubernetes name: kubernetes
contexts: contexts:
- context: - context:
cluster: kubernetes cluster: kubernetes
user: system:node:${HOSTNAME_OVERRIDE} user: system:node:${INSTANCE_NAME}
name: default name: default
current-context: default current-context: default
kind: Config kind: Config
preferences: {} preferences: {}
users: users:
- name: system:node:${HOSTNAME_OVERRIDE} - name: system:node:${INSTANCE_NAME}
user: user:
as-user-extra: {} as-user-extra: {}
client-certificate: ${CERT_DIR}/server.crt client-certificate: ${CERT_DIR}/server.crt
client-key: ${CERT_DIR}/server.key client-key: ${CERT_DIR}/server.key
EOF EOF
cat > /etc/kubernetes/get_require_kubeconfig.sh << EOF cat > /etc/kubernetes/get_require_kubeconfig.sh << EOF
#!/bin/bash #!/bin/bash
KUBE_VERSION=\$(kubelet --version | awk '{print \$2}') KUBE_VERSION=\$(kubelet --version | awk '{print \$2}')
 End of changes. 8 change blocks. 
9 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)