Skip to content

Commit

Permalink
conditional cluster definition
Browse files Browse the repository at this point in the history
ocp_cluster_name=leogit7

delete_ocp_cluster=false
  • Loading branch information
leiicamundi committed May 16, 2024
1 parent 6954e59 commit 43d9f2c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
7 changes: 3 additions & 4 deletions .github/actions/rosa-create-cluster/action.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: Deploy ROSA HCP Cluster

description: |
This GitHub Action automates the deployment of a ROSA (Red Hat OpenShift Service on AWS) cluster using Terraform with a dedicated namespace.
This GitHub Action automates the deployment of a ROSA (Red Hat OpenShift Service on AWS) cluster using Terraform.
This action will also install oc, awscli, rosa cli.
This action also set the current kube context on the created namespace.
inputs:
rh-token:
Expand Down Expand Up @@ -36,7 +35,7 @@ inputs:
openshift-version:
description: 'Version of the OpenShift to install'
required: true
default: "4.15.11"
default: "4.15.12"
replicas:
description: 'Number of replicas for the ROSA cluster'
required: true
Expand All @@ -56,7 +55,7 @@ inputs:
outputs:
openshift-server-api:
description: 'The server API URL of the deployed ROSA cluster'
value: ${{ steps.kube_config.outputs.cluster_api }}
value: ${{ steps.cluster_info.outputs.cluster_api }}

openshift-cluster-id:
description: 'The ID of the deployed ROSA cluster'
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/rosa-delete-cluster/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Delete ROSA HCP Cluster

description: |
This GitHub Action automates the deletion of a ROSA (Red Hat OpenShift Service on AWS) cluster using Terraform.
This action will also uninstall oc, awscli, rosa cli.
This action will also install awscli.
inputs:
rh-token:
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,26 @@ jobs:
- name: Deploy ROSA HCP Cluster
uses: camunda/camunda-tf-rosa/.github/actions/rosa-create-cluster@main
id: create_cluster
with:
rh-token: ${{ secrets.RH_OPENSHIFT_TOKEN }}
cluster-name: "my-ocp-cluster"
admin-username: "cluster-admin"
admin-password: ${{ secrets.CI_OPENSHIFT_MAIN_PASSWORD }}
aws-region: "us-west-2"
namespace: "myns"
s3-backend-bucket: ${{ secrets.TF_S3_BUCKET }}
- name: Generate kubeconfig
shell: bash
id: kube_config
run: |
oc login --username "cluster-admin" --password ${{ secrets.CI_OPENSHIFT_MAIN_PASSWORD }} "${{ steps.create_cluster.outputs.openshift-server-api }}"
oc whoami
kubectl config rename-context $(oc config current-context) "my-ocp-cluster"
kubectl config use "my-ocp-cluster"
```
#### Delete ROSA HCP Cluster
Expand Down

0 comments on commit 43d9f2c

Please sign in to comment.