Skip to content

Instantly share code, notes, and snippets.

@shashidharatd
Last active May 24, 2017 08:18
Show Gist options
  • Save shashidharatd/029a4236678ebde9f5d1458bfa949601 to your computer and use it in GitHub Desktop.
Save shashidharatd/029a4236678ebde9f5d1458bfa949601 to your computer and use it in GitHub Desktop.
Bringup K8s Federation control plane on DIND
1. Bringup DIND cluster
# cd kubernetes
# git clone https://github.com/shashidharatd/kubernetes-dind-cluster dind
# make
# ./dind/dind-up-cluster.sh
2. Push hyperkube to private registry
# REGISTRY=172.17.0.1:5000 VERSION=latest CACHEBUST=0 ./hack/dev-push-hyperkube.sh
3. Deploy CoreDNS Server
# helm init
# helm install --namespace ns --name etcd-operator --set image.tag=v0.2.6 stable/etcd-operator
# helm upgrade --namespace ns --set cluster.enabled=true --set cluster.size=1 etcd-operator --set cluster.version=v3.1.7 stable/etcd-operator
# helm install --namespace ns --name coredns -f /root/coredns-chart.yaml stable/coredns
3.1 Create CoreDNS provider conf
# cat <<EOF
etcd-endpoints = http://etcd-cluster.ns:2379
zones = hwpaas.io.
coredns-endpoints = <ip>:<port>
EOF
4. Bringup K8s Federation control plane
# kubefed init federation --host-cluster-context=federation-c1 --api-server-service-type=NodePort --etcd-persistent-storage=false --dns-provider=coredns --dns-provider-config=/root/federation-dns-provider.conf --dns-zone-name=hwpaas.io --image=172.17.0.1:5000/hyperkube-amd64 --controllermanager-arg-overrides='--v=4'
5. Register the k8s cluster
# kubefed join federation-c1 --host-cluster-context=federation-c1 --context=federation
6. Verify cluster registeration succeeded
# kubectl --context=federation get clusters
7. Test
# e2e.test --provider=dind --kubeconfig /root/.kube/config --federated-kube-context federation --host=https://172.17.0.1:6443 -ginkgo.v=true -ginkgo.focus="\[Feature:Federation\].with.clusters.Federated.Service" -test.v -v 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment