mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-28 09:39:12 +03:00
Implemented cloud-provider integration for OpenStack.
Currently kubespray does not install kubernetes in a way that allows cinder volumes to be used. This commit provides the necessary cloud configuration file and configures kubelet and kube-apiserver to use it.
This commit is contained in:
@@ -8,3 +8,13 @@ common_required_pkgs:
|
||||
- rsync
|
||||
- bash-completion
|
||||
|
||||
|
||||
|
||||
# For the openstack integration kubelet will need credentials to access
|
||||
# openstack apis like nova and cinder. Per default this values will be
|
||||
# read from the environment.
|
||||
openstack_auth_url: "{{ lookup('env','OS_AUTH_URL') }}"
|
||||
openstack_username: "{{ lookup('env','OS_USERNAME') }}"
|
||||
openstack_password: "{{ lookup('env','OS_PASSWORD') }}"
|
||||
openstack_region: "{{ lookup('env','OS_REGION_NAME') }}"
|
||||
openstack_tenant_id: "{{ lookup('env','OS_TENANT_ID') }}"
|
||||
|
||||
@@ -48,8 +48,11 @@
|
||||
|
||||
- name: check cloud_provider value
|
||||
fail:
|
||||
msg: "If set the 'cloud_provider' var must be set eithe to 'gce' or 'aws'"
|
||||
when: cloud_provider is defined and cloud_provider not in ['gce', 'aws']
|
||||
msg: "If set the 'cloud_provider' var must be set either to 'gce', 'aws' or 'openstack'"
|
||||
when: cloud_provider is defined and cloud_provider not in ['gce', 'aws', 'openstack']
|
||||
|
||||
- include: openstack-credential-check.yml
|
||||
when: cloud_provider is defined and cloud_provider == 'openstack'
|
||||
|
||||
- name: Create cni directories
|
||||
file:
|
||||
@@ -105,4 +108,12 @@
|
||||
when: ansible_os_family == "RedHat"
|
||||
changed_when: False
|
||||
|
||||
- name: Write openstack cloud-config
|
||||
template:
|
||||
src: openstack-cloud-config.j2
|
||||
dest: "{{ kube_config_dir }}/cloud_config"
|
||||
group: "{{ kube_cert_group }}"
|
||||
mode: 0640
|
||||
when: cloud_provider is defined and cloud_provider == "openstack"
|
||||
|
||||
- include: etchosts.yml
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
---
|
||||
- name: check openstack_auth_url value
|
||||
fail:
|
||||
msg: "openstack_auth_url is missing"
|
||||
when: openstack_auth_url is not defined or openstack_auth_url == ""
|
||||
|
||||
- name: check openstack_username value
|
||||
fail:
|
||||
msg: "openstack_username is missing"
|
||||
when: openstack_username is not defined or openstack_username == ""
|
||||
|
||||
- name: check openstack_password value
|
||||
fail:
|
||||
msg: "openstack_password is missing"
|
||||
when: openstack_password is not defined or openstack_password == ""
|
||||
|
||||
- name: check openstack_region value
|
||||
fail:
|
||||
msg: "openstack_region is missing"
|
||||
when: openstack_region is not defined or openstack_region == ""
|
||||
|
||||
- name: check tenant_id value
|
||||
fail:
|
||||
msg: "tenant_id is missing"
|
||||
when: openstack_tenant_id is not defined or openstack_tenant_id == ""
|
||||
@@ -0,0 +1,6 @@
|
||||
[Global]
|
||||
auth-url={{ openstack_auth_url }}
|
||||
username={{ openstack_username }}
|
||||
password={{ openstack_password }}
|
||||
region={{ openstack_region }}
|
||||
tenant-id={{ openstack_tenant_id }}
|
||||
Reference in New Issue
Block a user