Skip to content

Instantly share code, notes, and snippets.

@venkatnsrinivasan
Created December 3, 2019 22:23
Show Gist options
  • Save venkatnsrinivasan/a7dc552c480dfbce2746dc37334bbf11 to your computer and use it in GitHub Desktop.
Save venkatnsrinivasan/a7dc552c480dfbce2746dc37334bbf11 to your computer and use it in GitHub Desktop.
machinedeployment.yaml
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha2
kind: KubeadmConfigTemplate
metadata:
name: k8s-cluster-east-1-md-0
namespace: default
spec:
template:
spec:
joinConfiguration:
nodeRegistration:
criSocket: /var/run/containerd/containerd.sock
kubeletExtraArgs:
cloud-provider: vsphere
name: '{{ ds.meta_data.hostname }}'
ntp:
properties:
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: MachineDeployment
metadata:
labels:
cluster.x-k8s.io/cluster-name: k8s-cluster-east-1
name: k8s-cluster-east-1-md-0
namespace: default
spec:
replicas: 3
selector:
matchLabels:
cluster.x-k8s.io/cluster-name: k8s-cluster-east-1
template:
metadata:
labels:
cluster.x-k8s.io/cluster-name: k8s-cluster-east-1
spec:
bootstrap:
configRef:
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha2
kind: KubeadmConfigTemplate
name: k8s-cluster-east-1-md-0
namespace: default
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
kind: VSphereMachineTemplate
name: k8s-cluster-east-1-md-0
namespace: default
version: 1.15.5
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
kind: VSphereMachineTemplate
metadata:
name: k8s-cluster-east-1-md-0
namespace: default
spec:
template:
spec:
datacenter: MYDC
diskGiB: 50
memoryMiB: 32768
network:
devices:
- dhcp4: true
dhcp6: false
networkName: my-net
numCPUs: 8
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