ROSA Cluster - Create #198
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
name: ROSA Cluster - Create | |
on: | |
workflow_call: | |
inputs: | |
clusterName: | |
description: 'Name of the cluster' | |
type: string | |
cidr: | |
description: 'ROSA Machine CIDR' | |
type: string | |
computeMachineType: | |
description: 'Instance type for the compute nodes' | |
default: 'c7g.2xlarge' | |
type: string | |
availabilityZones: | |
description: 'Availability zones to deploy to' | |
default: '' | |
type: string | |
replicas: | |
description: 'Number of worker nodes to provision' | |
type: string | |
region: | |
description: 'The AWS region to create the cluster in. Defaults to "vars.AWS_DEFAULT_REGION" if omitted.' | |
type: string | |
workflow_dispatch: | |
inputs: | |
clusterName: | |
description: 'Name of the cluster' | |
type: string | |
cidr: | |
description: 'ROSA Machine CIDR (10.0.[0-63].0/24)' | |
type: string | |
default: 10.0.0.0/24 | |
computeMachineType: | |
description: 'Instance type for the compute nodes' | |
default: 'c7g.2xlarge' | |
type: string | |
availabilityZones: | |
description: 'Availability zones to deploy to' | |
default: '' | |
type: string | |
replicas: | |
description: 'Number of worker nodes to provision' | |
type: string | |
region: | |
description: 'The AWS region to create the cluster in. Defaults to "vars.AWS_DEFAULT_REGION" if omitted.' | |
type: string | |
env: | |
REGION: ${{ github.event.inputs.region || vars.AWS_DEFAULT_REGION }} | |
jobs: | |
checkout: | |
name: Create ROSA cluster | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup ROSA CLI | |
uses: ./.github/actions/rosa-cli-setup | |
with: | |
aws-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-default-region: ${{ vars.AWS_DEFAULT_REGION }} | |
rosa-token: ${{ secrets.ROSA_TOKEN }} | |
- name: Setup OpenTofu | |
uses: opentofu/setup-opentofu@v1 | |
with: | |
tofu_wrapper: false | |
- name: Create ROSA Cluster | |
run: ./rosa_create_cluster.sh | |
working-directory: provision/aws | |
env: | |
AVAILABILITY_ZONES: ${{ inputs.availabilityZones }} | |
CIDR: ${{ inputs.cidr }} | |
CLUSTER_NAME: ${{ inputs.clusterName || format('gh-{0}', github.repository_owner) }} | |
COMPUTE_MACHINE_TYPE: ${{ inputs.computeMachineType }} | |
REPLICAS: ${{ inputs.replicas }} | |
TF_VAR_rhcs_token: ${{ secrets.ROSA_TOKEN }} | |
- name: Retrieve ROSA logs | |
if: always() | |
run: | | |
mkdir -p provision/aws/logs | |
rosa logs install --debug -c ${{ inputs.clusterName }} 2>&1 | tee provision/aws/logs/rosa-logs-${{ inputs.clusterName }} | |
- name: Archive ROSA logs | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: rosa-logs-${{ inputs.clusterName }} | |
path: provision/aws/logs | |
retention-days: 5 |