
Implement basic cloud provider functionality to deploy Kubernetes on Azure. SaltStack is used to deploy Kubernetes on top of Ubuntu virtual machines. OpenVpn provides network connectivity. For kubelet authentication, we use basic authentication (username and password). The scripts use the legacy Azure Service Management APIs. We have set up a nightly test job in our Jenkins server for federated testing to run the e2e test suite on Azure. With the cloud provider scripts in this commit, 14 e2e test cases pass in this environment. We plan to implement additional Azure functionality to support more test cases.
49 lines
1.2 KiB
Plaintext
49 lines
1.2 KiB
Plaintext
{% set master_extra_sans=grains.get('master_extra_sans', '') %}
|
|
{% if grains.cloud is defined %}
|
|
{% if grains.cloud == 'gce' %}
|
|
{% set cert_ip='_use_gce_external_ip_' %}
|
|
{% endif %}
|
|
{% if grains.cloud == 'aws' %}
|
|
{% set cert_ip='_use_aws_external_ip_' %}
|
|
{% endif %}
|
|
{% if grains.cloud == 'azure-legacy' %}
|
|
{% set cert_ip='_use_azure_dns_name_' %}
|
|
{% endif %}
|
|
{% if grains.cloud == 'vsphere' or grains.cloud == 'photon-controller' %}
|
|
{% set cert_ip=grains.ip_interfaces.eth0[0] %}
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
# If there is a pillar defined, override any defaults.
|
|
{% if pillar['cert_ip'] is defined %}
|
|
{% set cert_ip=pillar['cert_ip'] %}
|
|
{% endif %}
|
|
|
|
{% set certgen="make-cert.sh" %}
|
|
{% if cert_ip is defined %}
|
|
{% set certgen="make-ca-cert.sh" %}
|
|
{% endif %}
|
|
|
|
openssl:
|
|
pkg.installed: []
|
|
|
|
kube-cert:
|
|
group.present:
|
|
- system: True
|
|
|
|
kubernetes-cert:
|
|
cmd.script:
|
|
- unless: test -f /srv/kubernetes/server.cert
|
|
- source: salt://generate-cert/{{certgen}}
|
|
{% if cert_ip is defined %}
|
|
- args: {{cert_ip}} {{master_extra_sans}}
|
|
- require:
|
|
- pkg: curl
|
|
{% endif %}
|
|
- cwd: /
|
|
- user: root
|
|
- group: root
|
|
- shell: /bin/bash
|
|
- require:
|
|
- pkg: openssl
|