mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-03-11 14:39:39 -02:30
Cloud provider support for OCI (Oracle Cloud Infrastructure)
Signed-off-by: Jeff Bornemann <jeff.bornemann@oracle.com>
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
---
|
||||
|
||||
- name: "OCI Cloud Controller | Credentials Check | oci_private_key"
|
||||
fail:
|
||||
msg: "oci_private_key is missing"
|
||||
when: (oci_use_instance_principals == false) and
|
||||
(oci_private_key is not defined or oci_private_key == "")
|
||||
|
||||
- name: "OCI Cloud Controller | Credentials Check | oci_region_id"
|
||||
fail:
|
||||
msg: "oci_region_id is missing"
|
||||
when: (oci_use_instance_principals == false) and
|
||||
(oci_region_id is not defined or oci_region_id == "")
|
||||
|
||||
- name: "OCI Cloud Controller | Credentials Check | oci_tenancy_id"
|
||||
fail:
|
||||
msg: "oci_tenancy_id is missing"
|
||||
when: (oci_use_instance_principals == false) and
|
||||
(oci_tenancy_id is not defined or oci_tenancy_id == "")
|
||||
|
||||
- name: "OCI Cloud Controller | Credentials Check | oci_user_id"
|
||||
fail:
|
||||
msg: "oci_user_id is missing"
|
||||
when: (oci_use_instance_principals == false) and
|
||||
(oci_user_id is not defined or oci_user_id == "")
|
||||
|
||||
- name: "OCI Cloud Controller | Credentials Check | oci_user_fingerprint"
|
||||
fail:
|
||||
msg: "oci_user_fingerprint is missing"
|
||||
when: (oci_use_instance_principals == false) and
|
||||
(oci_user_fingerprint is not defined or oci_user_fingerprint == "")
|
||||
|
||||
- name: "OCI Cloud Controller | Credentials Check | oci_compartment_id"
|
||||
fail:
|
||||
msg: "oci_compartment_id is missing. This is the compartment in which the cluster resides"
|
||||
when: oci_compartment_id is not defined or oci_compartment_id == ""
|
||||
|
||||
- name: "OCI Cloud Controller | Credentials Check | oci_vnc_id"
|
||||
fail:
|
||||
msg: "oci_vnc_id is missin. This is the Virtual Cloud Network in which the cluster resides"
|
||||
when: oci_vnc_id is not defined or oci_vnc_id == ""
|
||||
|
||||
- name: "OCI Cloud Controller | Credentials Check | oci_subnet1_id"
|
||||
fail:
|
||||
msg: "oci_subnet1_id is missing. This is the first subnet to which loadbalancers will be added"
|
||||
when: oci_subnet1_id is not defined or oci_subnet1_id == ""
|
||||
|
||||
- name: "OCI Cloud Controller | Credentials Check | oci_subnet2_id"
|
||||
fail:
|
||||
msg: "oci_subnet2_id is missing. Two subnets are required for load balancer high availability"
|
||||
when: oci_subnet2_id is not defined or oci_subnet2_id == ""
|
||||
|
||||
- name: "OCI Cloud Controller | Credentials Check | oci_security_list_management"
|
||||
fail:
|
||||
msg: "oci_security_list_management is missing, or not defined correctly. Valid options are (All, Frontend, None)."
|
||||
when: oci_security_list_management is not defined or oci_security_list_management not in ["All", "Frontend", "None"]
|
||||
51
roles/kubernetes-apps/cloud_controller/oci/tasks/main.yml
Normal file
51
roles/kubernetes-apps/cloud_controller/oci/tasks/main.yml
Normal file
@@ -0,0 +1,51 @@
|
||||
---
|
||||
|
||||
- include: credentials-check.yml
|
||||
tags: oci
|
||||
|
||||
- name: "OCI Cloud Controller | Generate Configuration"
|
||||
template:
|
||||
src: controller-manager-config.yml.j2
|
||||
dest: /tmp/controller-manager-config.yml
|
||||
register: controller_manager_config
|
||||
when: inventory_hostname == groups['kube-master'][0]
|
||||
tags: oci
|
||||
|
||||
- name: "OCI Cloud Controller | Encode Configuration"
|
||||
set_fact:
|
||||
controller_manager_config_base64: "{{ lookup('file', '/tmp/controller-manager-config.yml') | b64encode }}"
|
||||
when: inventory_hostname == groups['kube-master'][0]
|
||||
tags: oci
|
||||
|
||||
- name: "OCI Cloud Controller | Apply Configuration To Secret"
|
||||
template:
|
||||
src: cloud-provider.yml.j2
|
||||
dest: /tmp/cloud-provider.yml
|
||||
when: inventory_hostname == groups['kube-master'][0]
|
||||
tags: oci
|
||||
|
||||
- name: "OCI Cloud Controller | Apply Configuration"
|
||||
kube:
|
||||
kubectl: "{{ bin_dir }}/kubectl"
|
||||
filename: "/tmp/cloud-provider.yml"
|
||||
when: inventory_hostname == groups['kube-master'][0]
|
||||
tags: oci
|
||||
|
||||
- name: "OCI Cloud Controller | Download Controller Manifest"
|
||||
get_url:
|
||||
url: "https://raw.githubusercontent.com/oracle/oci-cloud-controller-manager/{{oci_cloud_controller_version}}/manifests/oci-cloud-controller-manager.yaml"
|
||||
dest: "/tmp/oci-cloud-controller-manager.yml"
|
||||
force: yes
|
||||
register: result
|
||||
until: "'OK' in result.msg"
|
||||
retries: 4
|
||||
delay: "{{ retry_stagger | random + 3 }}"
|
||||
when: inventory_hostname == groups['kube-master'][0]
|
||||
tags: oci
|
||||
|
||||
- name: "OCI Cloud Controller | Apply Controller Manifest"
|
||||
kube:
|
||||
kubectl: "{{ bin_dir }}/kubectl"
|
||||
filename: "/tmp/oci-cloud-controller-manager.yml"
|
||||
when: inventory_hostname == groups['kube-master'][0]
|
||||
tags: oci
|
||||
Reference in New Issue
Block a user