Verify the Topology

Verify that the resources that you defined in the Terraform configuration are created, test SSH access to the bastion and admin hosts, and verify access to the Kubernetes cluster.

Verify the Resources Deployed

  1. Sign in to the Oracle Cloud Infrastructure web console.
  2. In the regions menu near the upper right corner, select the region name corresponding to the region ID that you specified in terraform.tfvars.
    For example, if you specified the region ID us-ashburn-1 in terraform.tfvars, then select US East (Ashburn).
  3. From the services menu, select Compute.
  4. In the COMPARTMENT field in the navigation pane on the left, select the compartment name corresponding to the compartment ID that you specified in terraform.tfvars.
  5. Verify that the following instances exist:
    • Two instances named label_prefix-bastion and label_prefix-admin, where label_prefix is the value that you specified for the label_prefix variable in terraform.tfvars
    • Three or more instances with names in the format cluster_name-...-n, where cluster_name is the name that you specified for the cluster, and n is an ordinal number starting at 0. The number of instances matches the number of nodes that you specified for the Kubernetes cluster.
  6. Click the name of each instance and, on the Instance Details page, verify that the availability domain, image, and shape match the settings that you had specified in terraform.tfvars.
  7. On the Instance Details page of any instance, under Instance Information, locate the Virtual Cloud Network field, and click the VCN name.
  8. On the Virtual Cloud Network Details page, verify that the CIDR block matches the address that you specified in terraform.tfvars.
  9. In the left navigation pane, under Resources, verify that the VCN contains the following resources. The numbers indicate the count of each resource.
    • Subnet: If you opted to create both the bastion and admin compute instances, then 4 subnets; if you opted to create only one of the compute instances, then 3 subnets; otherwise, 2.
    • Route tables: If you opted to create the NAT gateway, then 3 route tables; otherwise, 2.
    • Internet gateway: 1
    • Security lists: If you opted to create both the bastion and admin compute instances, then 5 security lists; if you opted to create only one of the compute instances, then 4 subnets; otherwise, 3.
    • DHCP option: 1
    • NAT gateway: If you opted to create the NAT gateway, then 1; otherwise, 0.
    • Service gateway: If you opted to create the service gateway, then 1; otherwise, 0.
  10. Click through each of the networking resources, and view their details.
  11. From the services menu, select Developer Services, and then select Container Clusters (OKE).
  12. Verify that a cluster named label_prefix-cluster_name exists and is active.
  13. Click the name of the cluster, scroll down to the Node Pools section of the console, and verify that the number and size of the node pools match the settings that you specified.

Verify SSH Access to the Bastion and Admin Hosts

If you opted to create a bastion host or an admin host, then test whether you can create an SSH connection to them.

In a terminal window, run the ssh commands that you copied earlier from the output of the terraform apply operation.

If you didn't copy the ssh commands earlier from the output of terraform apply, then go to the top-level directory that contains the Terraform configuration, and run the command terraform output. Copy the ssh_to_admin and ssh_to_bastion outputs.

The ssh commands are in the following format:
  • Admin host: ssh -i privateKeyPath -J opc@bastionPublicIP opc@adminPrivateIP
  • Bastion host: ssh -i privateKeyPath opc@bastionPublicIP

Access the Kubernetes Cluster

You can use the kubectl CLI or the web-based Kubernetes dashboard to access and manage the Kubernetes cluster.

  • kubectl is installed and configured automatically on the admin host.
  • To run kubectl from your local host, install it, and set the KUBECONFIG environment variable.

    The kubectl CLI uses the KUBECONFIG variable to determine the parameters for accessing a Kubernetes cluster. When you applied the Terraform configuration, the required cluster-access parameters were generated and stored in a local file named kubeconfig in the directory generated.

    To set the KUBECONFIG environment variable on your local host, run the following command:
    export KUBECONFIG=generated/kubeconfig
  • To access the Kubernetes dashboard, complete the following steps:
    1. Start a proxy server to the Kubernetes API server by running the following command:
      kubectl proxy
    2. Using your browser, go to http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/