Giter VIP home page Giter VIP logo

rosa-tf's Introduction

rosa-hcp-tf

ROSA with HCP using terraform

Requirements

  • Terraform
  • AWS CLI
  • ROSA CLI
  • OpenShift CLI

Getting started : Deploy ROSA HCP

Base tutorial https://aws.amazon.com/blogs/containers/build-rosa-clusters-with-terraform/

I. Prepare the deployment

  1. Login onto AWS
  2. Check if ELB role exists
# To check if the role exists for your account, run this command in your terminal:
aws iam get-role --role-name "AWSServiceRoleForElasticLoadBalancing"

# If the role doesn't exist, create it by running the following command:
aws iam create-service-linked-role --aws-service-name "elasticloadbalancing.amazonaws.com"
  1. Login onto Red Hat Hybrid Cloud Console
  2. Generate an Offline token, click on "Load Token"
export RH_TOKEN=yourToken
rosa login --token=${RH_TOKEN}

rosa whoami

rosa verify quota --region="$AWS_REGION"

# this may fail due to org policy
rosa verify permissions --region="$AWS_REGION"

# TODO: check if this one is required:
rosa create account-roles --mode auto
  1. Enable HCP ROSA on AWS MarkePlace 5.1 Navigate to the ROSA console : https://console.aws.amazon.com/rosa 5.2 Choose Get started. 5.3 On the Verify ROSA prerequisites page, select I agree to share my contact information with Red Hat. 5.4 Choose Enable ROSA

Please note that Only a single AWS account that will be used for service billing can be associated with a Red Hat account.

II. Deploy a cluster with terraform

export ADMIN_PASS="yourPassword!!138"
export ADMIN_USER="kubeadmin"
export CLUSTER_NAME="rosatest"

terraform init
terraform plan -out rosa.plan -var "cluster_name=$CLUSTER_NAME" -var "htpasswd_password=$ADMIN_PASS" -var "htpasswd_username=$ADMIN_USER" -var "offline_access_token=$RH_TOKEN"
terraform apply rosa.plan

III. Retrieve cluster informations

  1. In the output, you will have the created cluster id:
cluster_id = "2b3sq2r4geb7b6htaibb4uqk9qc9c3fa"
  1. Describe the cluster
export CLUSTER_ID="2b3sq2r4geb7b6htaibb4uqk9qc9c3fa"

rosa describe cluster --output=json -c $CLUSTER_ID
  1. Generate the kubeconfig:
export NAMESPACE="myNs"
export SERVER_API=$(rosa describe cluster --output=json -c "$CLUSTER_ID" | jq -r '.api.url')
oc login --username "$ADMIN_USER" --password "$ADMIN_PASS" --server=$SERVER_API

kubectl config rename-context $(oc config current-context) "$CLUSTER_NAME"
kubectl config use "$CLUSTER_NAME"

# create a new project
oc new-project "$NAMESPACE"

Install C8 on the deployed OpenShift

TODO: align needed ressources to deploy C8 on OpenShift, minimal worker size is not sufficient for standard deployment

Please note that this guide assumes that you have a working helm cli installed with a version > 3.1

  1. Install the helm chart with a specific version:
helm repo add camunda https://helm.camunda.io
helm repo update
helm pull camunda/camunda-platform --version 10.0.4 --untar --untardir ./tmp-helm
  1. Please note that we use some values for:
  2. We need to enforce some specific values for OpenShift:
helm install camunda camunda/camunda-platform --skip-crds       \
    --values ./tmp-helm/camunda-platform/openshift/values.yaml        \
    --values ./test/c8-fixtures/values-latest.yaml         \
    --post-renderer bash --post-renderer-args ./tmp-helm/camunda-platform/openshift/patch.sh

Improvements / TODO

  • Use S3 to store the states (directly in the action)
  • Setup weekly cleanup (in action)
  • add to toolsversion (rosa and oc missing)

rosa-tf's People

Contributors

leiicamundi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.