|
1 |
| -# Sample to create OKE cluster using Terraform scripts |
| 1 | +# Sample to create an OKE cluster using Terraform scripts |
2 | 2 |
|
3 | 3 | The provided sample will create:
|
4 | 4 |
|
5 | 5 | A new Virtual Cloud Network (VCN) for the cluster
|
6 | 6 |
|
7 |
| - 2 LoadBalancer subnets with seclists |
| 7 | + Two LoadBalancer subnets with security lists |
8 | 8 |
|
9 |
| - 3 Worker subnets with seclists |
| 9 | + Three Worker subnets with security lists |
10 | 10 |
|
11 |
| - A Kubernetes Cluster with one NodePool |
| 11 | + A Kubernetes Cluster with one Node Pool |
12 | 12 |
|
13 |
| - A kubeconfig file to allow access using kubectl |
| 13 | + A `kubeconfig` file to allow access using `kubectl` |
14 | 14 |
|
15 |
| -Nodes and network settings will be configured to allow SSH access, and the cluster Networking policies will allow NodePort services to be exposed. |
| 15 | +Nodes and network settings will be configured to allow SSH access, and the cluster networking policies will allow `NodePort` services to be exposed. This cluster can be used for testing and development purposes only. The provided samples of Terraform scripts should not be considered for creating production clusters, without more of a review. |
16 | 16 |
|
17 |
| -By default all OCI Container Engine for Kubernetes Cluster masters are Highly Available (HA) and fronted by load balancers. |
| 17 | +All OCI Container Engine masters are Highly Available (HA) and fronted by load balancers. |
18 | 18 |
|
19 | 19 |
|
20 | 20 |
|
21 |
| -Prerequisites |
| 21 | +###Prerequisites |
22 | 22 |
|
23 | 23 | To use these Terraform scripts, you will need fulfill the following prerequisites:
|
24 | 24 |
|
25 |
| - Have an existing tenancy with enough compute and networking resources available for the desired cluster |
| 25 | + Have an existing tenancy with enough compute and networking resources available for the desired cluster. |
26 | 26 |
|
27 |
| - Have an OCI Container Engine for Kubernetes policy in place within that tenancy to allow the OCI Container Engine for Kubernetes service to manage tenancy resources |
| 27 | + Have an [Identity and Access Management](https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengpolicyconfig.htm#PolicyPrerequisitesService) policy in place within that tenancy to allow the OCI Container Engine for Kubernetes service to manage tenancy resources. |
28 | 28 |
|
29 |
| - Install Terraform with the OCI plugin as described here. |
| 29 | + Have a user defined within that tenancy. |
30 | 30 |
|
31 |
| - Have a user defined within that tenancy |
| 31 | + Have an API key defined for use with the OCI API, as documented [here](https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcredentials.htm). |
32 | 32 |
|
33 |
| - Have an API key defined for use with the OCI API, as documented here |
| 33 | + Have an [SSH key pair](https://docs.oracle.com/en/cloud/iaas/compute-iaas-cloud/stcsg/generating-ssh-key-pair.html) for configuring SSH access to the nodes in the cluster. |
34 | 34 |
|
35 |
| - Have an SSH key pair with file permission 600 ready for configuring SSH access to the nodes in the cluster |
36 | 35 |
|
| 36 | +Copy provided `oci.props.template` file to `oci.props` and add all required values: |
| 37 | + * `user.ocid` - OCID for the tenancy user - can be obtained from the user settings in the OCI console. |
| 38 | + * `tfvars.filename` - File name for generated tfvar file. |
| 39 | + * `okeclustername` - The name for OCI Container Engine for Kubernetes cluster. |
| 40 | + * `tenancy.ocid` - OCID for the target tenancy. |
| 41 | + * `region` - name of region in the target tenancy. |
| 42 | + * `compartment.ocid` - OCID for the target compartment. |
| 43 | + * `compartment.name` - Name for the target compartment. |
| 44 | + * `ociapi.pubkey.fingerprint` - Fingerprint of the OCI user's public key. |
| 45 | + * `ocipk.path` - API Private Key -- local path to the private key for the API key pair. |
| 46 | + * `vcn.cidr.prefix` - Prefix for VCN CIDR, used when creating subnets -- you should examine the target compartment find a CIDR that is available. |
| 47 | + * `vcn.cidr` - Full CIDR for the VCN, must be unique within the compartment, first 2 octets should match the vcn_cidr_prefix. |
| 48 | + * `nodepool.shape` - A valid OCI VM Shape for the cluster nodes. |
| 49 | + * `k8s.version` - SSH public key (key contents as a string). |
| 50 | + * `nodepool.imagename - A valid image name for Node Pool creation. |
| 51 | + * `terraform.installdir` - Location to install Terraform binaries. |
37 | 52 |
|
38 |
| -Copy provided oci.props.template file to oci.props and add all required values. |
39 |
| - |
40 |
| -The syntax of the script is: |
| 53 | +To run the script, use the command: |
41 | 54 | ```
|
42 | 55 | $ kubernetes/samples/scripts/terraform/oke.create.sh oci.props
|
43 | 56 | ```
|
44 |
| -The scripts collects the values from oci.props file and performs the following steps: |
45 |
| -Create a new tfvars file based on the values from the provided oci.props file. |
46 |
| -Downloads and installs all needed binaries for Terraform, Terraform OCI Provider and Go, based on OS system ( Mac or Linux) |
47 |
| -Apply the configuration and creates OKE Cluster using Terraform |
| 57 | +The script collects the values from `oci.props` file and performs the following steps: |
| 58 | + * Creates a new tfvars file based on the values from the provided `oci.props` file. |
| 59 | + * Downloads and installs all needed binaries for Terraform, Terraform OCI Provider, based on OS system (macOS or Linux) |
| 60 | + * Applies the configuration and creates OKE Cluster using Terraform |
48 | 61 |
|
49 | 62 |
|
0 commit comments