[k8s] Add heapster_enabled label
Story: 2004816 Task: 37654 Change-Id: Icd7f380d87672c00257e34df385d81e1c3e36ddf Signed-off-by: Diogo Guerra <dy090.guerra@gmail.com>
This commit is contained in:
parent
ef061ce86f
commit
1ad4a9d0a0
@ -306,6 +306,9 @@ the table are linked to more details elsewhere in the user guide.
|
|||||||
+---------------------------------------+--------------------+---------------+
|
+---------------------------------------+--------------------+---------------+
|
||||||
| `mesos_slave_executor_env_variables`_ | (file name) | "" |
|
| `mesos_slave_executor_env_variables`_ | (file name) | "" |
|
||||||
+---------------------------------------+--------------------+---------------+
|
+---------------------------------------+--------------------+---------------+
|
||||||
|
| `heapster_enabled`_ | - true | true |
|
||||||
|
| | - false | |
|
||||||
|
+---------------------------------------+--------------------+---------------+
|
||||||
| `monitoring_enabled`_ | - true | false |
|
| `monitoring_enabled`_ | - true | false |
|
||||||
| | - false | |
|
| | - false | |
|
||||||
+---------------------------------------+--------------------+---------------+
|
+---------------------------------------+--------------------+---------------+
|
||||||
@ -1190,6 +1193,11 @@ _`kube_tag`
|
|||||||
If unset, the current Magnum version's default Kubernetes release is
|
If unset, the current Magnum version's default Kubernetes release is
|
||||||
installed.
|
installed.
|
||||||
|
|
||||||
|
_`heapster_enabled`
|
||||||
|
heapster_enabled is used to enable disable the installation of heapster.
|
||||||
|
Ussuri default: true
|
||||||
|
Train default: true
|
||||||
|
|
||||||
_`cloud_provider_tag`
|
_`cloud_provider_tag`
|
||||||
This label allows users to select `a specific release for the openstack
|
This label allows users to select `a specific release for the openstack
|
||||||
cloud provider
|
cloud provider
|
||||||
|
@ -5,6 +5,12 @@ printf "Starting to run ${step}\n"
|
|||||||
|
|
||||||
. /etc/sysconfig/heat-params
|
. /etc/sysconfig/heat-params
|
||||||
|
|
||||||
|
echo "Waiting for Kubernetes API..."
|
||||||
|
until [ "ok" = "$(curl --silent http://127.0.0.1:8080/healthz)" ]
|
||||||
|
do
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
|
|
||||||
if [ "$(echo $KUBE_DASHBOARD_ENABLED | tr '[:upper:]' '[:lower:]')" == "true" ]; then
|
if [ "$(echo $KUBE_DASHBOARD_ENABLED | tr '[:upper:]' '[:lower:]')" == "true" ]; then
|
||||||
KUBE_DASH_IMAGE="${CONTAINER_INFRA_PREFIX:-gcr.io/google_containers/}kubernetes-dashboard-amd64:${KUBE_DASHBOARD_VERSION}"
|
KUBE_DASH_IMAGE="${CONTAINER_INFRA_PREFIX:-gcr.io/google_containers/}kubernetes-dashboard-amd64:${KUBE_DASHBOARD_VERSION}"
|
||||||
HEAPSTER_IMAGE="${CONTAINER_INFRA_PREFIX:-gcr.io/google_containers/}heapster-amd64:v1.4.2"
|
HEAPSTER_IMAGE="${CONTAINER_INFRA_PREFIX:-gcr.io/google_containers/}heapster-amd64:v1.4.2"
|
||||||
@ -335,23 +341,19 @@ spec:
|
|||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "Waiting for Kubernetes API..."
|
|
||||||
until [ "ok" = "$(curl --silent http://127.0.0.1:8080/healthz)" ]
|
|
||||||
do
|
|
||||||
sleep 5
|
|
||||||
done
|
|
||||||
|
|
||||||
kubectl apply --validate=false -f $INFLUX_DEPLOY
|
kubectl apply --validate=false -f $INFLUX_DEPLOY
|
||||||
kubectl apply --validate=false -f $GRAFANA_DEPLOY
|
kubectl apply --validate=false -f $GRAFANA_DEPLOY
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Deploy Heapster
|
# Deploy Heapster
|
||||||
HEAPSTER_DEPLOY=/srv/magnum/kubernetes/heapster-controller.yaml
|
if [ "$(echo ${HEAPSTER_ENABLED} | tr '[:upper:]' '[:lower:]')" = "true" ]; then
|
||||||
|
|
||||||
[ -f ${HEAPSTER_DEPLOY} ] || {
|
HEAPSTER_DEPLOY=/srv/magnum/kubernetes/heapster-controller.yaml
|
||||||
echo "Writing File: $HEAPSTER_DEPLOY"
|
|
||||||
mkdir -p $(dirname ${HEAPSTER_DEPLOY})
|
[ -f ${HEAPSTER_DEPLOY} ] || {
|
||||||
cat << EOF > ${HEAPSTER_DEPLOY}
|
echo "Writing File: $HEAPSTER_DEPLOY"
|
||||||
|
mkdir -p $(dirname ${HEAPSTER_DEPLOY})
|
||||||
|
cat << EOF > ${HEAPSTER_DEPLOY}
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
metadata:
|
metadata:
|
||||||
@ -450,16 +452,12 @@ subjects:
|
|||||||
name: heapster
|
name: heapster
|
||||||
namespace: kube-system
|
namespace: kube-system
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "Waiting for Kubernetes API..."
|
kubectl apply --validate=false -f $HEAPSTER_DEPLOY
|
||||||
until [ "ok" = "$(curl --silent http://127.0.0.1:8080/healthz)" ]
|
fi
|
||||||
do
|
|
||||||
sleep 5
|
|
||||||
done
|
|
||||||
|
|
||||||
kubectl apply --validate=false -f $KUBE_DASH_DEPLOY
|
kubectl apply --validate=false -f $KUBE_DASH_DEPLOY
|
||||||
kubectl apply --validate=false -f $HEAPSTER_DEPLOY
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "Finished running ${step}\n"
|
printf "Finished running ${step}\n"
|
||||||
|
@ -8,6 +8,7 @@ HEAT_PARAMS=/etc/sysconfig/heat-params
|
|||||||
mkdir -p "$(dirname ${HEAT_PARAMS})"
|
mkdir -p "$(dirname ${HEAT_PARAMS})"
|
||||||
cat > ${HEAT_PARAMS} <<EOF
|
cat > ${HEAT_PARAMS} <<EOF
|
||||||
INSTANCE_NAME="$INSTANCE_NAME"
|
INSTANCE_NAME="$INSTANCE_NAME"
|
||||||
|
HEAPSTER_ENABLED="$HEAPSTER_ENABLED"
|
||||||
PROMETHEUS_MONITORING="$PROMETHEUS_MONITORING"
|
PROMETHEUS_MONITORING="$PROMETHEUS_MONITORING"
|
||||||
KUBE_API_PUBLIC_ADDRESS="$KUBE_API_PUBLIC_ADDRESS"
|
KUBE_API_PUBLIC_ADDRESS="$KUBE_API_PUBLIC_ADDRESS"
|
||||||
KUBE_API_PRIVATE_ADDRESS="$KUBE_API_PRIVATE_ADDRESS"
|
KUBE_API_PRIVATE_ADDRESS="$KUBE_API_PRIVATE_ADDRESS"
|
||||||
|
@ -8,6 +8,7 @@ HEAT_PARAMS=/etc/sysconfig/heat-params
|
|||||||
mkdir -p "$(dirname ${HEAT_PARAMS})"
|
mkdir -p "$(dirname ${HEAT_PARAMS})"
|
||||||
cat > ${HEAT_PARAMS} <<EOF
|
cat > ${HEAT_PARAMS} <<EOF
|
||||||
INSTANCE_NAME="$INSTANCE_NAME"
|
INSTANCE_NAME="$INSTANCE_NAME"
|
||||||
|
HEAPSTER_ENABLED="$HEAPSTER_ENABLED"
|
||||||
PROMETHEUS_MONITORING="$PROMETHEUS_MONITORING"
|
PROMETHEUS_MONITORING="$PROMETHEUS_MONITORING"
|
||||||
KUBE_ALLOW_PRIV="$KUBE_ALLOW_PRIV"
|
KUBE_ALLOW_PRIV="$KUBE_ALLOW_PRIV"
|
||||||
KUBE_MASTER_IP="$KUBE_MASTER_IP"
|
KUBE_MASTER_IP="$KUBE_MASTER_IP"
|
||||||
|
@ -85,6 +85,7 @@ class K8sFedoraTemplateDefinition(k8s_template_def.K8sTemplateDefinition):
|
|||||||
'prometheus_tag', 'grafana_tag',
|
'prometheus_tag', 'grafana_tag',
|
||||||
'heat_container_agent_tag',
|
'heat_container_agent_tag',
|
||||||
'keystone_auth_enabled', 'k8s_keystone_auth_tag',
|
'keystone_auth_enabled', 'k8s_keystone_auth_tag',
|
||||||
|
'heapster_enabled',
|
||||||
'monitoring_enabled',
|
'monitoring_enabled',
|
||||||
'prometheus_operator_chart_tag',
|
'prometheus_operator_chart_tag',
|
||||||
'tiller_enabled',
|
'tiller_enabled',
|
||||||
|
@ -117,6 +117,11 @@ parameters:
|
|||||||
default: ""
|
default: ""
|
||||||
description: the name of the nodegroup where the node belongs
|
description: the name of the nodegroup where the node belongs
|
||||||
|
|
||||||
|
heapster_enabled:
|
||||||
|
type: boolean
|
||||||
|
description: enable/disable the use of heapster
|
||||||
|
default: true
|
||||||
|
|
||||||
minion_flavor:
|
minion_flavor:
|
||||||
type: string
|
type: string
|
||||||
default: m1.small
|
default: m1.small
|
||||||
@ -984,6 +989,7 @@ resources:
|
|||||||
- [{ get_param: 'OS::stack_name' }, 'master', '%index%']
|
- [{ get_param: 'OS::stack_name' }, 'master', '%index%']
|
||||||
nodegroup_role: {get_param: master_role}
|
nodegroup_role: {get_param: master_role}
|
||||||
nodegroup_name: {get_param: master_nodegroup_name}
|
nodegroup_name: {get_param: master_nodegroup_name}
|
||||||
|
heapster_enabled: {get_param: heapster_enabled}
|
||||||
prometheus_monitoring: {get_param: prometheus_monitoring}
|
prometheus_monitoring: {get_param: prometheus_monitoring}
|
||||||
grafana_admin_passwd: {get_param: grafana_admin_passwd}
|
grafana_admin_passwd: {get_param: grafana_admin_passwd}
|
||||||
api_public_address: {get_attr: [api_lb, floating_address]}
|
api_public_address: {get_attr: [api_lb, floating_address]}
|
||||||
|
@ -27,6 +27,10 @@ parameters:
|
|||||||
type: string
|
type: string
|
||||||
description: the name of the nodegroup where the node belongs
|
description: the name of the nodegroup where the node belongs
|
||||||
|
|
||||||
|
heapster_enabled:
|
||||||
|
type: boolean
|
||||||
|
description: enable/disable the use of heapster
|
||||||
|
|
||||||
ssh_key_name:
|
ssh_key_name:
|
||||||
type: string
|
type: string
|
||||||
description: name of ssh key to be provisioned on our server
|
description: name of ssh key to be provisioned on our server
|
||||||
@ -610,6 +614,7 @@ resources:
|
|||||||
template: {get_file: ../../common/templates/kubernetes/fragments/write-heat-params-master.sh}
|
template: {get_file: ../../common/templates/kubernetes/fragments/write-heat-params-master.sh}
|
||||||
params:
|
params:
|
||||||
"$INSTANCE_NAME": {get_param: name}
|
"$INSTANCE_NAME": {get_param: name}
|
||||||
|
"$HEAPSTER_ENABLED": {get_param: heapster_enabled}
|
||||||
"$PROMETHEUS_MONITORING": {get_param: prometheus_monitoring}
|
"$PROMETHEUS_MONITORING": {get_param: prometheus_monitoring}
|
||||||
"$KUBE_API_PUBLIC_ADDRESS": {get_attr: [api_address_switch, public_ip]}
|
"$KUBE_API_PUBLIC_ADDRESS": {get_attr: [api_address_switch, public_ip]}
|
||||||
"$KUBE_API_PRIVATE_ADDRESS": {get_attr: [api_address_switch, private_ip]}
|
"$KUBE_API_PRIVATE_ADDRESS": {get_attr: [api_address_switch, private_ip]}
|
||||||
|
@ -117,6 +117,11 @@ parameters:
|
|||||||
default: ""
|
default: ""
|
||||||
description: the name of the nodegroup where the node belongs
|
description: the name of the nodegroup where the node belongs
|
||||||
|
|
||||||
|
heapster_enabled:
|
||||||
|
type: boolean
|
||||||
|
description: enable/disable the use of heapster
|
||||||
|
default: true
|
||||||
|
|
||||||
minion_flavor:
|
minion_flavor:
|
||||||
type: string
|
type: string
|
||||||
default: m1.small
|
default: m1.small
|
||||||
@ -986,6 +991,7 @@ resources:
|
|||||||
- [{ get_param: 'OS::stack_name' }, 'master', '%index%']
|
- [{ get_param: 'OS::stack_name' }, 'master', '%index%']
|
||||||
nodegroup_role: {get_param: master_role}
|
nodegroup_role: {get_param: master_role}
|
||||||
nodegroup_name: {get_param: master_nodegroup_name}
|
nodegroup_name: {get_param: master_nodegroup_name}
|
||||||
|
heapster_enabled: {get_param: heapster_enabled}
|
||||||
prometheus_monitoring: {get_param: prometheus_monitoring}
|
prometheus_monitoring: {get_param: prometheus_monitoring}
|
||||||
grafana_admin_passwd: {get_param: grafana_admin_passwd}
|
grafana_admin_passwd: {get_param: grafana_admin_passwd}
|
||||||
api_public_address: {get_attr: [api_lb, floating_address]}
|
api_public_address: {get_attr: [api_lb, floating_address]}
|
||||||
|
@ -27,6 +27,10 @@ parameters:
|
|||||||
type: string
|
type: string
|
||||||
description: the name of the nodegroup where the node belongs
|
description: the name of the nodegroup where the node belongs
|
||||||
|
|
||||||
|
heapster_enabled:
|
||||||
|
type: boolean
|
||||||
|
description: enable/disable the use of heapster
|
||||||
|
|
||||||
ssh_key_name:
|
ssh_key_name:
|
||||||
type: string
|
type: string
|
||||||
description: name of ssh key to be provisioned on our server
|
description: name of ssh key to be provisioned on our server
|
||||||
@ -616,6 +620,7 @@ resources:
|
|||||||
template: {get_file: ../../common/templates/kubernetes/fragments/write-heat-params-master.sh}
|
template: {get_file: ../../common/templates/kubernetes/fragments/write-heat-params-master.sh}
|
||||||
params:
|
params:
|
||||||
"$INSTANCE_NAME": {get_param: name}
|
"$INSTANCE_NAME": {get_param: name}
|
||||||
|
"$HEAPSTER_ENABLED": {get_param: heapster_enabled}
|
||||||
"$PROMETHEUS_MONITORING": {get_param: prometheus_monitoring}
|
"$PROMETHEUS_MONITORING": {get_param: prometheus_monitoring}
|
||||||
"$KUBE_API_PUBLIC_ADDRESS": {get_attr: [api_address_switch, public_ip]}
|
"$KUBE_API_PUBLIC_ADDRESS": {get_attr: [api_address_switch, public_ip]}
|
||||||
"$KUBE_API_PRIVATE_ADDRESS": {get_attr: [api_address_switch, private_ip]}
|
"$KUBE_API_PRIVATE_ADDRESS": {get_attr: [api_address_switch, private_ip]}
|
||||||
|
@ -464,6 +464,8 @@ class AtomicK8sTemplateDefinitionTestCase(BaseK8sTemplateDefinitionTestCase):
|
|||||||
flannel_subnet = mock_cluster.labels.get(
|
flannel_subnet = mock_cluster.labels.get(
|
||||||
'flannel_network_subnetlen')
|
'flannel_network_subnetlen')
|
||||||
flannel_backend = mock_cluster.labels.get('flannel_backend')
|
flannel_backend = mock_cluster.labels.get('flannel_backend')
|
||||||
|
heapster_enabled = mock_cluster.labels.get(
|
||||||
|
'heapster_enabled')
|
||||||
system_pods_initial_delay = mock_cluster.labels.get(
|
system_pods_initial_delay = mock_cluster.labels.get(
|
||||||
'system_pods_initial_delay')
|
'system_pods_initial_delay')
|
||||||
system_pods_timeout = mock_cluster.labels.get(
|
system_pods_timeout = mock_cluster.labels.get(
|
||||||
@ -585,6 +587,7 @@ class AtomicK8sTemplateDefinitionTestCase(BaseK8sTemplateDefinitionTestCase):
|
|||||||
'flannel_network_cidr': flannel_cidr,
|
'flannel_network_cidr': flannel_cidr,
|
||||||
'flannel_network_subnetlen': flannel_subnet,
|
'flannel_network_subnetlen': flannel_subnet,
|
||||||
'flannel_backend': flannel_backend,
|
'flannel_backend': flannel_backend,
|
||||||
|
'heapster_enabled': heapster_enabled,
|
||||||
'system_pods_initial_delay': system_pods_initial_delay,
|
'system_pods_initial_delay': system_pods_initial_delay,
|
||||||
'system_pods_timeout': system_pods_timeout,
|
'system_pods_timeout': system_pods_timeout,
|
||||||
'admission_control_list': admission_control_list,
|
'admission_control_list': admission_control_list,
|
||||||
@ -910,6 +913,8 @@ class AtomicK8sTemplateDefinitionTestCase(BaseK8sTemplateDefinitionTestCase):
|
|||||||
flannel_subnet = mock_cluster.labels.get(
|
flannel_subnet = mock_cluster.labels.get(
|
||||||
'flannel_network_subnetlen')
|
'flannel_network_subnetlen')
|
||||||
flannel_backend = mock_cluster.labels.get('flannel_backend')
|
flannel_backend = mock_cluster.labels.get('flannel_backend')
|
||||||
|
heapster_enabled = mock_cluster.labels.get(
|
||||||
|
'heapster_enabled')
|
||||||
system_pods_initial_delay = mock_cluster.labels.get(
|
system_pods_initial_delay = mock_cluster.labels.get(
|
||||||
'system_pods_initial_delay')
|
'system_pods_initial_delay')
|
||||||
system_pods_timeout = mock_cluster.labels.get(
|
system_pods_timeout = mock_cluster.labels.get(
|
||||||
@ -1031,6 +1036,7 @@ class AtomicK8sTemplateDefinitionTestCase(BaseK8sTemplateDefinitionTestCase):
|
|||||||
'flannel_network_cidr': flannel_cidr,
|
'flannel_network_cidr': flannel_cidr,
|
||||||
'flannel_network_subnetlen': flannel_subnet,
|
'flannel_network_subnetlen': flannel_subnet,
|
||||||
'flannel_backend': flannel_backend,
|
'flannel_backend': flannel_backend,
|
||||||
|
'heapster_enabled': heapster_enabled,
|
||||||
'system_pods_initial_delay': system_pods_initial_delay,
|
'system_pods_initial_delay': system_pods_initial_delay,
|
||||||
'system_pods_timeout': system_pods_timeout,
|
'system_pods_timeout': system_pods_timeout,
|
||||||
'fixed_network_name': fixed_network_name,
|
'fixed_network_name': fixed_network_name,
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Added label heapster_enabled to control heapster installation in the
|
||||||
|
cluster.
|
Loading…
Reference in New Issue
Block a user