-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Prajyot-Parab <prajyot.parab2@ibm.com>
- Loading branch information
1 parent
284b597
commit 8d7cee2
Showing
9 changed files
with
106 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
- name: CSI Driver installation | ||
hosts: bastion[0] | ||
tasks: | ||
- name: Fail csi-driver installation incase 'IBMCLOUD_API_KEY' environment variable is an empty string | ||
fail: | ||
msg: IBMCLOUD_API_KEY environment variable must be a non-empty string. | ||
when: (lookup('env', 'IBMCLOUD_API_KEY') == "") | ||
|
||
- include_role: | ||
name: csi-driver-install | ||
vars: | ||
IBMCLOUD_API_KEY: IBMCLOUD_API_KEY: "{{ lookup('env', 'IBMCLOUD_API_KEY') }}" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
csi-driver-install: PowerVS Block CSI Driver Installation | ||
========= | ||
|
||
This module will perform necessary configuration on OCP nodes required for CSI Driver installation. | ||
|
||
Requirements | ||
------------ | ||
|
||
- A working OCP 4.X cluster | ||
|
||
Role Variables | ||
-------------- | ||
|
||
| Variable | Required | Default | Comments | | ||
|--------------------------------|----------|----------|---------------------------------------------------------------| | ||
| resource_type | no | `stable` | Set to csi-driver resource type. | | ||
| resource_version | no | `v0.1.0` | Set to csi-driver version. | | ||
| service_instance_id | yes | | IBM Cloud PowerVS service instance id. | | ||
| region | yes | | IBM Cloud PowerVS service instance region. eg. mon | | ||
| zone | yes | | IBM Cloud PowerVS service instance zone. eg. mon01 | | ||
| masters.name | yes | | OCP Nodes Master name. | | ||
| masters.id | yes | | OCP Nodes Master instance id. | | ||
| workers.name | yes | | OCP Nodes Worker name. | | ||
| workers.id | yes | | OCP Nodes Worker instance id. | | ||
|
||
Dependencies | ||
------------ | ||
|
||
- Export the IBM Cloud API Key | ||
|
||
``` | ||
$ set +o history | ||
$ export IBMCLOUD_API_KEY='<your API key>' | ||
$ set -o history | ||
``` | ||
|
||
Example Playbook | ||
---------------- | ||
|
||
- name: CSI Driver installation | ||
hosts: bastion[0] | ||
tasks: | ||
- include_role: | ||
name: csi-driver-install | ||
vars: | ||
IBMCLOUD_API_KEY: (lookup('env', 'IBMCLOUD_API_KEY') | ||
when: (lookup('env', 'IBMCLOUD_API_KEY') != "") | ||
|
||
License | ||
------- | ||
|
||
See LICENCE.txt | ||
|
||
Author Information | ||
------------------ | ||
|
||
Prajyot Parab (prajyot.parab2@ibm.com) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
# defaults file | ||
|
||
resource_type: "stable" | ||
resource_version: "v0.1.0" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
# tasks file for csi driver installation | ||
|
||
- name: Create a Secret resource | ||
k8s: | ||
state: present | ||
definition: | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: ibm-secret | ||
namespace: kube-system | ||
labels: | ||
stringData: | ||
IBMCLOUD_API_KEY: "{{ IBMCLOUD_API_KEY }}" | ||
|
||
- name: Create csi driver resource | ||
shell: kubectl apply -k "https://github.com/kubernetes-sigs/ibm-powervs-block-csi-driver/deploy/kubernetes/overlays/{{ resource_type }}?ref={{ resource_version }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
# tasks file for csi driver config and install | ||
|
||
- name: Run csi driver configuration tasks | ||
import_tasks: config.yaml | ||
|
||
- name: Run csi driver installation tasks | ||
import_tasks: install.yaml |