-
Notifications
You must be signed in to change notification settings - Fork 499
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ocp4_workload_rhacm_cloud_credentials: add kubevirt support
acm hcp kubevirt secret ssh pubkey
- Loading branch information
1 parent
1b7d2b9
commit cfb5081
Showing
4 changed files
with
46 additions
and
66 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
68 changes: 6 additions & 62 deletions
68
ansible/roles_ocp_workloads/ocp4_workload_rhacm_cloud_credentials/readme.adoc
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 |
---|---|---|
@@ -1,67 +1,11 @@ | ||
= ocp4_workload_lpe_automation_controller - automation_controller Workload Role | ||
= ocp4_workload_rhacm_cloud_credentials | ||
|
||
== Role overview | ||
|
||
Deploys an instance of automation_controller on your cluster, into a new project or an existing project. | ||
Create the Secrets necessary for RHACM to deploy clusters. | ||
|
||
== Review the defaults variable file | ||
Supports: | ||
|
||
* This file link:./defaults/main.yml[./defaults/main.yml] contains all the variables you need to define to control the deployment of your workload. | ||
* The variable *ocp_username* is mandatory to assign the workload to the correct OpenShift user. | ||
* A variable *silent=True* can be passed to suppress debug messages. | ||
* You can modify any of these default values by adding `-e "variable_name=variable_value"` to the command line | ||
|
||
=== Deploy a Workload with the `ocp-workload` playbook [Mostly for testing] | ||
|
||
---- | ||
TARGET_HOST="bastion.na39.openshift.opentlc.com" | ||
OCP_USERNAME="mitsharm-redhat.com" | ||
WORKLOAD="ocp4_workload_lpe_automation_controller" | ||
GUID=1001 | ||
# a TARGET_HOST is specified in the command line, without using an inventory file | ||
ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ | ||
-e"ansible_ssh_private_key_file=~/.ssh/keytoyourhost.pem" \ | ||
-e"ansible_user=ec2-user" \ | ||
-e"ocp_username=${OCP_USERNAME}" \ | ||
-e"ocp_workload=${WORKLOAD}" \ | ||
-e"silent=False" \ | ||
-e"guid=${GUID}" \ | ||
-e"ACTION=create" | ||
---- | ||
|
||
=== To Delete an environment | ||
|
||
---- | ||
TARGET_HOST="bastion.na39.openshift.opentlc.com" | ||
OCP_USERNAME="psrivast-redhat.com" | ||
WORKLOAD="ocp4_workload_lpe_automation_controller" | ||
GUID=1002 | ||
# a TARGET_HOST is specified in the command line, without using an inventory file | ||
ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ | ||
-e"ansible_ssh_private_key_file=~/.ssh/keytoyourhost.pem" \ | ||
-e"ansible_user=ec2-user" \ | ||
-e"ocp_username=${OCP_USERNAME}" \ | ||
-e"ocp_workload=${WORKLOAD}" \ | ||
-e"guid=${GUID}" \ | ||
-e"ACTION=remove" | ||
---- | ||
|
||
|
||
== Other related information: | ||
|
||
=== Deploy Workload on OpenShift Cluster from an existing playbook: | ||
|
||
[source,yaml] | ||
---- | ||
- name: Deploy a workload role on a master host | ||
hosts: all | ||
become: true | ||
gather_facts: False | ||
tags: | ||
- step007 | ||
roles: | ||
- { role: "{{ocp_workload}}", when: 'ocp_workload is defined' } | ||
---- | ||
NOTE: You might want to change `hosts: all` to fit your requirements | ||
* AWS | ||
* Azure | ||
* KubeVirt |
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
19 changes: 19 additions & 0 deletions
19
..._workloads/ocp4_workload_rhacm_cloud_credentials/templates/kubevirt_ns_and_secret.yaml.j2
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,19 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: {{ ocp4_workload_rhacm_cloud_credentials_namespace }} | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ ocp4_workload_rhacm_cloud_credentials_kubevirt_secret_name }} | ||
namespace: {{ ocp4_workload_rhacm_cloud_credentials_namespace }} | ||
annotations: | ||
labels: | ||
cluster.open-cluster-management.io/credentials: "" | ||
cluster.open-cluster-management.io/type: kubevirt | ||
type: Opaque | ||
data: | ||
pullSecret: {{ ocp4_token | string | b64encode }} | ||
ssh-publickey: {{ ssh_publickey | string | b64encode }} |