enable GCE as the cloud-provider for native volumes etc [fixes #496]
parent
5c462220b7
commit
5d556861f3
|
@ -82,6 +82,7 @@ ExecStart=/usr/local/bin/kube-apiserver \\
|
||||||
--authorization-mode=Node,RBAC \\
|
--authorization-mode=Node,RBAC \\
|
||||||
--bind-address=0.0.0.0 \\
|
--bind-address=0.0.0.0 \\
|
||||||
--client-ca-file=/var/lib/kubernetes/ca.pem \\
|
--client-ca-file=/var/lib/kubernetes/ca.pem \\
|
||||||
|
--cloud-provider=gce \\
|
||||||
--enable-admission-plugins=NamespaceLifecycle,NodeRestriction,LimitRanger,ServiceAccount,DefaultStorageClass,ResourceQuota \\
|
--enable-admission-plugins=NamespaceLifecycle,NodeRestriction,LimitRanger,ServiceAccount,DefaultStorageClass,ResourceQuota \\
|
||||||
--etcd-cafile=/var/lib/kubernetes/ca.pem \\
|
--etcd-cafile=/var/lib/kubernetes/ca.pem \\
|
||||||
--etcd-certfile=/var/lib/kubernetes/kubernetes.pem \\
|
--etcd-certfile=/var/lib/kubernetes/kubernetes.pem \\
|
||||||
|
@ -127,6 +128,7 @@ Documentation=https://github.com/kubernetes/kubernetes
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/usr/local/bin/kube-controller-manager \\
|
ExecStart=/usr/local/bin/kube-controller-manager \\
|
||||||
--address=0.0.0.0 \\
|
--address=0.0.0.0 \\
|
||||||
|
--cloud-provider=gce \\
|
||||||
--cluster-cidr=10.200.0.0/16 \\
|
--cluster-cidr=10.200.0.0/16 \\
|
||||||
--cluster-name=kubernetes \\
|
--cluster-name=kubernetes \\
|
||||||
--cluster-signing-cert-file=/var/lib/kubernetes/ca.pem \\
|
--cluster-signing-cert-file=/var/lib/kubernetes/ca.pem \\
|
||||||
|
|
|
@ -212,6 +212,12 @@ EOF
|
||||||
|
|
||||||
> The `resolvConf` configuration is used to avoid loops when using CoreDNS for service discovery on systems running `systemd-resolved`.
|
> 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:
|
Create the `kubelet.service` systemd unit file:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -224,9 +230,11 @@ Requires=containerd.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/usr/local/bin/kubelet \\
|
ExecStart=/usr/local/bin/kubelet \\
|
||||||
|
--cloud-provider=gce \\
|
||||||
--config=/var/lib/kubelet/kubelet-config.yaml \\
|
--config=/var/lib/kubelet/kubelet-config.yaml \\
|
||||||
--container-runtime=remote \\
|
--container-runtime=remote \\
|
||||||
--container-runtime-endpoint=unix:///var/run/containerd/containerd.sock \\
|
--container-runtime-endpoint=unix:///var/run/containerd/containerd.sock \\
|
||||||
|
--hostname-override=$HOSTNAME_OVERRIDE \\
|
||||||
--image-pull-progress-deadline=2m \\
|
--image-pull-progress-deadline=2m \\
|
||||||
--kubeconfig=/var/lib/kubelet/kubeconfig \\
|
--kubeconfig=/var/lib/kubelet/kubeconfig \\
|
||||||
--network-plugin=cni \\
|
--network-plugin=cni \\
|
||||||
|
|
Loading…
Reference in New Issue