Cleanup template formatting
This patch is meant to cleanup indentations in the templates, as well some other house keeping fixes. Closes-Bug: #1504685 Change-Id: I43f6cca8f449dea2db4de6a5308bfa5e4551838e
This commit is contained in:
parent
8f84055caf
commit
485d9a9018
|
@ -7,8 +7,8 @@ if [ "$HTTP_PROXY" != "" ]; then
|
||||||
[Service]
|
[Service]
|
||||||
Environment=HTTP_PROXY=$HTTP_PROXY
|
Environment=HTTP_PROXY=$HTTP_PROXY
|
||||||
EOF
|
EOF
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl --no-block restart docker.service
|
systemctl --no-block restart docker.service
|
||||||
if [ -f "/etc/bashrc" ]; then
|
if [ -f "/etc/bashrc" ]; then
|
||||||
cat >> /etc/bashrc <<EOF
|
cat >> /etc/bashrc <<EOF
|
||||||
declare -x http_proxy=$HTTP_PROXY
|
declare -x http_proxy=$HTTP_PROXY
|
||||||
|
@ -24,7 +24,7 @@ if [ "$HTTPS_PROXY" != "" ]; then
|
||||||
declare -x https_proxy=$HTTPS_PROXY
|
declare -x https_proxy=$HTTPS_PROXY
|
||||||
EOF
|
EOF
|
||||||
else
|
else
|
||||||
echo "File /etc/bashrc does not exists, not setting https_proxy"
|
echo "File /etc/bashrc does not exists, not setting https_proxy"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ EOF
|
||||||
cat>> /etc/bashrc <<EOF
|
cat>> /etc/bashrc <<EOF
|
||||||
declare -x no_proxy=$SWARM_MASTER_IP,$SWARM_NODE_IP
|
declare -x no_proxy=$SWARM_MASTER_IP,$SWARM_NODE_IP
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "File /etc/bashrc does not exists, not setting no_proxy"
|
echo "File /etc/bashrc does not exists, not setting no_proxy"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
echo starting services
|
echo "starting services"
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
for service in $NODE_SERVICES; do
|
for service in $NODE_SERVICES; do
|
||||||
echo "activating service $service"
|
echo "activating service $service"
|
||||||
systemctl enable $service
|
systemctl enable $service
|
||||||
systemctl --no-block start $service
|
systemctl --no-block start $service
|
||||||
done
|
done
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
echo removing docker key
|
echo "removing docker key"
|
||||||
rm -f /etc/docker/key.json
|
rm -f /etc/docker/key.json
|
||||||
|
|
|
@ -23,4 +23,3 @@ vgcreate docker $DOCKER_DEV
|
||||||
cat > /etc/sysconfig/docker-storage-setup <<EOF
|
cat > /etc/sysconfig/docker-storage-setup <<EOF
|
||||||
VG=docker
|
VG=docker
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
FLANNEL_JSON=/etc/sysconfig/flannel-network.json
|
FLANNEL_JSON=/etc/sysconfig/flannel-network.json
|
||||||
|
|
||||||
if [ "$FLANNEL_USE_VXLAN" == "true" ]; then
|
if [ "$FLANNEL_USE_VXLAN" == "true" ]; then
|
||||||
use_vxlan=1
|
use_vxlan=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Generate a flannel configuration that we will
|
# Generate a flannel configuration that we will
|
||||||
|
@ -18,7 +18,7 @@ cat > $FLANNEL_JSON <<EOF
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if [ "$use_vxlan" = 1 ]; then
|
if [ "$use_vxlan" = 1 ]; then
|
||||||
cat >> $FLANNEL_JSON <<EOF
|
cat >> $FLANNEL_JSON <<EOF
|
||||||
,
|
,
|
||||||
"Backend": {
|
"Backend": {
|
||||||
"Type": "vxlan"
|
"Type": "vxlan"
|
||||||
|
@ -32,8 +32,8 @@ EOF
|
||||||
|
|
||||||
# wait for etcd to become active (we will need it to push the flanneld config)
|
# wait for etcd to become active (we will need it to push the flanneld config)
|
||||||
while ! curl -sf -o /dev/null $FLANNEL_ETCD/v2/keys/; do
|
while ! curl -sf -o /dev/null $FLANNEL_ETCD/v2/keys/; do
|
||||||
echo "waiting for etcd"
|
echo "waiting for etcd"
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
|
||||||
# put the flannel config in etcd
|
# put the flannel config in etcd
|
||||||
|
@ -41,4 +41,3 @@ echo "creating flanneld config in etcd"
|
||||||
curl -sf -L $FLANNEL_ETCD/v2/keys/coreos.com/network/config \
|
curl -sf -L $FLANNEL_ETCD/v2/keys/coreos.com/network/config \
|
||||||
-X PUT \
|
-X PUT \
|
||||||
--data-urlencode value@/etc/sysconfig/flannel-network.json
|
--data-urlencode value@/etc/sysconfig/flannel-network.json
|
||||||
|
|
||||||
|
|
|
@ -13,14 +13,14 @@ sed -i '
|
||||||
|
|
||||||
KUBE_API_ARGS="--runtime_config=api/all=true"
|
KUBE_API_ARGS="--runtime_config=api/all=true"
|
||||||
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-port=8080"
|
KUBE_API_ADDRESS="$KUBE_API_ADDRESS --insecure-port=8080"
|
||||||
KUBE_API_ARGS="$KUBE_API_ARGS --tls_cert_file=/srv/kubernetes/server.crt"
|
KUBE_API_ARGS="$KUBE_API_ARGS --tls_cert_file=/srv/kubernetes/server.crt"
|
||||||
KUBE_API_ARGS="$KUBE_API_ARGS --tls_private_key_file=/srv/kubernetes/server.key"
|
KUBE_API_ARGS="$KUBE_API_ARGS --tls_private_key_file=/srv/kubernetes/server.key"
|
||||||
KUBE_API_ARGS="$KUBE_API_ARGS --client_ca_file=/srv/kubernetes/ca.crt"
|
KUBE_API_ARGS="$KUBE_API_ARGS --client_ca_file=/srv/kubernetes/ca.crt"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sed -i '
|
sed -i '
|
||||||
|
|
|
@ -15,26 +15,26 @@ fi
|
||||||
KUBE_MASTER_URI="$KUBE_PROTOCOL://$KUBE_MASTER_IP:$KUBE_API_PORT"
|
KUBE_MASTER_URI="$KUBE_PROTOCOL://$KUBE_MASTER_IP:$KUBE_API_PORT"
|
||||||
|
|
||||||
sed -i '
|
sed -i '
|
||||||
/^KUBE_ALLOW_PRIV=/ s/=.*/="--allow_privileged='"$KUBE_ALLOW_PRIV"'"/
|
/^KUBE_ALLOW_PRIV=/ s/=.*/="--allow_privileged='"$KUBE_ALLOW_PRIV"'"/
|
||||||
/^KUBE_ETCD_SERVERS=/ s|=.*|="--etcd_servers=http://'"$ETCD_SERVER_IP"':2379"|
|
/^KUBE_ETCD_SERVERS=/ s|=.*|="--etcd_servers=http://'"$ETCD_SERVER_IP"':2379"|
|
||||||
/^KUBE_MASTER=/ s|=.*|="--master='"$KUBE_MASTER_URI"'"|
|
/^KUBE_MASTER=/ s|=.*|="--master='"$KUBE_MASTER_URI"'"|
|
||||||
' /etc/kubernetes/config
|
' /etc/kubernetes/config
|
||||||
|
|
||||||
sed -i '
|
sed -i '
|
||||||
/^KUBELET_ADDRESS=/ s/=.*/="--address=0.0.0.0"/
|
/^KUBELET_ADDRESS=/ s/=.*/="--address=0.0.0.0"/
|
||||||
/^KUBELET_HOSTNAME=/ s/=.*/=""/
|
/^KUBELET_HOSTNAME=/ s/=.*/=""/
|
||||||
/^KUBELET_API_SERVER=/ s|=.*|="--api_servers='"$KUBE_MASTER_URI"'"|
|
/^KUBELET_API_SERVER=/ s|=.*|="--api_servers='"$KUBE_MASTER_URI"'"|
|
||||||
/^KUBELET_ARGS=/ s|=.*|='"$KUBE_CONFIG"'|
|
/^KUBELET_ARGS=/ s|=.*|='"$KUBE_CONFIG"'|
|
||||||
' /etc/kubernetes/kubelet
|
' /etc/kubernetes/kubelet
|
||||||
|
|
||||||
sed -i '
|
sed -i '
|
||||||
/^KUBE_PROXY_ARGS=/ s|=.*|='"$KUBE_CONFIG"'|
|
/^KUBE_PROXY_ARGS=/ s|=.*|='"$KUBE_CONFIG"'|
|
||||||
' /etc/kubernetes/proxy
|
' /etc/kubernetes/proxy
|
||||||
|
|
||||||
if [ "$NETWORK_DRIVER" == "flannel" ]; then
|
if [ "$NETWORK_DRIVER" == "flannel" ]; then
|
||||||
sed -i '
|
sed -i '
|
||||||
/^FLANNEL_ETCD=/ s|=.*|="http://'"$ETCD_SERVER_IP"':2379"|
|
/^FLANNEL_ETCD=/ s|=.*|="http://'"$ETCD_SERVER_IP"':2379"|
|
||||||
' /etc/sysconfig/flanneld
|
' /etc/sysconfig/flanneld
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cat >> /etc/environment <<EOF
|
cat >> /etc/environment <<EOF
|
||||||
|
|
|
@ -6,7 +6,7 @@ if [ "$REGISTRY_ENABLED" = "False" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo starting docker registry ...
|
echo "starting docker registry ..."
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl enable registry
|
systemctl enable registry
|
||||||
systemctl --no-block start registry
|
systemctl --no-block start registry
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
echo starting etcd
|
echo "starting etcd"
|
||||||
systemctl enable etcd
|
systemctl enable etcd
|
||||||
systemctl --no-block start etcd
|
systemctl --no-block start etcd
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,9 @@
|
||||||
# make sure we pick up any modified unit files
|
# make sure we pick up any modified unit files
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
|
|
||||||
echo starting services
|
echo "starting services"
|
||||||
for service in etcd kube-apiserver kube-scheduler kube-controller-manager; do
|
for service in etcd kube-apiserver kube-scheduler kube-controller-manager; do
|
||||||
echo "activating service $service"
|
echo "activating service $service"
|
||||||
systemctl enable $service
|
systemctl enable $service
|
||||||
systemctl --no-block start $service
|
systemctl --no-block start $service
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,4 +15,3 @@ for service in docker kubelet kube-proxy; do
|
||||||
systemctl enable $service
|
systemctl enable $service
|
||||||
systemctl --no-block start $service
|
systemctl --no-block start $service
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
@ -7,4 +7,3 @@ system_info:
|
||||||
groups: [wheel, adm, systemd-journal]
|
groups: [wheel, adm, systemd-journal]
|
||||||
sudo: ["ALL=(ALL) NOPASSWD:ALL"]
|
sudo: ["ALL=(ALL) NOPASSWD:ALL"]
|
||||||
shell: /bin/bash
|
shell: /bin/bash
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ set -o pipefail
|
||||||
. /etc/sysconfig/heat-params
|
. /etc/sysconfig/heat-params
|
||||||
|
|
||||||
if [ "$TLS_DISABLED" == "True" ]; then
|
if [ "$TLS_DISABLED" == "True" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cert_dir=/srv/kubernetes
|
cert_dir=/srv/kubernetes
|
||||||
|
@ -38,8 +38,8 @@ CLIENT_KEY=$cert_dir/client.key
|
||||||
|
|
||||||
# Get CA certificate for this bay
|
# Get CA certificate for this bay
|
||||||
curl -X GET \
|
curl -X GET \
|
||||||
-H "X-Auth-Token: $USER_TOKEN" \
|
-H "X-Auth-Token: $USER_TOKEN" \
|
||||||
$MAGNUM_URL/certificates/$BAY_UUID | python -c 'import sys, json; print json.load(sys.stdin)["pem"]' > $CA_CERT
|
$MAGNUM_URL/certificates/$BAY_UUID | python -c 'import sys, json; print json.load(sys.stdin)["pem"]' > $CA_CERT
|
||||||
|
|
||||||
# Create config for client's csr
|
# Create config for client's csr
|
||||||
cat > ${cert_conf_dir}/client.conf <<EOF
|
cat > ${cert_conf_dir}/client.conf <<EOF
|
||||||
|
@ -76,7 +76,7 @@ curl -X POST \
|
||||||
$MAGNUM_URL/certificates | python -c 'import sys, json; print json.load(sys.stdin)["pem"]' > ${CLIENT_CERT}
|
$MAGNUM_URL/certificates | python -c 'import sys, json; print json.load(sys.stdin)["pem"]' > ${CLIENT_CERT}
|
||||||
|
|
||||||
sed -i '
|
sed -i '
|
||||||
s|CA_CERT|'"$CA_CERT"'|
|
s|CA_CERT|'"$CA_CERT"'|
|
||||||
s|CLIENT_CERT|'"$CLIENT_CERT"'|
|
s|CLIENT_CERT|'"$CLIENT_CERT"'|
|
||||||
s|CLIENT_KEY|'"$CLIENT_KEY"'|
|
s|CLIENT_KEY|'"$CLIENT_KEY"'|
|
||||||
' /srv/kubernetes/kubeconfig.yaml
|
' /srv/kubernetes/kubeconfig.yaml
|
||||||
|
|
|
@ -45,8 +45,8 @@ SERVER_KEY=$cert_dir/server.key
|
||||||
|
|
||||||
# Get CA certificate for this bay
|
# Get CA certificate for this bay
|
||||||
curl -X GET \
|
curl -X GET \
|
||||||
-H "X-Auth-Token: $USER_TOKEN" \
|
-H "X-Auth-Token: $USER_TOKEN" \
|
||||||
$MAGNUM_URL/certificates/$BAY_UUID | python -c 'import sys, json; print json.load(sys.stdin)["pem"]' > ${CA_CERT}
|
$MAGNUM_URL/certificates/$BAY_UUID | python -c 'import sys, json; print json.load(sys.stdin)["pem"]' > ${CA_CERT}
|
||||||
|
|
||||||
# Create config for server's csr
|
# Create config for server's csr
|
||||||
cat > ${cert_conf_dir}/server.conf <<EOF
|
cat > ${cert_conf_dir}/server.conf <<EOF
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
. /etc/sysconfig/heat-params
|
. /etc/sysconfig/heat-params
|
||||||
|
|
||||||
if [ "$NETWORK_DRIVER" == "flannel" ]; then
|
if [ "$NETWORK_DRIVER" != "flannel" ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
. /etc/sysconfig/flanneld
|
. /etc/sysconfig/flanneld
|
||||||
|
|
||||||
|
@ -54,4 +56,3 @@ chmod 0644 $FLANNEL_CONFIG_SERVICE
|
||||||
|
|
||||||
systemctl enable flannel-config
|
systemctl enable flannel-config
|
||||||
systemctl start --no-block flannel-config
|
systemctl start --no-block flannel-config
|
||||||
fi # end if [ "$NETWORK_DRIVER" == "flannel" ]
|
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
. /etc/sysconfig/heat-params
|
. /etc/sysconfig/heat-params
|
||||||
|
|
||||||
if [ "$NETWORK_DRIVER" == "flannel" ]; then
|
if [ "$NETWORK_DRIVER" != "flannel" ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
FLANNEL_DOCKER_BRIDGE_BIN=/usr/local/bin/flannel-docker-bridge
|
FLANNEL_DOCKER_BRIDGE_BIN=/usr/local/bin/flannel-docker-bridge
|
||||||
FLANNEL_DOCKER_BRIDGE_SERVICE=/etc/systemd/system/flannel-docker-bridge.service
|
FLANNEL_DOCKER_BRIDGE_SERVICE=/etc/systemd/system/flannel-docker-bridge.service
|
||||||
|
@ -73,5 +75,3 @@ chmod 0644 $FLANNEL_DOCKER_BRIDGE_CONF
|
||||||
echo "activating service flanneld"
|
echo "activating service flanneld"
|
||||||
systemctl enable flanneld
|
systemctl enable flanneld
|
||||||
systemctl --no-block start flanneld
|
systemctl --no-block start flanneld
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
|
@ -19,4 +19,3 @@ monitor-delay=1m
|
||||||
monitor-timeout=30s
|
monitor-timeout=30s
|
||||||
monitor-max-retries=3
|
monitor-max-retries=3
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,10 @@
|
||||||
|
|
||||||
. /etc/sysconfig/heat-params
|
. /etc/sysconfig/heat-params
|
||||||
|
|
||||||
if [ "$NETWORK_DRIVER" == "flannel" ]; then
|
if [ "$NETWORK_DRIVER" != "flannel" ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
. /etc/sysconfig/flanneld
|
. /etc/sysconfig/flanneld
|
||||||
|
|
||||||
FLANNEL_JSON=/etc/sysconfig/flannel-network.json
|
FLANNEL_JSON=/etc/sysconfig/flannel-network.json
|
||||||
|
@ -12,11 +15,11 @@ FLANNEL_NETWORK_SUBNETLEN="$FLANNEL_NETWORK_SUBNETLEN"
|
||||||
FLANNEL_USE_VXLAN="$FLANNEL_USE_VXLAN"
|
FLANNEL_USE_VXLAN="$FLANNEL_USE_VXLAN"
|
||||||
|
|
||||||
sed -i '
|
sed -i '
|
||||||
/^FLANNEL_ETCD=/ s/=.*/="http:\/\/127.0.0.1:2379"/
|
/^FLANNEL_ETCD=/ s/=.*/="http:\/\/127.0.0.1:2379"/
|
||||||
' /etc/sysconfig/flanneld
|
' /etc/sysconfig/flanneld
|
||||||
|
|
||||||
if [ "$FLANNEL_USE_VXLAN" == "true" ]; then
|
if [ "$FLANNEL_USE_VXLAN" == "true" ]; then
|
||||||
use_vxlan=1
|
use_vxlan=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Generate a flannel configuration that we will
|
# Generate a flannel configuration that we will
|
||||||
|
@ -28,7 +31,7 @@ cat > $FLANNEL_JSON <<EOF
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if [ "$use_vxlan" = 1 ]; then
|
if [ "$use_vxlan" = 1 ]; then
|
||||||
cat >> $FLANNEL_JSON <<EOF
|
cat >> $FLANNEL_JSON <<EOF
|
||||||
,
|
,
|
||||||
"Backend": {
|
"Backend": {
|
||||||
"Type": "vxlan"
|
"Type": "vxlan"
|
||||||
|
@ -39,5 +42,3 @@ fi
|
||||||
cat >> $FLANNEL_JSON <<EOF
|
cat >> $FLANNEL_JSON <<EOF
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
|
@ -20,4 +20,6 @@ echo "$myip" > /etc/mesos-slave/ip
|
||||||
echo "docker,mesos" > /etc/mesos-slave/containerizers
|
echo "docker,mesos" > /etc/mesos-slave/containerizers
|
||||||
|
|
||||||
# Amount of time to wait for an executor to register
|
# Amount of time to wait for an executor to register
|
||||||
echo "$EXECUTOR_REGISTRATION_TIMEOUT" > /etc/mesos-slave/executor_registration_timeout
|
cat > /etc/mesos-slave/executor_registration_timeout <<EOF
|
||||||
|
$EXECUTOR_REGISTRATION_TIMEOUT
|
||||||
|
EOF
|
||||||
|
|
Loading…
Reference in New Issue