Skip to content

Instantly share code, notes, and snippets.

@venkatnsrinivasan
Last active December 3, 2019 22:24
Show Gist options
  • Save venkatnsrinivasan/87bf9387176baf7548348c8127903449 to your computer and use it in GitHub Desktop.
Save venkatnsrinivasan/87bf9387176baf7548348c8127903449 to your computer and use it in GitHub Desktop.
controlplane.yaml
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha2
kind: KubeadmConfig
metadata:
name: k8s-cluster-east-1-controlplane-0
namespace: default
spec:
clusterConfiguration:
apiServer:
extraArgs:
cloud-config: /etc/kubernetes/vsphere.conf
cloud-provider: vsphere
extraVolumes:
- hostPath: /etc/kubernetes/vsphere.conf
mountPath: /etc/kubernetes/vsphere.conf
name: cloud-config
pathType: File
readOnly: true
controllerManager:
extraArgs:
cloud-config: /etc/kubernetes/vsphere.conf
cloud-provider: vsphere
extraVolumes:
- hostPath: /etc/kubernetes/vsphere.conf
mountPath: /etc/kubernetes/vsphere.conf
name: cloud-config
pathType: File
readOnly: true
imageRepository: k8s.gcr.io
files:
- content: |
W0dsb2JhbF0Kc2VjcmV0LW5hbWUgPSAiY2xvdWQtcHJvdmlkZXItdnNwaGVyZS1jcmVkZW50aWFscyIKc2VjcmV0LW5hbWVzcGFjZSA9ICJrdWJlLXN5c3RlbSIKZGF0YWNlbnRlcnMgPSAiU0pDMTkiCmluc2VjdXJlLWZsYWcgPSAiMSIKCltWaXJ0dWFsQ2VudGVyICJjY3NjY3AtdmNlbnRlci5jcHNnLmNpc2NvbGFicy5jb20iXQoKW1dvcmtzcGFjZV0Kc2VydmVyID0gImNjc2NjcC12Y2VudGVyLmNwc2cuY2lzY29sYWJzLmNvbSIKZGF0YWNlbnRlciA9ICJTSkMxOSIKZm9sZGVyID0gIlZlbmthdCIKZGVmYXVsdC1kYXRhc3RvcmUgPSAibmZzLWRhdGFzdG9yZSIKcmVzb3VyY2Vwb29sLXBhdGggPSAiJyciCgpbRGlza10Kc2NzaWNvbnRyb2xsZXJ0eXBlID0gcHZzY3NpCgpbTmV0d29ya10KcHVibGljLW5ldHdvcmsgPSAidmxhbjEwMDQiCg==
encoding: base64
owner: root:root
path: /etc/kubernetes/vsphere.conf
permissions: "0600"
initConfiguration:
nodeRegistration:
criSocket: /var/run/containerd/containerd.sock
kubeletExtraArgs:
cloud-provider: vsphere
name: '{{ ds.meta_data.hostname }}'
ntp:
enabled: true
servers:
- 192.168.1.20
preKubeadmCommands:
- hostname "{{ ds.meta_data.hostname }}"
- echo "::1 ipv6-localhost ipv6-loopback" >/etc/hosts
- echo "127.0.0.1 localhost {{ ds.meta_data.hostname }}" >>/etc/hosts
- echo "{{ ds.meta_data.hostname }}" >/etc/hostname
- mount bpffs /sys/fs/bpf -t bpf
- echo "bpffs /sys/fs/bpf bpf defaults 0 0" >> /etc/fstab
users:
- name: capv
sshAuthorizedKeys:
- ssh-rsa somepublickey
sudo: ALL=(ALL) NOPASSWD:ALL
---
apiVersion: cluster.x-k8s.io/v1alpha2
kind: Machine
metadata:
labels:
cluster.x-k8s.io/cluster-name: k8s-cluster-east-1
cluster.x-k8s.io/control-plane: "true"
name: k8s-cluster-east-1-controlplane-0
namespace: default
spec:
bootstrap:
configRef:
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha2
kind: KubeadmConfig
name: k8s-cluster-east-1-controlplane-0
namespace: default
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
kind: VSphereMachine
name: k8s-cluster-east-1-controlplane-0
namespace: default
version: 1.15.5
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
kind: VSphereMachine
metadata:
labels:
cluster.x-k8s.io/cluster-name: k8s-cluster-east-1
cluster.x-k8s.io/control-plane: "true"
name: k8s-cluster-east-1-controlplane-0
namespace: default
spec:
datacenter: MYDC
diskGiB: 50
memoryMiB: 4096
network:
devices:
- dhcp4: true
dhcp6: false
networkName: my-net
numCPUs: 4
template: ubuntu-1804-kube-v1.15.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment