-
Notifications
You must be signed in to change notification settings - Fork 11
/
preparing-kubernetes-cluster.html.md.erb
158 lines (113 loc) · 7.14 KB
/
preparing-kubernetes-cluster.html.md.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
---
title: Preparing the Kubernetes Cluster
owner: Tanzu Application Service Release Engineering
---
This topic describes how to create and configure Kubernetes clusters to support
<%= vars.app_runtime_full %> (<%= vars.app_runtime_short %>).
## <a id='overview'></a> Overview
<%= vars.app_runtime_short %> supports Kubernetes clusters in
VMware Tanzu Kubernetes Grid Integrated Edition (TKGI) and VMware Tanzu Kubernetes Grid (TKG) environments.
Before creating or configuring Kubernetes clusters in these environments,
ensure your environment and configurations support <%= vars.app_runtime_short %>:
* [VMware Tanzu Kubernetes Grid Integrated Edition](#tkgi)
* [VMware Tanzu Kubernetes Grid](#grid)
Before using Kubernetes clusters created in these environments, complete the following validations:
* [Ensure kubectl Targets Your Cluster](#ensure-kubectl-target)
* [Verify That a Default Storage Class Exists](#verify-default-storage)
## <a id='tkgi'></a> Tanzu Kubernetes Grid Integrated Edition
<%= vars.app_runtime_short %> supports Kubernetes clusters in VMware Tanzu Kubernetes Grid Integrated Edition environments.
Ensure the following before creating or configuring Kubernetes clusters
for <%= vars.app_runtime_short %> on TKGI:
* Your TKGI version is v1.7 or later.
* Your Kubernetes clusters have been created with the following characteristics:
* The Kubernetes cluster has at least 5 worker nodes.
* Each worker node has at least 2 CPU and 7.5 GB of memory available for allocation.
* The worker nodes in the Kubernetes clusters trust the container image registry that
<%= vars.app_runtime_short %> uses to store buildpack-based app images.
If the registry has a certificate issued from a private certificate authority (CA),
this typically entails configuring the worker nodes in the Kubernetes cluster to trust
the certificate of that CA.
For information about creating a cluster with TKGI,
see [Creating Clusters](https://docs.pivotal.io/tkgi/create-cluster.html)
in the TKGI documentation.
<p class="note"><strong>Note:</strong> TKGI was formerly known as Enterprise PKS.</p>
## <a id='grid'></a> VMware Tanzu Kubernetes Grid
<%= vars.app_runtime_short %> supports Kubernetes clusters in VMware Tanzu Kubernetes Grid environments.
Ensure the following before creating or configuring Kubernetes clusters
for <%= vars.app_runtime_short %> on TKG:
* Your Tanzu Kubernetes Grid version is 1.0 or later.
* Your Tanzu Kubernetes Grid environment includes `metrics-server`.
<BR>
TKG does not bundle `metrics-server`, which is required by Tanzu Application Service.
To deploy `metrics-server`, complete the steps in [Deploy `metrics-server` to Tanzu Kubernetes Grid](#deploy-metrics-server).
* Your Kubernetes clusters have been created with the following characteristics:
* The Kubernetes cluster has at least 5 worker nodes.
* Each worker node has at least 2 CPU and 7.5 GB of memory available for allocation.
* The worker nodes in the Kubernetes clusters trust the container image registry that
<%= vars.app_runtime_short %> uses to store buildpack-based app images.
If the registry has a certificate issued from a private certificate authority (CA),
this typically entails configuring the worker nodes in the Kubernetes cluster to trust
the certificate of that CA.
For information about setting up TKG, see [Installing Tanzu Kubernetes Grid]
(https://docs.vmware.com/en/VMware-Tanzu-Kubernetes-Grid/1.0/vmware-tanzu-kubernetes-grid-10/GUID-install-tkg-index.html).
### <a id='deploy-metrics-server'></a> Deploy `metrics-server` to Tanzu Kubernetes Grid
TKG does not bundle `metrics-server`, which is required by Tanzu Application Service.
To deploy `metrics-server`, complete either of the following:
* Use a basic `kubectl apply` command:
1. Run the following `kubectl apply` command:
```
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.4.1/components.yaml
```
1. If this `kubectl apply` command fails, add the `--kubelet-insecure-tls` flag
to the `args` on the `metrics-server` container of the `metrics-server` deployment.
* Use `kubectl apply` with a custom configuration:
1. Create a file named `add-kubelet-insecure-tls-to-metrics-server.yml`.
1. Add the following to the new `add-kubelet-insecure-tls-to-metrics-server.yml` file and save:
```
#@ load("@ytt:overlay", "overlay")
#@overlay/match by=overlay.subset({"kind": "Deployment", "metadata":{"name":"metrics-server"}}),expects=1
---
spec:
template:
spec:
containers:
#@overlay/match by=overlay.subset({"name": "metrics-server"}),expects=1
- args:
#@overlay/append
- --kubelet-insecure-tls
```
1. Run the following `kubectl apply` command:
```
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.4.1/components.yaml -f add-kubelet-insecure-tls-to-metrics-server.yml`
```
## <a id='ensure-kubectl-target'></a> Ensure kubectl Targets Your Cluster
To ensure that kubectl targets your cluster:
1. To get the context name after creating the cluster, run:
```
TKG-TKGI get credentials CLUSTER-NAME
```
Where:
* `TKG-TKGI` is either `tkg` or `tkgi` depending on your environment.
* `CLUSTER-NAME` is your cluster name.
1. To ensure that kubectl targets the cluster, run:
```
kubectl config use-context CONTEXT-NAME
```
Where `CONTEXT-NAME` is the context name collected in the last step.
## <a id='verify-default-storage'></a> Verify That a Default Storage Class Exists
<%= vars.app_runtime_short %> requires each Kubernetes cluster provide persistent volumes for its internal Minio blobstore. A default StorageClass resource in the Kubernetes cluster can dynamically provision the persistent volumes that <%= vars.app_runtime_short %> calls for.
Most of the Kubernetes distributed by the public clouds come with a default storage class. If you are using Kubernetes on a private cloud, you might need to install one instead.
To verify that your Kubernetes cluster already has a default storage class installed, retrieve the list of StorageClass resources in the cluster:
```bash
kubectl get storageclass
```
Review the returned list of StorageClass resources:
```bash
NAME PROVISIONER AGE
thin (default) kubernetes.io/vsphere-volume 34h
```
* If the list includes an entry for which `(default)` follows the StorageClass name, then the Kubernetes cluster has a default storage class installed already, and you are ready to provision volumes dynamically. Proceed to [Installing <%= vars.app_runtime_short %>](index-install.html).
* If the list does not include a default, you must install one before installing <%= vars.app_runtime_short %>. See the [Installing a Default Storage Class](installing-default-storage-class.html) topic for information.
## <a id="next"></a> Next Steps
After you complete this procedure, proceed to
[Installing a Default Storage Class](installing-default-storage-class.html).