Skip to content

Commit 11026b6

Browse files
committed
Rewrite to new quick install
1 parent f46c527 commit 11026b6

File tree

4 files changed

+159
-426
lines changed

4 files changed

+159
-426
lines changed

OCNE/.env

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
# + 3GB memory minimum required for Istio module on Worker nodes
2121
# OPERATOR_CPUS=1
2222
# OPERATOR_MEMORY=1024
23-
# MASTER_CPUS=2
24-
# MASTER_MEMORY=2048
23+
# CONTROLPLANE_CPUS=2
24+
# CONTROLPLANE_MEMORY=2048
2525
# WORKER_CPUS=1
2626
# WORKER_MEMORY=1024
2727

@@ -30,12 +30,12 @@
3030

3131
# Create a separate instance for the operator node?
3232
# The default is to install the Platform API Server and CLI tool on
33-
# the (first) master node
33+
# the (first) control_plane node
3434
# STANDALONE_OPERATOR=false
3535

36-
# Multi-master setup. Deploy 3 masters in HA mode.
36+
# Multi-control_plane setup. Deploy 3 control_planes in HA mode.
3737
# Will automatically enable STANDALONE_OPERATOR if true
38-
# MULTI_MASTER=false
38+
# MULTI_CONTROLPLANE=false
3939

4040
# Creates an extra disk (/dev/sdb) so it can be used as a
4141
# Gluster Storage for Kubernetes Persistent Volumes
@@ -44,7 +44,7 @@
4444
# Number of worker nodes to provision
4545
# NB_WORKERS=2
4646

47-
# Bind the kubectl proxy from the (first) master to the vagrant host
47+
# Bind the kubectl proxy from the (first) control_plane to the vagrant host
4848
# BIND_PROXY=false
4949

5050
# Additional yum channel to consider (e.g. local repo)
@@ -58,9 +58,6 @@
5858
# Check the README.md file for more details.
5959
# REGISTRY_OCNE='container-registry.oracle.com/olcne'
6060

61-
# Use specific NGINX version (mainly used for development)
62-
# NGINX_IMAGE=nginx:1.17.7
63-
6461
# Environment and cluster names
6562
# OCNE_ENV_NAME="ocne-env"
6663
# OCNE_CLUSTER_NAME="ocne-cluster"
@@ -92,9 +89,9 @@
9289
# DEPLOY_METALLB=false
9390
# METALLB_MODULE_NAME="ocne-metallb"
9491

95-
# Override number of masters to deploy
92+
# Override number of control_planes to deploy
9693
# This should not be changed -- for development purpose
97-
# NB_MASTERS=1
94+
# NB_CONTROLPLANES=1
9895

9996
# Update Base OS (experimental)
10097
# UPDATE_OS=false

OCNE/README.md

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
This Vagrant project will deploy and configure the following components:
44

5-
- One or more master nodes (one by default, 3 in HA mode)
5+
- One or more control plane nodes (one by default, 3 in HA mode)
66
- One or more worker nodes (2 by default)
77
- An optional operator node for the Oracle Cloud Native Environment
88
Platform API Server and Platform CLI tool (default is to install these
9-
components on the first master node)
9+
components on the first control plane node)
1010

11-
If you enable multiple master nodes, an operator node is automatically deployed
11+
If you enable multiple control plane nodes, an operator node is automatically deployed
1212
to provide egress routing for the cluster.
1313

14-
All master and worker nodes will have the Oracle Cloud Native
14+
All control plane and worker nodes will have the Oracle Cloud Native
1515
Environment Platform Agent installed and configured to communicate with the
1616
Platform API Server on the operator node.
1717

@@ -45,7 +45,7 @@ makes configuration much easier
4545

4646
Your Oracle Cloud Native Environment is ready!
4747

48-
From any master node (e.g. master1) you can check the status of the cluster (as
48+
From any control plane node (e.g. controlplane1) you can check the status of the cluster (as
4949
the `vagrant` user). E.g.:
5050

5151
- `kubectl cluster-info`
@@ -61,16 +61,16 @@ to the Dashboard from a browser on your Vagrant host, you will need to set
6161

6262
To access the Kubernetes Dashboard, remember to use `localhost` or `127.0.0.1`
6363
in the URL, i.e. <http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/>.
64-
To obtain token from any Master node, you may run: `kubectl -n kubernetes-dashboard get secret -o=jsonpath='{.items[?(@.metadata.annotations.kubernetes\.io/service-account\.name=="kubernetes-dashboard")].data.token}' | base64 --decode`
64+
To obtain token from any Control plane node, you may run: `kubectl -n kubernetes-dashboard get secret -o=jsonpath='{.items[?(@.metadata.annotations.kubernetes\.io/service-account\.name=="kubernetes-dashboard")].data.token}' | base64 --decode`
6565

6666
## About the `Vagrantfile`
6767

6868
The VMs communicate via a private network:
6969

7070
- Controller node IP: 192.168.99.100 (if `STANDALONE_OPERATOR=true`)
71-
- Master node _i_: 192.168.99.(100+ _i_ ) / master *_i_* .vagrant.vm
71+
- Control plane node _i_: 192.168.99.(100+ _i_ ) / controlplane *_i_* .vagrant.vm
7272
- Worker node _i_: 192.168.99.(110+ _i_ ) / worker *_i_* .vagrant.vm
73-
- Master Virtual IP: 192.168.99.99 (if `MULTI_MASTER=true`)
73+
- Control plane Virtual IP: 192.168.99.99 (if `MULTI_CONTROL_PLANE=true`)
7474
- LoadBalancer IPs: 192.168.99.240 - 192.168.99.250 (if `DEPLOY_METALLB=true`)
7575

7676
## Configuration
@@ -107,24 +107,24 @@ is installed)
107107
- `VERBOSE` (default: `false`): verbose output during VM deployment.
108108
- `WORKER_CPUS` (default: `1`): Provision Worker Node with 1 vCPU.
109109
- `WORKER_MEMORY` (default: `1024`): Provision Worker Node with 1GB memory.
110-
- `MASTER_CPUS` (default: `2`): At least 2 vCPUS are required for Master Nodes.
111-
- `MASTER_MEMORY` (default: `2048`): At least 1700MB are required for Master Nodes.
112-
- `OPERATOR_CPUS` (default: `1`): Only applicable if `STANDALONE_OPERATOR=true` or `MULTI_MASTER=true`.
113-
- `OPERATOR_MEMORY` (default: `1024`): Only applicable if `STANDALONE_OPERATOR=true` or `MULTI_MASTER=true`.
110+
- `CONTROL_PLANE_CPUS` (default: `2`): At least 2 vCPUS are required for Control plane Nodes.
111+
- `CONTROL_PLANE_MEMORY` (default: `2048`): At least 1700MB are required for Control plane Nodes.
112+
- `OPERATOR_CPUS` (default: `1`): Only applicable if `STANDALONE_OPERATOR=true` or `MULTI_CONTROL_PLANE=true`.
113+
- `OPERATOR_MEMORY` (default: `1024`): Only applicable if `STANDALONE_OPERATOR=true` or `MULTI_CONTROL_PLANE=true`.
114114
- `VB_GROUP` (default: `OCNE`): group all VirtualBox VMs under this label.
115115
- `EXTRA_DISK` (default: `false`): Creates an extra disk (`/dev/sdb`) on Worker nodes that can be used for GlusterFS for Kubernetes Persistent Volumes
116116

117117
### Cluster parameters
118118

119-
- `STANDALONE_OPERATOR` (default: `false` unless `MULTI_MASTER=true`): create
119+
- `STANDALONE_OPERATOR` (default: `false` unless `MULTI_CONTROL_PLANE=true`): create
120120
a separate VM for the operator node -- default is to install the operator
121-
components on the (first) master node.
122-
- `MULTI_MASTER` (default: `false`): multi-master setup. Deploy 3 masters in
121+
components on the (first) control plane node.
122+
- `MULTI_CONTROL_PLANE` (default: `false`): multi-control-plane setup. Deploy 3 control planes in
123123
HA mode.
124124
- `NB_WORKERS` (default: `2`): number of worker nodes to provision.
125125
At least one worker node is required.
126126
- `BIND_PROXY` (default: `false`): bind the kubectl proxy port (8001) from the
127-
(first) master to the Vagrant host. This is required if you want to access the
127+
(first) control plane to the Vagrant host. This is required if you want to access the
128128
Kubernetes Dashboard from a browser on your host.
129129
__Note__: you only need this if you want to expose the kubectl proxy to other
130130
hosts in your network.
@@ -165,9 +165,7 @@ The following syntax can be used to specify a mirror:
165165
Danger zone!
166166
Mainly used for development.
167167

168-
- The following parameters can be set to use specific component version:
169-
`OLCNE_VERSION`, `NGINX_IMAGE`.
170-
- `NB_MASTERS` (default: none): override number of masters to deploy. Requires `MULTI_MASTER=true` to function properly.
168+
- `NB_CONTROL_PLANES` (default: none): override number of control planes to deploy. Requires `MULTI_CONTROL_PLANE=true` to function properly.
171169
- `SUBNET` (default: `192.168.99`): Set the VM provider host-only / private network subnet.
172170
- `UPDATE_OS` (default: false): Runs `dnf -y update` on the VM.
173171

OCNE/Vagrantfile

Lines changed: 40 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
# vi: set ft=ruby :
1515

1616
# This Vagrantfile creates an Oracle Cloud Native Environment and
17-
# deploys the Kubernetes module to the master and worker nodes.
17+
# deploys the Kubernetes module to the control plane and worker nodes.
1818
# VMs communicate via a private network using subnet 192.168.99.* (by default):
19-
# - HA Master IP: 192.168.99.99 (Virtual IP, when in HA mode)
20-
# - Operator : 192.168.99.100 (Optional, none by default)
21-
# - Master i : 192.168.99.(100+i) (1 by default, 3 in HA mode)
22-
# - Worker i : 192.168.99.(110+i) (2 by default)
23-
# - MetalLB Pool: 192.168.99.240 - 192.168.99.250
19+
# - HA Control plane IP: 192.168.99.99 (Virtual IP, when in HA mode)
20+
# - Operator : 192.168.99.100 (Optional, none by default)
21+
# - Control plane i : 192.168.99.(100+i) (1 by default, 3 in HA mode)
22+
# - Worker i : 192.168.99.(110+i) (2 by default)
23+
# - MetalLB Pool : 192.168.99.240 - 192.168.99.250
2424
#
2525
# Optional plugins:
2626
# vagrant-hosts (maintains /etc/hosts for the VMs)
@@ -54,24 +54,24 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
5454
# vCPUS and Memory for the VMs
5555
OPERATOR_CPUS = default_i('OPERATOR_CPUS', 1)
5656
OPERATOR_MEMORY = default_i('OPERATOR_MEMORY', 1024)
57-
MASTER_CPUS = default_i('MASTER_CPUS', 2)
58-
MASTER_MEMORY = default_i('MASTER_MEMORY', 2048)
57+
CONTROL_PLANE_CPUS = default_i('CONTROL_PLANE_CPUS', 2)
58+
CONTROL_PLANE_MEMORY = default_i('CONTROL_PLANE_MEMORY', 2048)
5959
WORKER_CPUS = default_i('WORKER_CPUS', 1)
6060
WORKER_MEMORY = default_i('WORKER_MEMORY', 1024)
6161

6262
# Group VirtualBox containers
6363
VB_GROUP = default_s('VB_GROUP', 'OCNE')
6464

65-
# Multi-master setup. Deploy 3 masters in HA mode.
66-
MULTI_MASTER = default_b('MULTI_MASTER', false)
65+
# Multi-control-plane setup. Deploy 3 control planes in HA mode.
66+
MULTI_CONTROL_PLANE = default_b('MULTI_CONTROL_PLANE', false)
6767

6868
# Separate operator node for the Oracle Cloud Native Environment
6969
# Platform API Server and Platform Agent (default is to install the
70-
# components on the (first) master node
70+
# components on the (first) control plane node
7171
#
72-
# If multi-master is enabled, the standalone operator is automatically
72+
# If multi-control-plane is enabled, the standalone operator is automatically
7373
# enabled for routing purposes
74-
if MULTI_MASTER
74+
if MULTI_CONTROL_PLANE
7575
STANDALONE_OPERATOR = true
7676
else
7777
STANDALONE_OPERATOR = default_b('STANDALONE_OPERATOR', false)
@@ -81,14 +81,14 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
8181
# Gluster Storage for Kubernetes Persistent Volumes
8282
EXTRA_DISK = default_b('EXTRA_DISK', false)
8383

84-
# Override number of masters to deploy
84+
# Override number of control planes to deploy
8585
# This should not be changed -- for development purpose
86-
NB_MASTERS = default_i('NB_MASTERS', MULTI_MASTER ? 3 : 1)
86+
NB_CONTROL_PLANES = default_i('NB_CONTROL_PLANES', MULTI_CONTROL_PLANE ? 3 : 1)
8787

8888
# Number of worker nodes to provision
8989
NB_WORKERS = default_i('NB_WORKERS', 2)
9090

91-
# Bind the kubectl proxy from the (first) master to the vagrant host
91+
# Bind the kubectl proxy from the (first) control plane to the vagrant host
9292
BIND_PROXY = default_b('BIND_PROXY', false)
9393

9494
# Additional yum channel to consider (e.g. local repo)
@@ -138,9 +138,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
138138
METALLB_MODULE_NAME = default_s('METALLB_MODULE_NAME', 'ocne-metallb')
139139
GLUSTER_MODULE_NAME = default_s('GLUSTER_MODULE_NAME', 'ocne-gluster')
140140

141-
# Use specific component version (mainly used for development)
142-
NGINX_IMAGE = default_s('NGINX_IMAGE', 'nginx:1.17.7')
143-
144141
# Update Base OS
145142
UPDATE_OS = default_b('UPDATE_OS', false)
146143

