Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBM cloud playbook is missing a role to install/delete a k8s/openshift cluster #224

Open
cmoulliard opened this issue Oct 14, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@cmoulliard
Copy link
Member

cmoulliard commented Oct 14, 2021

Improvement

The bash script of our gitlab snowdrop infra project includes the command able to create a k8s or openshift cluster

VPC_ID=$(echo "$VPC_OUT" | jq -r '.id')
VPC_STATUS=$(echo "$VPC_OUT" | jq -r '.status')

echo "ibmcloud is public-gateway-create $PUBLIC_GW_NAME $VPC_ID $zone"
ibmcloud is public-gateway-create $PUBLIC_GW_NAME $VPC_ID $zone -q

PUBLIC_GW_ID=$(ibmcloud is pubgws --json | jq -r '.[] | select (.name=="'$PUBLIC_GW_NAME'") | .id')
ibmcloud is subnet-create $SUBNET_NAME $VPC_ID --zone $zone \
     --ipv4-address-count 256 \
     --public-gateway-id $PUBLIC_GW_ID

SUBNET_ID=$(ibmcloud is subnets --json | jq -r '.[] | select (.name=="'$SUBNET_NAME'") | .id')
ibmcloud resource service-instance-create $COS_NAME \
     cloud-object-storage standard global \
     -g Default

COS_CRN=$(ibmcloud resource service-instances --output json | jq -r '.[] | select (.name=="'$COS_NAME'") | .crn')
ibmcloud oc cluster create \
     $kubernetes_infra \
     --name $K8S_CLUSTER_NAME \
     --zone $zone \
     --version $kubernetes_version \
     --flavor $kubernetes_flavor \
     --workers $kubernetes_workers \
     --vpc-id $VPC_ID \
     --subnet-id $SUBNET_ID \
     --cos-instance $COS_CRN

Suggestion: Extend the project to also support to create/update/delete a kubernetes/OpenShift cluster - see this plugin:

https://github.com/IBM-Cloud/ansible-collection-ibm/blob/master/plugins/modules/ibm_container_cluster.py

@cmoulliard cmoulliard added the enhancement New feature or request label Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants