Skip to content

Commit e0e50d8

Browse files
Merge pull request #484 from jromers/ocne_quickinstall
Ocne quickinstall procedure with "olcnectl provision"
2 parents f46c527 + 6752009 commit e0e50d8

File tree

4 files changed

+252
-397
lines changed

4 files changed

+252
-397
lines changed

OCNE/.env

Lines changed: 9 additions & 15 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+
# CONTROL_PLANE_CPUS=2
24+
# CONTROL_PLANE_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_CONTROL_PLANE=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,17 +58,11 @@
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"
6764

68-
# Pod networking technology: flannel, calico, none. Note: flannel is deprecated.
69-
# POD_NETWORK=calico
70-
71-
# Deploy Calico networking module? Sets POD_NETWORK=none. Place your config file in the current directory named: calico-config.yaml
65+
# Deploy Calico networking module? Place your config file in the current directory named: calico-config.yaml
7266
# DEPLOY_CALICO=false
7367
# CALICO_MODULE_NAME="ocne-calico"
7468

@@ -92,9 +86,9 @@
9286
# DEPLOY_METALLB=false
9387
# METALLB_MODULE_NAME="ocne-metallb"
9488

95-
# Override number of masters to deploy
89+
# Override number of control_planes to deploy
9690
# This should not be changed -- for development purpose
97-
# NB_MASTERS=1
91+
# NB_CONTROL_PLANES=1
9892

9993
# Update Base OS (experimental)
10094
# UPDATE_OS=false

OCNE/README.md

Lines changed: 18 additions & 21 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