@@ -178,7 +175,7 @@ def provision_vm(vm, vm_args)
178175
args = vm_args.clone
179176
args.push("--ocne-environment-name", OCNE_ENV_NAME)
180177
args.push("--ocne-cluster-name", OCNE_CLUSTER_NAME)
181-
args.push("--multi-master") if MULTI_MASTER
178+
args.push("--multi-control-plane") if MULTI_CONTROL_PLANE
182179
args.push("--repo", YUM_REPO) unless YUM_REPO == ""
183180
args.push("--ocne-dev") if OCNE_DEV
184181
args.push("--pod-network", POD_NETWORK) if POD_NETWORK
@@ -206,6 +203,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
206203

207204
config.vm.box = BOX_NAME
208205
config.vm.box_url = "#{BOX_URL}/#{BOX_NAME}.json"
206+
# config.vm.box_version = "8.6.359"
209207

210208
# If we use the vagrant-proxyconf plugin, we should not proxy k8s/local IPs
211209
# Unfortunately we can't use CIDR with no_proxy, so we have to enumerate and
@@ -263,6 +261,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
263261
ip = 110 + i
264262
ip_addr = "#{SUBNET}.#{ip}"
265263
workers += "#{ip_addr},"
264+
# worker.vm.network :private_network, nic_type: "virtio", ip: ip_addr, nm_controlled: "yes"
266265
worker.vm.network :private_network, nic_type: "virtio", ip: ip_addr
267266
if Vagrant.has_plugin?("vagrant-hosts")
268267
worker.vm.provision :hosts, :sync_hosts => true, :add_localhost_hostnames => false
@@ -289,42 +288,42 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
289288
end
290289
end
291290

292-
# Masters provisioning
293-
masters = ""
294-
NB_MASTERS.downto(1) do |i|
295-
config.vm.define "master#{i}" do |master|
296-
master.vm.hostname = "master#{i}.vagrant.vm"
291+
# Control plane provisioning
292+
control_planes = ""
293+
NB_CONTROL_PLANES.downto(1) do |i|
294+
config.vm.define "controlplane#{i}" do |control_plane|
295+
control_plane.vm.hostname = "controlplane#{i}.vagrant.vm"
297296
ip = 100 + i
298297
ip_addr = "#{SUBNET}.#{ip}"
299-
masters += "#{ip_addr},"
300-
master.vm.network :private_network, nic_type: "virtio", ip: ip_addr
298+
control_planes += "#{ip_addr},"
299+
control_plane.vm.network :private_network, nic_type: "virtio", ip: ip_addr
301300
if Vagrant.has_plugin?("vagrant-hosts")
302-
master.vm.provision :hosts, :sync_hosts => true, :add_localhost_hostnames => false
301+
control_plane.vm.provision :hosts, :sync_hosts => true, :add_localhost_hostnames => false
303302
end
304-
master.vm.provider :virtualbox do |vb|
305-
vb.name = "master#{i}"
306-
vb.memory = MASTER_MEMORY
307-
vb.cpus = MASTER_CPUS
303+
control_plane.vm.provider :virtualbox do |vb|
304+
vb.name = "control_plane#{i}"
305+
vb.memory = CONTROL_PLANE_MEMORY
306+
vb.cpus = CONTROL_PLANE_CPUS
308307
end
309308
config.vm.provider :libvirt do |lv|
310-
lv.memory = MASTER_MEMORY
311-
lv.cpus = MASTER_CPUS
309+
lv.memory = CONTROL_PLANE_MEMORY
310+
lv.cpus = CONTROL_PLANE_CPUS
312311
end
313312
if BIND_PROXY && i == 1
314313
# Bind kubectl proxy port
315-
master.vm.network :forwarded_port, guest: 8001, host: 8001
314+
control_plane.vm.network :forwarded_port, guest: 8001, host: 8001
316315
end
317316
# Update OS if UPDATE_OS=true
318-
update_os(master.vm)
319-
# Provisioning: Master Node
320-
args = ["--master", "--nginx-image", NGINX_IMAGE]
317+
update_os(control_plane.vm)
318+
# Provisioning: Control plane Node
319+
args = ["--control-plane"]
321320
if !STANDALONE_OPERATOR && i == 1
322321
args.push("--operator")
323322
args.push("--subnet", SUBNET)
324323
args.push("--workers", workers.chop)
325-
args.push("--masters", masters.chop)
324+
args.push("--control-planes", control_planes.chop)
326325
end
327-
provision_vm(master.vm, args)
326+
provision_vm(control_plane.vm, args)
328327
end
329328
end
330329

@@ -351,8 +350,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
351350
args = ["--operator"]
352351
args.push("--subnet", SUBNET)
353352
args.push("--workers", workers.chop)
354-
args.push("--masters", masters.chop)
355-
args.push("--nginx-image", NGINX_IMAGE)
353+
args.push("--control-planes", control_planes.chop)
356354
provision_vm(operator.vm, args)
357355
end
358356
end

0 commit comments

Comments
 (0)