Validating the provisioning configuration with a dry run

Validate the local Kubernetes provisioning configuration with a dry run of the provision-infra phase, and then run the provisioning phases in order against a disposable project.

Before you start, meet the following requirements:

  • Use a disposable project on your cloud provider, because the phases after the dry run create real infrastructure.
  • Create the credentials file that INFRA_CLOUD_CREDENTIALS_FILE references, as described in Cloud credentials for local provisioning.

A dry run validates the configuration and prints the Terraform or OpenTofu commands. It creates no infrastructure and does not write the generated variables file. The installer image contains the tools that the provisioning phases need. If you run the installer from source, verify the tools first.

  1. Optional: If you run the installer from source, verify that the required tools are available on the host.
    command -v tofu || command -v terraform
    command -v ansible-playbook
    command -v kubectl
  2. Set the provisioning variables in bootstrap.env, and leave INFRA_TERRAFORM_VARS_FILE empty so that the installer generates the Terraform variables.

    The following example shows the values for Cloudera Cloud Core. Replace the placeholders with the values for your project:

    DEPLOY_INFRA="true"
    INFRA_TERRAFORM_PROVIDER="openstack"
    INFRA_TERRAFORM_VARS_FILE=""
    INFRA_CLOUD_CREDENTIALS_FILE="openstack.rc"
    
    INFRA_CLUSTER_NAME="ccf-test"
    INFRA_CONTROL_PLANE_COUNT="1"
    INFRA_WORKER_COUNT="1"
    INFRA_CONTROL_PLANE_FLAVOR="<control-plane-flavor>"
    INFRA_WORKER_FLAVOR="<worker-flavor>"
    INFRA_IMAGE_ID="<openstack-image-id>"
    INFRA_SSH_PUBLIC_KEY_PATH="<path-to-public-key>"
    INFRA_SSH_PRIVATE_KEY_PATH="<path-to-private-key>"
    INFRA_CIDR="192.168.101.0/24"
    INFRA_PUBLIC_NETWORK="public"
    
    INFRA_WORK_DIR=".kubernetes-install"
    INFRA_KUBECONFIG=".kubernetes-install/kubeconfig"

    When you use local checkouts of the sources, also set INFRA_TERRAFORM_TEMPLATES_PATH, INFRA_BOOTSTRAP_PATH, INFRA_KUBEVAP_PATH, and INFRA_KUBEVAP_BINARIES_TAG.

  3. Run a dry run of the provision-infra phase.
    docker run -it --rm \
      -v "$(pwd)":/config \
      --network host \
      container.repository.cloudera.com/cloudera/ccf-install:<TAG> \
      --phase provision-infra --dry-run
  4. Review the printed commands.

    If the preflight checks report an error, fix the configuration and run the dry run again.

  5. Run the provisioning phases in order.
    docker run -it --rm -v "$(pwd)":/config --network host \
      container.repository.cloudera.com/cloudera/ccf-install:<TAG> \
      --phase provision-infra --yes
    
    docker run -it --rm -v "$(pwd)":/config --network host \
      container.repository.cloudera.com/cloudera/ccf-install:<TAG> \
      --phase bootstrap-hosts
    
    docker run -it --rm -v "$(pwd)":/config --network host \
      container.repository.cloudera.com/cloudera/ccf-install:<TAG> \
      --phase install-kubernetes
  6. Inspect the generated Terraform variables without displaying the private SSH key.
    jq 'del(.ssh_private)' .kubernetes-install/terraform.tfvars.json
  7. Verify that the cluster has the expected nodes.
    KUBECONFIG="$PWD/.kubernetes-install/kubeconfig" kubectl get nodes

The dry run prints the commands without creating infrastructure, and the three phases create a cluster whose kubeconfig is in .kubernetes-install/kubeconfig. The remaining installation phases use this kubeconfig automatically.