diff --git a/contrib/drivers/k8s_opensuse_v1/templates/fragments/add-proxy.sh b/contrib/drivers/k8s_opensuse_v1/templates/fragments/add-proxy.sh new file mode 100644 index 0000000000..002096dacb --- /dev/null +++ b/contrib/drivers/k8s_opensuse_v1/templates/fragments/add-proxy.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +. /etc/sysconfig/heat-params + +DOCKER_PROXY_CONF=/etc/systemd/system/docker.service.d/proxy.conf +BASH_RC=/etc/bashrc + +mkdir -p /etc/systemd/system/docker.service.d + +if [ -n "$HTTP_PROXY" ]; then + cat < $DOCKER_PROXY_CONF + [Service] + Environment=HTTP_PROXY=$HTTP_PROXY +EOF + + systemctl daemon-reload + systemctl --no-block restart docker.service + + if [ -f "$BASH_RC" ]; then + echo "declare -x http_proxy=$HTTP_PROXY" >> $BASH_RC + else + echo "File $BASH_RC does not exist, not setting http_proxy" + fi +fi + +if [ -n "$HTTPS_PROXY" ]; then + if [ -f "$BASH_RC" ]; then + echo "declare -x https_proxy=$HTTPS_PROXY" >> $BASH_RC + else + echo "File $BASH_RC does not exist, not setting https_proxy" + fi +fi + +if [ -n "$NO_PROXY" ]; then + if [ -f "$BASH_RC" ]; then + echo "declare -x no_proxy=$NO_PROXY" >> $BASH_RC + else + echo "File $BASH_RC does not exist, not setting no_proxy" + fi +fi diff --git a/contrib/drivers/k8s_opensuse_v1/templates/kubecluster.yaml b/contrib/drivers/k8s_opensuse_v1/templates/kubecluster.yaml index 735179830a..cd6c029449 100644 --- a/contrib/drivers/k8s_opensuse_v1/templates/kubecluster.yaml +++ b/contrib/drivers/k8s_opensuse_v1/templates/kubecluster.yaml @@ -229,6 +229,21 @@ parameters: type: string description: endpoint to retrieve TLS certs from + http_proxy: + type: string + description: http proxy address for docker + default: "" + + https_proxy: + type: string + description: https proxy address for docker + default: "" + + no_proxy: + type: string + description: no proxies for docker + default: "" + trustee_domain_id: type: string description: domain id of the trustee @@ -414,6 +429,9 @@ resources: discovery_url: {get_param: discovery_url} cluster_uuid: {get_param: cluster_uuid} magnum_url: {get_param: magnum_url} + http_proxy: {get_param: http_proxy} + https_proxy: {get_param: https_proxy} + no_proxy: {get_param: no_proxy} fixed_network: {get_resource: fixed_network} fixed_subnet: {get_resource: fixed_subnet} api_pool_id: {get_resource: api_pool} @@ -469,6 +487,9 @@ resources: registry_chunksize: {get_param: registry_chunksize} cluster_uuid: {get_param: cluster_uuid} magnum_url: {get_param: magnum_url} + http_proxy: {get_param: http_proxy} + https_proxy: {get_param: https_proxy} + no_proxy: {get_param: no_proxy} kubernetes_port: {get_param: kubernetes_port} tls_disabled: {get_param: tls_disabled} secgroup_kube_minion_id: {get_resource: secgroup_kube_minion} diff --git a/contrib/drivers/k8s_opensuse_v1/templates/kubemaster.yaml b/contrib/drivers/k8s_opensuse_v1/templates/kubemaster.yaml index fe327504d0..2da69d30ce 100644 --- a/contrib/drivers/k8s_opensuse_v1/templates/kubemaster.yaml +++ b/contrib/drivers/k8s_opensuse_v1/templates/kubemaster.yaml @@ -85,9 +85,23 @@ parameters: api_public_address: type: string description: Public IP address of the Kubernetes master server. + api_private_address: type: string description: Private IP address of the Kubernetes master server. + + http_proxy: + type: string + description: http proxy address for docker + + https_proxy: + type: string + description: https proxy address for docker + + no_proxy: + type: string + description: no proxies for docker + fixed_network: type: string description: Network from which to allocate fixed addresses. @@ -174,6 +188,9 @@ resources: "$TLS_DISABLED": {get_param: tls_disabled} "$CLUSTER_UUID": {get_param: cluster_uuid} "$MAGNUM_URL": {get_param: magnum_url} + "$HTTP_PROXY": {get_param: http_proxy} + "$HTTPS_PROXY": {get_param: https_proxy} + "$NO_PROXY": {get_param: no_proxy} configure_etcd: type: OS::Heat::SoftwareConfig @@ -199,6 +216,12 @@ resources: group: ungrouped config: {get_file: fragments/configure-kubernetes-master.sh} + add_proxy: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: {get_file: fragments/add-proxy.sh} + master_wc_notify: type: OS::Heat::SoftwareConfig properties: @@ -220,6 +243,7 @@ resources: - config: {get_resource: configure_flanneld} - config: {get_resource: create_kubernetes_user} - config: {get_resource: configure_kubernetes} + - config: {get_resource: add_proxy} - config: {get_resource: master_wc_notify} ###################################################################### diff --git a/contrib/drivers/k8s_opensuse_v1/templates/kubeminion.yaml b/contrib/drivers/k8s_opensuse_v1/templates/kubeminion.yaml index 762b910590..88d8bd612e 100644 --- a/contrib/drivers/k8s_opensuse_v1/templates/kubeminion.yaml +++ b/contrib/drivers/k8s_opensuse_v1/templates/kubeminion.yaml @@ -77,11 +77,24 @@ parameters: network_driver: type: string description: network driver to use for instantiating container networks + wait_condition_timeout: type: number description : > timeout for the Wait Conditions + http_proxy: + type: string + description: http proxy address for docker + + https_proxy: + type: string + description: https proxy address for docker + + no_proxy: + type: string + description: no proxies for docker + registry_enabled: type: boolean description: > @@ -195,6 +208,9 @@ resources: $TLS_DISABLED: {get_param: tls_disabled} $CLUSTER_UUID: {get_param: cluster_uuid} $MAGNUM_URL: {get_param: magnum_url} + $HTTP_PROXY: {get_param: http_proxy} + $HTTPS_PROXY: {get_param: https_proxy} + $NO_PROXY: {get_param: no_proxy} $NODE_FIXED_IP: {get_attr: [kube_minion_eth0, fixed_ips, 0, ip_address]} configure_flanneld: @@ -221,6 +237,12 @@ resources: group: ungrouped config: {get_file: fragments/configure-kubernetes-minion.sh} + add_proxy: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: {get_file: fragments/add-proxy.sh} + minion_wc_notify: type: OS::Heat::SoftwareConfig properties: @@ -242,6 +264,7 @@ resources: - config: {get_resource: configure_docker} - config: {get_resource: create_kubernetes_user} - config: {get_resource: configure_kubernetes} + - config: {get_resource: add_proxy} - config: {get_resource: minion_wc_notify} ######################################################################