Skip to content

Commit e506766

Browse files
authored
Merge pull request #1668 from andrewsykim/vsphere-quick-start-cherrypick
📖 Updates to vSphere quick start based on upcoming v0.5.2 changes
2 parents d895aa5 + 80568bd commit e506766

File tree

2 files changed

+118
-81
lines changed

2 files changed

+118
-81
lines changed

docs/book/src/tasks/installation.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,36 @@ kubectl create -f {{#releaselink gomodule:"sigs.k8s.io/cluster-api-provider-dock
162162
{{#/tab }}
163163
{{#tab vSphere}}
164164

165-
Check the [vSphere provider releases](https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/releases) for an up-to-date components file.
166-
167-
For more information about prerequisites, credentials management, or permissions for vSphere, visit the [getting started guide](https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/blob/master/docs/getting_started.md).
165+
It is required to use an official CAPV machine image for your vSphere VM templates. See [Uploading CAPV Machine Images](https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/blob/master/docs/getting_started.md#uploading-the-capv-machine-image) for instructions on how to do this.
168166

169167
```bash
170-
kubectl create -f {{#releaselink gomodule:"sigs.k8s.io/cluster-api-provider-vsphere" asset:"infrastructure-components.yaml" version:"0.5.x"}}
168+
# Upload vCenter credentials as a Kubernetes secret
169+
$ cat <<EOF | kubectl apply -f -
170+
apiVersion: v1
171+
kind: Namespace
172+
metadata:
173+
labels:
174+
control-plane: controller-manager
175+
name: capv-system
176+
---
177+
apiVersion: v1
178+
kind: Secret
179+
metadata:
180+
name: capv-manager-bootstrap-credentials
181+
namespace: capv-system
182+
type: Opaque
183+
data:
184+
username: "<my vCenter username>"
185+
password: "<my vCenter password>"
186+
EOF
187+
188+
$ kubectl create -f {{#releaselink gomodule:"sigs.k8s.io/cluster-api-provider-vsphere" asset:"infrastructure-components.yaml" version:"0.5.x"}}
171189
```
172190

191+
Check the [vSphere provider releases](https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/releases) for an up-to-date components file.
192+
193+
For more information about prerequisites, credentials management, or permissions for vSphere, visit the [getting started guide](https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/blob/master/docs/getting_started.md).
194+
173195
{{#/tab }}
174196
{{#/tabs }}
175197

docs/book/src/user/quick-start.md

Lines changed: 92 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,17 @@ metadata:
6767
6868
<h1>Action Required</h1>
6969
70-
These examples include environment variables that you should substitute before creating the resources.
70+
This quick start assumes the following vSphere environment which you should replace based on your own environment.
71+
72+
| Property | Value | Description |
73+
|----------------|--------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
74+
| vCenter Server | 10.0.0.1 | The IP address or fully-qualified domain name (FQDN) of the vCenter server |
75+
| Datacenter | SDDC-Datacenter | The datacenter to which VMs will be deployed |
76+
| Datastore | DefaultDatastore | The datastore to use for VMs |
77+
| Resource Pool | '*/Resources' | The resource pool in which the VMs will be located. Please note that when using an * character in part of the inventory path, the entire value must be single quoted. |
78+
| VM Network | vm-network-1 | The VM network to use for VMs |
79+
| VM Folder | vm | The VM folder in which VMs will be located |
80+
| VM Template | ubuntu-1804-kube-v1.15.3 | The VM template to use for VMs |
7181
7282
</aside>
7383
@@ -90,22 +100,34 @@ kind: VSphereCluster
90100
metadata:
91101
name: capi-quickstart
92102
spec:
93-
server: "${VSPHERE_SERVER}"
94103
cloudProviderConfiguration:
95104
global:
96-
secretName: "cloud-provider-vsphere-credentials"
97-
secretNamespace: "kube-system"
98-
virtualCenter:
99-
"${VSPHERE_SERVER}":
100-
datacenters: "${VSPHERE_DATACENTER}"
105+
insecure: true
106+
secretName: cloud-provider-vsphere-credentials
107+
secretNamespace: kube-system
101108
network:
102-
name: "${VSPHERE_NETWORK}"
109+
name: vm-network-1
110+
providerConfig:
111+
cloud:
112+
controllerImage: gcr.io/cloud-provider-vsphere/cpi/release/manager:v1.0.0
113+
storage:
114+
attacherImage: quay.io/k8scsi/csi-attacher:v1.1.1
115+
controllerImage: gcr.io/cloud-provider-vsphere/csi/release/driver:v1.0.1
116+
livenessProbeImage: quay.io/k8scsi/livenessprobe:v1.1.0
117+
metadataSyncerImage: gcr.io/cloud-provider-vsphere/csi/release/syncer:v1.0.1
118+
nodeDriverImage: gcr.io/cloud-provider-vsphere/csi/release/driver:v1.0.1
119+
provisionerImage: quay.io/k8scsi/csi-provisioner:v1.2.1
120+
registrarImage: quay.io/k8scsi/csi-node-driver-registrar:v1.1.0
121+
virtualCenter:
122+
10.0.0.1:
123+
datacenters: SDDC-Datacenter
103124
workspace:
104-
server: "${VSPHERE_SERVER}"
105-
datacenter: "${VSPHERE_DATACENTER}"
106-
datastore: "${VSPHERE_DATASTORE}"
107-
resourcePool: "${VSPHERE_RESOURCE_POOL}"
108-
folder: "${VSPHERE_FOLDER}"
125+
datacenter: SDDC-Datacenter
126+
datastore: DefaultDatastore
127+
folder: vm
128+
resourcePool: '*/Resources'
129+
server: 10.0.0.1
130+
server: 10.0.0.1
109131
```
110132
{{#/tab }}
111133
{{#/tabs }}
@@ -221,7 +243,17 @@ spec:
221243
222244
<h1>Action Required</h1>
223245
224-
These examples include environment variables that you should substitute before creating the resources.
246+
This quick start assumes the following vSphere environment which you should replace based on your own environment:
247+
248+
| Property | Value | Description |
249+
|----------------|--------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
250+
| vCenter Server | 10.0.0.1 | The IP address or fully-qualified domain name (FQDN) of the vCenter server |
251+
| Datacenter | SDDC-Datacenter | The datacenter to which VMs will be deployed |
252+
| Datastore | DefaultDatastore | The datastore to use for VMs |
253+
| Resource Pool | '*/Resources' | The resource pool in which the VMs will be located. Please note that when using an * character in part of the inventory path, the entire value must be single quoted. |
254+
| VM Network | vm-network-1 | The VM network to use for VMs |
255+
| VM Folder | vm | The VM folder in which VMs will be located |
256+
| VM Template | ubuntu-1804-kube-v1.15.3 | The VM template to use for VMs |
225257
226258
</aside>
227259
@@ -248,65 +280,43 @@ spec:
248280
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
249281
kind: VSphereMachine
250282
metadata:
283+
labels:
284+
cluster.x-k8s.io/cluster-name: capi-quickstart
285+
cluster.x-k8s.io/control-plane: "true"
251286
name: capi-quickstart-controlplane-0
287+
namespace: default
252288
spec:
253-
datacenter: "${VSPHERE_DATACENTER}"
289+
datacenter: SDDC-Datacenter
290+
diskGiB: 50
291+
memoryMiB: 2048
254292
network:
255293
devices:
256-
- networkName: "${VSPHERE_NETWORK}"
257-
dhcp4: true
294+
- dhcp4: true
258295
dhcp6: false
259-
numCPUs: ${VSPHERE_NUM_CPUS}
260-
memoryMiB: ${VSPHERE_MEM_MIB}
261-
diskGiB: ${VSPHERE_DISK_GIB}
262-
template: "${VSPHERE_TEMPLATE}"
296+
networkName: vm-network-1
297+
numCPUs: 2
298+
template: ubuntu-1804-kube-v1.15.3
263299
---
264300
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha2
265301
kind: KubeadmConfig
266302
metadata:
267303
name: capi-quickstart-controlplane-0
304+
namespace: default
268305
spec:
269-
# For more information about these values,
270-
# refer to the Kubeadm Bootstrap Provider documentation.
271-
initConfiguration:
272-
nodeRegistration:
273-
name: "{{ ds.meta_data.hostname }}"
274-
criSocket: "/var/run/containerd/containerd.sock"
275-
kubeletExtraArgs:
276-
cloud-provider: vsphere
277306
clusterConfiguration:
278307
apiServer:
279308
extraArgs:
280-
cloud-provider: vsphere
281-
cloud-config: /etc/kubernetes/vsphere.conf
282-
extraVolumes:
283-
- name: "cloud-config"
284-
hostPath: /etc/kubernetes/vsphere.conf
285-
mountPath: /etc/kubernetes/vsphere.conf
286-
readOnly: true
287-
pathType: File
309+
cloud-provider: external
288310
controllerManager:
289311
extraArgs:
290-
cloud-provider: vsphere
291-
cloud-config: /etc/kubernetes/vsphere.conf
292-
extraVolumes:
293-
- name: "cloud-config"
294-
hostPath: /etc/kubernetes/vsphere.conf
295-
mountPath: /etc/kubernetes/vsphere.conf
296-
readOnly: true
297-
pathType: File
298-
files:
299-
- path: /etc/kubernetes/vsphere.conf
300-
owner: root:root
301-
permissions: "0600"
302-
encoding: base64
303-
content: |
304-
${CLOUD_CONFIG_B64ENCODED}
305-
users:
306-
- name: capv
307-
sudo: "ALL=(ALL) NOPASSWD:ALL"
308-
sshAuthorizedKeys:
309-
- "${SSH_AUTHORIZED_KEY}"
312+
cloud-provider: external
313+
imageRepository: k8s.gcr.io
314+
initConfiguration:
315+
nodeRegistration:
316+
criSocket: /var/run/containerd/containerd.sock
317+
kubeletExtraArgs:
318+
cloud-provider: external
319+
name: '{{ ds.meta_data.hostname }}'
310320
preKubeadmCommands:
311321
- hostname "{{ ds.meta_data.hostname }}"
312322
- echo "::1 ipv6-localhost ipv6-loopback" >/etc/hosts
@@ -537,7 +547,17 @@ spec:
537547
538548
<h1>Action Required</h1>
539549
540-
These examples include environment variables that you should substitute before creating the resources.
550+
This quick start assumes the following vSphere environment which you should replace based on your own environment:
551+
552+
| Property | Value | Description |
553+
|----------------|--------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
554+
| vCenter Server | 10.0.0.1 | The IP address or fully-qualified domain name (FQDN) of the vCenter server |
555+
| Datacenter | SDDC-Datacenter | The datacenter to which VMs will be deployed |
556+
| Datastore | DefaultDatastore | The datastore to use for VMs |
557+
| Resource Pool | '*/Resources' | The resource pool in which the VMs will be located. Please note that when using an * character in part of the inventory path, the entire value must be single quoted. |
558+
| VM Network | vm-network-1 | The VM network to use for VMs |
559+
| VM Folder | vm | The VM folder in which VMs will be located |
560+
| VM Template | ubuntu-1804-kube-v1.15.3 | The VM template to use for VMs |
541561
542562
</aside>
543563
@@ -578,41 +598,36 @@ spec:
578598
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
579599
kind: VSphereMachineTemplate
580600
metadata:
581-
name: capi-quickstart-worker
601+
name: capi-quickstart-md-0
602+
namespace: default
582603
spec:
583604
template:
584605
spec:
585-
datacenter: "${VSPHERE_DATACENTER}"
606+
datacenter: SDDC-Datacenter
607+
diskGiB: 50
608+
memoryMiB: 2048
586609
network:
587610
devices:
588-
- networkName: "${VSPHERE_NETWORK}"
589-
dhcp4: true
611+
- dhcp4: true
590612
dhcp6: false
591-
numCPUs: ${VSPHERE_NUM_CPUS}
592-
memoryMiB: ${VSPHERE_MEM_MIB}
593-
diskGiB: ${VSPHERE_DISK_GIB}
594-
template: "${VSPHERE_TEMPLATE}"
613+
networkName: vm-network-1
614+
numCPUs: 2
615+
template: ubuntu-1804-kube-v1.15.3
595616
---
596617
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha2
597618
kind: KubeadmConfigTemplate
598619
metadata:
599-
name: capi-quickstart-worker
620+
name: capi-quickstart-md-0
621+
namespace: default
600622
spec:
601623
template:
602624
spec:
603-
# For more information about these values,
604-
# refer to the Kubeadm Bootstrap Provider documentation.
605625
joinConfiguration:
606626
nodeRegistration:
607-
name: "{{ ds.meta_data.hostname }}"
608-
criSocket: "/var/run/containerd/containerd.sock"
627+
criSocket: /var/run/containerd/containerd.sock
609628
kubeletExtraArgs:
610-
cloud-provider: vsphere
611-
users:
612-
- name: capv
613-
sudo: "ALL=(ALL) NOPASSWD:ALL"
614-
sshAuthorizedKeys:
615-
- "${SSH_AUTHORIZED_KEY}"
629+
cloud-provider: external
630+
name: '{{ ds.meta_data.hostname }}'
616631
preKubeadmCommands:
617632
- hostname "{{ ds.meta_data.hostname }}"
618633
- echo "::1 ipv6-localhost ipv6-loopback" >/etc/hosts

0 commit comments

Comments
 (0)