diff --git a/Vagrantfile b/Vagrantfile index ed46986..6069390 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -166,6 +166,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # in CoreOS, so tell Vagrant that so it can be smarter. v.check_guest_additions = false v.functional_vboxsf = false + v.customize ["modifyvm", :id, "--paravirtprovider", "minimal"] # fix freeze "vagrant up" on master: SSH auth method: private key end config.vm.provider :parallels do |p| p.update_guest_tools = false @@ -270,7 +271,9 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| f.write(dnsData) end else if DNS_PROVIDER == "coredns" - system "#{__dir__}/plugins/dns/coredns/deploy.sh 10.100.0.10/24 #{DNS_DOMAIN} #{__dir__}/plugins/dns/coredns/coredns.yaml.sed > #{__dir__}/temp/coredns-deployment.yaml" + system "cp #{__dir__}/plugins/dns/coredns/coredns-deployment.yaml #{__dir__}/temp/coredns-deployment.yaml" # copying a manually compiled file + # don't work, why?? + #system "#{__dir__}/plugins/dns/coredns/deploy.sh 10.100.0.10/24 #{DNS_DOMAIN} #{__dir__}/plugins/dns/coredns/coredns.yaml.sed > #{__dir__}/temp/coredns-deployment.yaml" end end end @@ -485,6 +488,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| kHost.vm.provider :virtualbox do |vb, override| vb.customize ["modifyvm", :id, "--uart1", "0x3F8", "4"] vb.customize ["modifyvm", :id, "--uartmode1", serialFile] + vb.customize ["modifyvm", :id, "--paravirtprovider", "minimal"] end # supported since vagrant-parallels 1.3.7 # https://github.com/Parallels/vagrant-parallels/issues/164 diff --git a/plugins/dns/coredns/coredns-deployment.yaml b/plugins/dns/coredns/coredns-deployment.yaml new file mode 100644 index 0000000..77bb7b0 --- /dev/null +++ b/plugins/dns/coredns/coredns-deployment.yaml @@ -0,0 +1,159 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: coredns + namespace: kube-system + labels: + kubernetes.io/cluster-service: "true" + addonmanager.kubernetes.io/mode: Reconcile +# --- +# apiVersion: rbac.authorization.k8s.io/v1 +# kind: ClusterRole +# metadata: + # labels: + # kubernetes.io/bootstrapping: rbac-defaults + # addonmanager.kubernetes.io/mode: Reconcile + # name: system:coredns +# rules: +# - apiGroups: + # - "" + # resources: + # - endpoints + # - services + # - pods + # - namespaces + # verbs: + # - list + # - watch +# --- +# apiVersion: rbac.authorization.k8s.io/v1 +# kind: ClusterRoleBinding +# metadata: + # annotations: + # rbac.authorization.kubernetes.io/autoupdate: "true" + # labels: + # kubernetes.io/bootstrapping: rbac-defaults + # addonmanager.kubernetes.io/mode: EnsureExists + # name: system:coredns +# roleRef: + # apiGroup: rbac.authorization.k8s.io + # kind: ClusterRole + # name: system:coredns +# subjects: +# - kind: ServiceAccount + # name: coredns + # namespace: kube-system +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: coredns + namespace: kube-system + labels: + addonmanager.kubernetes.io/mode: EnsureExists +data: + Corefile: | + .:53 { + errors + log + health + kubernetes cluster.local 10.100.0.10/24 { + pods insecure + } + prometheus + proxy . /etc/resolv.conf + cache 30 + } +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: coredns + namespace: kube-system + labels: + k8s-app: coredns + kubernetes.io/cluster-service: "true" + addonmanager.kubernetes.io/mode: Reconcile + kubernetes.io/name: "CoreDNS" +spec: + replicas: 1 + selector: + matchLabels: + k8s-app: coredns + template: + metadata: + labels: + k8s-app: coredns + spec: + serviceAccountName: coredns + tolerations: + - key: node-role.kubernetes.io/master + effect: NoSchedule + - key: "CriticalAddonsOnly" + operator: "Exists" + containers: + - name: coredns + image: coredns/coredns:1.0.2 + imagePullPolicy: IfNotPresent + resources: + limits: + memory: 170Mi + requests: + cpu: 100m + memory: 70Mi + args: [ "-conf", "/etc/coredns/Corefile" ] + volumeMounts: + - name: config-volume + mountPath: /etc/coredns + ports: + - containerPort: 53 + name: dns + protocol: UDP + - containerPort: 53 + name: dns-tcp + protocol: TCP + - containerPort: 9153 + name: metrics + protocol: TCP + livenessProbe: + httpGet: + path: /health + port: 8080 + scheme: HTTP + initialDelaySeconds: 60 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 5 + dnsPolicy: Default + volumes: + - name: config-volume + configMap: + name: coredns + items: + - key: Corefile + path: Corefile +--- +apiVersion: v1 +kind: Service +metadata: + name: coredns + namespace: kube-system + labels: + k8s-app: coredns + kubernetes.io/cluster-service: "true" + addonmanager.kubernetes.io/mode: Reconcile + kubernetes.io/name: "CoreDNS" +spec: + selector: + k8s-app: coredns + clusterIP: 10.100.0.10 + ports: + - name: dns + port: 53 + protocol: UDP + - name: dns-tcp + port: 53 + protocol: TCP + - name: metrics + port: 9153 + protocol: TCP \ No newline at end of file