@@ -21,7 +21,7 @@ configured to use the CRI-O runtime interface. Two runtime engines are installed
2121
[runC](https://docs.oracle.com/en/operating-systems/olcne/1.6/runtimes/runc.html#runc)
2222
and (now deprecated) [Kata](https://docs.oracle.com/en/operating-systems/olcne/1.6/runtimes/kata.html#kata) Containers.
2323

24-
You may set your cluster networking to Calico (default), Flannel (deprecated) or Multus on top of either Calico or Flannel.
24+
You may set your cluster networking to Flannel (default), Calico or Multus on top of either Calico or Flannel.
2525

2626
You may optionally enable the deployment of Istio, MetalLB or Gluster (deprecated)
2727
modules. Note that Helm is now installed automatically.
@@ -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,28 +107,27 @@ 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.
131-
- `POD_NETWORK` (default: `calico`): deploys the Calico networking module with default configuration. Can be set to [`calico`, `flannel`, `none`].
132131
- `DEPLOY_CALICO` (default: `false`): deploys the Calico networking module with custom configuration `calico-config.yaml`.
133132
- `DEPLOY_MULTUS` (default: `false`): deploys the Multus networking module with custom configuration `multus-config.yaml`.
134133
- `DEPLOY_HELM` (default: `false`): deploys the Helm module (deprecated).
@@ -165,9 +164,7 @@ The following syntax can be used to specify a mirror:
165164
Danger zone!
166165
Mainly used for development.
167166

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.
167+
- `NB_CONTROL_PLANES` (default: none): override number of control planes to deploy. Requires `MULTI_CONTROL_PLANE=true` to function properly.
171168
- `SUBNET` (default: `192.168.99`): Set the VM provider host-only / private network subnet.
172169
- `UPDATE_OS` (default: false): Runs `dnf -y update` on the VM.
173170

OCNE/Vagrantfile

Lines changed: 40 additions & 50 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)
@@ -112,13 +112,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
112112
# Deploy Multus networking module?
113113
DEPLOY_MULTUS = default_b('DEPLOY_MULTUS', false)
114114

115-
# Pod networking technology: flannel, calico, none. Note: flannel is deprecated.
116-
if DEPLOY_CALICO
117-
POD_NETWORK = 'none'
118-
else
119-
POD_NETWORK = default_s('POD_NETWORK', 'calico')
120-
end
121-
122115
# Deploy Istio?
123116
DEPLOY_ISTIO = default_b('DEPLOY_ISTIO', false)
124117

@@ -138,9 +131,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
138131
METALLB_MODULE_NAME = default_s('METALLB_MODULE_NAME', 'ocne-metallb')
139132
GLUSTER_MODULE_NAME = default_s('GLUSTER_MODULE_NAME', 'ocne-gluster')
140133

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

@@ -178,10 +168,9 @@ def provision_vm(vm, vm_args)
178168
args = vm_args.clone
179169
args.push("--ocne-environment-name", OCNE_ENV_NAME)
180170
args.push("--ocne-cluster-name", OCNE_CLUSTER_NAME)
181-
args.push("--multi-master") if MULTI_MASTER
171+
args.push("--multi-control-plane") if MULTI_CONTROL_PLANE
182172
args.push("--repo", YUM_REPO) unless YUM_REPO == ""
183173
args.push("--ocne-dev") if OCNE_DEV
184-
args.push("--pod-network", POD_NETWORK) if POD_NETWORK
185174
args.push("--with-calico") if DEPLOY_CALICO
186175
args.push("--calico-module-name", CALICO_MODULE_NAME) if DEPLOY_CALICO
187176
args.push("--with-multus") if DEPLOY_MULTUS
@@ -206,6 +195,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
206195

207196
config.vm.box = BOX_NAME
208197
config.vm.box_url = "#{BOX_URL}/#{BOX_NAME}.json"
198+
# config.vm.box_version = "8.6.359"
209199

210200
# If we use the vagrant-proxyconf plugin, we should not proxy k8s/local IPs
211201
# Unfortunately we can't use CIDR with no_proxy, so we have to enumerate and
@@ -263,6 +253,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
263253
ip = 110 + i
264254
ip_addr = "#{SUBNET}.#{ip}"
265255
workers += "#{ip_addr},"
256+
# worker.vm.network :private_network, nic_type: "virtio", ip: ip_addr, nm_controlled: "yes"
266257
worker.vm.network :private_network, nic_type: "virtio", ip: ip_addr
267258
if Vagrant.has_plugin?("vagrant-hosts")
268259
worker.vm.provision :hosts, :sync_hosts => true, :add_localhost_hostnames => false
@@ -289,42 +280,42 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
289280
end
290281
end
291282

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"
283+
# Control plane provisioning
284+
control_planes = ""
285+
NB_CONTROL_PLANES.downto(1) do |i|
286+
config.vm.define "controlplane#{i}" do |control_plane|
287+
control_plane.vm.hostname = "controlplane#{i}.vagrant.vm"
297288
ip = 100 + i
298289
ip_addr = "#{SUBNET}.#{ip}"
299-
masters += "#{ip_addr},"
300-
master.vm.network :private_network, nic_type: "virtio", ip: ip_addr
290+
control_planes += "#{ip_addr},"
291+
control_plane.vm.network :private_network, nic_type: "virtio", ip: ip_addr
301292
if Vagrant.has_plugin?("vagrant-hosts")
302-
master.vm.provision :hosts, :sync_hosts => true, :add_localhost_hostnames => false
293+
control_plane.vm.provision :hosts, :sync_hosts => true, :add_localhost_hostnames => false
303294
end
304-
master.vm.provider :virtualbox do |vb|
305-
vb.name = "master#{i}"
306-
vb.memory = MASTER_MEMORY
307-
vb.cpus = MASTER_CPUS
295+
control_plane.vm.provider :virtualbox do |vb|
296+
vb.name = "control_plane#{i}"
297+
vb.memory = CONTROL_PLANE_MEMORY
298+
vb.cpus = CONTROL_PLANE_CPUS
308299
end
309300
config.vm.provider :libvirt do |lv|
310-
lv.memory = MASTER_MEMORY
311-
lv.cpus = MASTER_CPUS
301+
lv.memory = CONTROL_PLANE_MEMORY
302+
lv.cpus = CONTROL_PLANE_CPUS
312303
end
313304
if BIND_PROXY && i == 1
314305
# Bind kubectl proxy port
315-
master.vm.network :forwarded_port, guest: 8001, host: 8001
306+
control_plane.vm.network :forwarded_port, guest: 8001, host: 8001
316307
end
317308
# Update OS if UPDATE_OS=true
318-
update_os(master.vm)
319-
# Provisioning: Master Node
320-
args = ["--master", "--nginx-image", NGINX_IMAGE]
309+
update_os(control_plane.vm)
310+
# Provisioning: Control plane Node
311+
args = ["--control-plane"]
321312
if !STANDALONE_OPERATOR && i == 1
322313
args.push("--operator")
323314
args.push("--subnet", SUBNET)
324315
args.push("--workers", workers.chop)
325-
args.push("--masters", masters.chop)
316+
args.push("--control-planes", control_planes.chop)
326317
end
327-
provision_vm(master.vm, args)
318+
provision_vm(control_plane.vm, args)
328319
end
329320
end
330321

@@ -351,8 +342,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
351342
args = ["--operator"]
352343
args.push("--subnet", SUBNET)
353344
args.push("--workers", workers.chop)
354-
args.push("--masters", masters.chop)
355-
args.push("--nginx-image", NGINX_IMAGE)
345+
args.push("--control-planes", control_planes.chop)
356346
provision_vm(operator.vm, args)
357347
end
358348
end

0 commit comments

Comments
 (0)