Skip to content

Instantly share code, notes, and snippets.

@BenTheElder
Created October 24, 2018 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BenTheElder/194029a852362da53efe6f87b57f2cbf to your computer and use it in GitHub Desktop.
Save BenTheElder/194029a852362da53efe6f87b57f2cbf to your computer and use it in GitHub Desktop.
kustomize kubeadm config
# config generated by kind
apiVersion: kubeadm.k8s.io/v1alpha3
kind: ClusterConfiguration
kubernetesVersion: v1.12.0
# TODO(bentheelder): fix this upstream!
# we need nsswitch.conf so we use /etc/hosts
# https://github.com/kubernetes/kubernetes/issues/69195
apiServerExtraVolumes:
- name: nsswitch
mountPath: /etc/nsswitch.conf
hostPath: /etc/nsswitch.conf
writeable: false
pathType: FileOrCreate
clusterName: kind-1
# on docker for mac we have to expose the api server via port forward,
# so we need to ensure the cert is valid for localhost so we can talk
# to the cluster after rewriting the kubeconfig to point to localhost
apiServerCertSANs: [localhost]
---
apiVersion: kubeadm.k8s.io/v1alpha3
kind: InitConfiguration
# we use a random local port for the API server
apiEndpoint:
bindPort: 6443
resources:
- config.yaml
patches:
- patch.yaml
# the patch
apiVersion: kubeadm.k8s.io/v1alpha3
kind: ClusterConfiguration
networking:
serviceSubnet: 10.0.0.0/16
---
apiVersion: kubeadm.k8s.io/v1alpha3
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
"cluster-dns": "10.0.0.10"
@BenTheElder
Copy link
Author

$ kustomize build $HOME/test
apiServerCertSANs:
- another-host
apiServerExtraVolumes:
- hostPath: /etc/nsswitch.conf
  mountPath: /etc/nsswitch.conf
  name: nsswitch
  pathType: FileOrCreate
  writeable: false
apiVersion: kubeadm.k8s.io/v1alpha3
clusterName: kind-1
kind: ClusterConfiguration
kubernetesVersion: v1.12.0
networking:
  serviceSubnet: 10.0.0.0/16
---
apiEndpoint:
  bindPort: 6443
apiVersion: kubeadm.k8s.io/v1alpha3
kind: InitConfiguration
nodeRegistration:
  kubeletExtraArgs:
    cluster-dns: 10.0.0.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment