You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this repositroy there are 7 terrafrom modules, in order of dependency:
34
33
35
-
* Deploy a [simple compute instance](simple-instance/)
36
-
* Deploy two instances behind a network load balancer using an [instance pool](instance-pool/)
37
-
* Deploy a [k3s-cluster](k3s-cluster/)
34
+
*[simple-vcn](simple-vcn/) - Setup a VCN with two PUBLIC subnets
35
+
*[private-vcn](private-vcn/) - Setup a VCN with one PUBLIC subnet and one PRIVATE subnet
36
+
*[nat-instance](nat-instance/) - Setup a NAT instance (with the Oracle always free account you can't deploy a NAT gateway)
37
+
*[simple-instance](simple-instance/) - Deploy a simple instance in a private or public subnet
38
+
*[instance-pool](instance-pool/) - Deploy multiple instances using a Oracle instance pool and instance configurations
39
+
*[load-balancer](load-balancer/) - Deploy a public load balancer (Layer 7 HTTP)
40
+
*[network-load-balancer](network-load-balancer/) - Deploy a private load balancer (Layer 4 TCP)
41
+
42
+
For more information on how to use this modules follow the examples in the *examples* directory. To use this repository, clone this repository and use the *example* directory as base dir.
38
43
39
44
### Requirements
40
45
@@ -44,6 +49,12 @@ To use this repo you will need:
44
49
45
50
Once you get the account, follow the *Before you begin* and *1. Prepare* step in [this](https://docs.oracle.com/en-us/iaas/developer-tutorials/tutorials/tf-provider/01-summary.htm) document.
46
51
52
+
You need also:
53
+
54
+
*[Terraform](https://www.terraform.io/) - Terraform is an open-source infrastructure as code software tool that provides a consistent CLI workflow to manage hundreds of cloud services. Terraform codifies cloud APIs into declarative configuration files.
55
+
*[kubectl](https://kubernetes.io/docs/tasks/tools/) - The Kubernetes command-line tool (optional)
56
+
*[oci cli](https://docs.oracle.com/en-us/iaas/Content/API/Concepts/cliconcepts.htm) - Oracle command line interface (optional)
57
+
47
58
#### Example RSA key generation
48
59
49
60
To use terraform with the Oracle Cloud infrastructure you need to generate an RSA key. Generate the rsa key with:
@@ -58,9 +69,15 @@ replace *<your_name>* with your name or a string you prefer.
58
69
59
70
**NOTE**~/.oci/<your_name>-oracle-cloud_public.pem this string will be used on the *terraform.tfvars* used by the Oracle provider plugin, so please take note of this string.
60
71
72
+
### Project setup
73
+
74
+
Once you have cloned this repo, change directory to [examples](examples/) dir and choose the example you prefer: *private subnet* or main.tf or *public subnet* main.tf-public file. Edit the example file and set the needed variables (*change-me* variables). Crate a *terraform.tfvars* file, for more detail see [Oracle provider setup](#oracle-provider-setup) and read all the modules requirements in each module directory.
75
+
76
+
Or if you prefer you can create a new empty directory in your workspace and start a new project from scratch. To setup the project follow the README.md in the [examples](examples/) directory.
77
+
61
78
### Oracle provider setup
62
79
63
-
In any subdirectory of this repo you need to create a terraform.tfvars file, the file will look like:
80
+
This is an example of the *terraform.tfvars* file:
64
81
65
82
```
66
83
fingerprint = "<rsa_key_fingerprint>"
@@ -78,48 +95,71 @@ The compartment_ocid is the same as tenency_ocid.
78
95
79
96
The fingerprint is the fingerprint of your RSA key, you can find this vale under User setting > API Keys
80
97
81
-
###Other variables to adjust
98
+
#### How to find the availability doamin name
82
99
83
-
Before triggering the infrastructure deployment adjust the following variables (vars.tf in each subdirectory):
100
+
To find the list of the availability domains run this command on che Cloud Shell:
84
101
85
-
* region, set the correct region based on your needs
86
-
* availability_domain, set you availability domain, you can get the availability domain string in the "*Create instance* form. Once you are in the create instance procedure under the placement section click "Edit" and copy the string that begin with *iAdc:*. Example iAdc:EU-ZURICH-1-AD-1
87
-
* default_fault_domain, set de default fault domain, choose one of: FAULT-DOMAIN-1, FAULT-DOMAIN-2, FAULT-DOMAIN-3
88
-
* PATH_TO_PUBLIC_KEY, this variable have to point at your ssh public key
89
-
* oci_core_vcn_cidr, set the default VCN subnet cidr
90
-
* oci_core_subnet_cidr10, set the default subnet cidr
91
-
* oci_core_subnet_cidr11, set the secondary subnet cidr
92
-
* tutorial_tag_key, set a key used to tag all the deployed resources
93
-
* tutorial_tag_value, set the value of the tutorial_tag_key
94
-
* my_public_ip_address, set your public ip address
95
-
96
-
### Common resources
97
-
98
-
All the environments share the same network and security list configurations.
* One VCN (10.0.0.0/16 subnet), you can setup a custom network CIDR in oci_core_vcn_cidr variable.
103
-
* Two subnets, the first subnet (default) is the 10.0.0.0/24 range, the second subnet is 10.0.1.0/24 range. You can customize the subnets CIDR in oci_core_subnet_cidr10 and oci_core_subnet_cidr11 variables.
117
+
To filter the OS images by shape and OS run this command on che Cloud Shell:
* By default only the incoming ICMP, SSH and HTTP traffic is allowed from your public ip. You can setup your public ip in my_public_ip_address variable.
108
-
* By default all the outgoing traffic is allowed
109
-
* A second security list rule (Custom security list) open all the incoming http traffic
110
-
* Both default security list and the custom security list are associated on both subnets
111
-
* Network flow from the private VCN subnet is allowed
151
+
**Note:** this setup was only tested with Ubuntu 20.04
112
152
113
153
### Firewall
114
154
115
-
By default firewall on the compute instances is disabled. On some test the firewall has created some problems
155
+
By default firewall on the compute instances is disabled (except for the nat instance).
116
156
117
157
### Software installed
118
158
119
159
In the simple-instance example and in the instance-pool example nginx will be installed by default.
120
-
Nginx is used for testing the security list rules an the correct setup of the Load Balancer (instance-pool example).
160
+
Nginx is used for testing the security list rules an the correct setup of the Load Balancer.
121
161
122
-
On the k3s-cluster example, k3s will be automatically installed on all the machines.
162
+
On the k3s-cluster example, k3s will be automatically installed on all the machines.**NOTE** k3s-cluster setup has moved to [this](https://github.com/garutilorenzo/k3s-oci-cluster) repository.
0 commit comments