#!/bin/sh

. /etc/sysconfig/heat-params

echo "configuring kubernetes (master)"

sed -i '
  /^KUBE_ALLOW_PRIV=/ s/=.*/="--allow_privileged='"$KUBE_ALLOW_PRIV"'"/
' /etc/kubernetes/config

sed -i '
  /^KUBE_API_ADDRESS=/ s/=.*/="--address=0.0.0.0"/
  /^KUBE_SERVICE_ADDRESSES=/ s|=.*|="--portal_net='"$PORTAL_NETWORK_CIDR"'"|
  /^KUBE_API_ARGS=/ s/=.*/="--runtime_config=api\/v1beta3"/
' /etc/kubernetes/apiserver

sed -i '
  /^KUBELET_ADDRESSES=/ s/=.*/="--machines='""'"/
' /etc/kubernetes/controller-manager


#!/bin/sh

. /etc/sysconfig/heat-params

echo "configuring kubernetes (master)"
sed -i '
  /^ETCD_LISTEN_CLIENT_URLS=/ s/=.*/="http:\/\/0.0.0.0:4001"/
' /etc/etcd/etcd.conf

sed -i '
  /^KUBE_ALLOW_PRIV=/ s/=.*/="--allow_privileged='"$KUBE_ALLOW_PRIV"'"/
' /etc/kubernetes/config

sed -i '
  /^KUBE_API_ADDRESS=/ s/=.*/="--address=0.0.0.0"/
  /^KUBE_SERVICE_ADDRESSES=/ s|=.*|="--portal_net='"$PORTAL_NETWORK_CIDR"'"|
  /^KUBE_API_ARGS=/ s/=.*/="--runtime_config=api\/v1beta3"/
' /etc/kubernetes/apiserver

sed -i '
  /^KUBELET_ADDRESSES=/ s/=.*/="--machines='""'"/
' /etc/kubernetes/controller-manager


Add etcd 2.0 config file support
Add etcd 2.0 config file support

Update kubernetes version to 0.15.  Kubernetes 0.15 introduces
etcd 2.0 instead of 1.y series.  The 2.0 series has a separate
configuration file in /etc/etcd/etcd.conf.  This configuration
file specifies an IP address on which to listen for ETCD requests.

Co-Authored-By: Andrew Melton <andrew.melton@rackspace.com>

Change-Id: Ifd231dd2d78ab14d7af4d013840f25630b10d469
Partially-implements: blueprint python-k8sclient
