enable GCE as the cloud-provider for native volumes etc [fixes #496]

pull/502/head
Dr Nic Williams 2019-10-29 08:42:53 +10:00
parent 5c462220b7
commit 5d556861f3
2 changed files with 10 additions and 0 deletions

View File

@ -82,6 +82,7 @@ ExecStart=/usr/local/bin/kube-apiserver \\
--authorization-mode=Node,RBAC \\
--bind-address=0.0.0.0 \\
--client-ca-file=/var/lib/kubernetes/ca.pem \\
--cloud-provider=gce \\
--enable-admission-plugins=NamespaceLifecycle,NodeRestriction,LimitRanger,ServiceAccount,DefaultStorageClass,ResourceQuota \\
--etcd-cafile=/var/lib/kubernetes/ca.pem \\
--etcd-certfile=/var/lib/kubernetes/kubernetes.pem \\
@ -127,6 +128,7 @@ Documentation=https://github.com/kubernetes/kubernetes
[Service]
ExecStart=/usr/local/bin/kube-controller-manager \\
--address=0.0.0.0 \\
--cloud-provider=gce \\
--cluster-cidr=10.200.0.0/16 \\
--cluster-name=kubernetes \\
--cluster-signing-cert-file=/var/lib/kubernetes/ca.pem \\

View File

@ -212,6 +212,12 @@ EOF
> The `resolvConf` configuration is used to avoid loops when using CoreDNS for service discovery on systems running `systemd-resolved`.
For the GCE cloud provider, we need to override the hostname it uses for each node so it matches with our certificates:
```
HOSTNAME_OVERRIDE=$(curl -sS http://metadata.google.internal/computeMetadata/v1/instance/name -H "Metadata-Flavor: Google")
```
Create the `kubelet.service` systemd unit file:
```
@ -224,9 +230,11 @@ Requires=containerd.service
[Service]
ExecStart=/usr/local/bin/kubelet \\
--cloud-provider=gce \\
--config=/var/lib/kubelet/kubelet-config.yaml \\
--container-runtime=remote \\
--container-runtime-endpoint=unix:///var/run/containerd/containerd.sock \\
--hostname-override=$HOSTNAME_OVERRIDE \\
--image-pull-progress-deadline=2m \\
--kubeconfig=/var/lib/kubelet/kubeconfig \\
--network-plugin=cni \\