Skip to content

Instantly share code, notes, and snippets.

@cizixs
Last active March 31, 2017 05:22
Show Gist options
  • Save cizixs/a13a7f514df90d5870aae5073f21f60b to your computer and use it in GitHub Desktop.
Save cizixs/a13a7f514df90d5870aae5073f21f60b to your computer and use it in GitHub Desktop.
Kubernetes DNS addon with etcd+skydns+kube2sky
apiVersion: v1
kind: ReplicationController
metadata:
labels:
k8s-app: kube-dns
kubernetes.io/cluster-service: "true"
name: kube-dns
namespace: kube-system
spec:
replicas: 1
selector:
k8s-app: kube-dns
template:
metadata:
labels:
k8s-app: kube-dns
kubernetes.io/cluster-service: "true"
spec:
containers:
- name: etcd
command:
- /usr/local/bin/etcd
- "-listen-client-urls"
- "http://127.0.0.1:2379,http://127.0.0.1:4001"
- "-advertise-client-urls"
- "http://127.0.0.1:2379,http://127.0.0.1:4001"
- "-initial-cluster-token"
- skydns-etcd
image: "gcr.io/google_containers/etcd:2.0.9"
resources:
limits:
cpu: 100m
memory: 50Mi
- name: kube2sky
args:
- "-domain=cluster.local"
- "-kube_master_url=http://10.7.114.81:8080"
image: "gcr.io/google_containers/kube2sky:1.11"
resources:
limits:
cpu: 100m
memory: 50Mi
- name: skydns
args:
- "-machines=http://localhost:4001"
- "-addr=0.0.0.0:53"
- "-domain=cluster.local"
image: "gcr.io/google_containers/skydns:2015-03-11-001"
livenessProbe:
exec:
command:
- /bin/sh
- "-c"
- "nslookup kubernetes.default.svc.cluster.local localhost >/dev/null"
initialDelaySeconds: 30
timeoutSeconds: 5
ports:
- containerPort: 53
name: dns
protocol: UDP
- containerPort: 53
name: dns-tcp
protocol: TCP
resources:
limits:
cpu: 100m
memory: 50Mi
dnsPolicy: Default
apiVersion: v1
kind: Service
metadata:
name: kube-dns
namespace: kube-system
labels:
k8s-app: kube-dns
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "KubeDNS"
spec:
selector:
k8s-app: kube-dns
clusterIP: 10.100.0.100
ports:
- name: dns
port: 53
protocol: UDP
- name: dns-tcp
port: 53
protocol: TCP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment