-
Notifications
You must be signed in to change notification settings - Fork 32
WIP: Make CoreDNS manifests v1.8 #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,189 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: coredns | ||
namespace: kube-system | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
labels: | ||
kubernetes.io/bootstrapping: rbac-defaults | ||
name: system:coredns | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- endpoints | ||
- services | ||
- pods | ||
- namespaces | ||
verbs: | ||
- list | ||
- watch | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- nodes | ||
verbs: | ||
- get | ||
- apiGroups: | ||
- discovery.k8s.io | ||
resources: | ||
- endpointslices | ||
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 | ||
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 | ||
data: | ||
Corefile: | | ||
.:53 { | ||
errors | ||
health | ||
ready | ||
kubernetes cluster.local in-addr.arpa ip6.arpa { | ||
pods insecure | ||
fallthrough in-addr.arpa ip6.arpa | ||
} | ||
prometheus :9153 | ||
cache 30 | ||
loop | ||
reload | ||
loadbalance | ||
} | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: coredns | ||
namespace: kube-system | ||
labels: | ||
k8s-app: kube-dns | ||
kubernetes.io/name: "CoreDNS" | ||
spec: | ||
replicas: {{ .Values.coredns.replicaCount }} | ||
strategy: | ||
type: RollingUpdate | ||
rollingUpdate: | ||
maxUnavailable: 1 | ||
selector: | ||
matchLabels: | ||
k8s-app: kube-dns | ||
template: | ||
metadata: | ||
labels: | ||
k8s-app: kube-dns | ||
spec: | ||
priorityClassName: system-cluster-critical | ||
serviceAccountName: coredns | ||
tolerations: | ||
- key: "CriticalAddonsOnly" | ||
operator: "Exists" | ||
nodeSelector: | ||
beta.kubernetes.io/os: linux | ||
{{- with .Values.coredns.image.pullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 10 }} | ||
{{- end }} | ||
containers: | ||
- name: coredns | ||
{{- with .Values.coredns.image }} | ||
image: "{{ .repository }}{{ if .digest }}@{{ .digest }}{{ else }}:{{ .tag }}{{ end }}" | ||
imagePullPolicy: {{ .pullPolicy }} | ||
{{- end }} | ||
resources: | ||
{{- toYaml .Values.coredns.resources | nindent 10 }} | ||
args: [ "-conf", "/etc/coredns/Corefile" ] | ||
volumeMounts: | ||
- name: config-volume | ||
mountPath: /etc/coredns | ||
readOnly: true | ||
ports: | ||
- containerPort: 53 | ||
name: dns | ||
protocol: UDP | ||
- containerPort: 53 | ||
name: dns-tcp | ||
protocol: TCP | ||
- containerPort: 9153 | ||
name: metrics | ||
protocol: TCP | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
capabilities: | ||
add: | ||
- NET_BIND_SERVICE | ||
drop: | ||
- all | ||
readOnlyRootFilesystem: true | ||
livenessProbe: | ||
httpGet: | ||
path: /health | ||
port: 8080 | ||
scheme: HTTP | ||
initialDelaySeconds: 60 | ||
timeoutSeconds: 5 | ||
successThreshold: 1 | ||
failureThreshold: 5 | ||
readinessProbe: | ||
httpGet: | ||
path: /ready | ||
port: 8181 | ||
scheme: HTTP | ||
dnsPolicy: Default | ||
volumes: | ||
- name: config-volume | ||
configMap: | ||
name: coredns | ||
items: | ||
- key: Corefile | ||
path: Corefile | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: kube-dns | ||
namespace: kube-system | ||
annotations: | ||
prometheus.io/port: "9153" | ||
prometheus.io/scrape: "true" | ||
labels: | ||
k8s-app: kube-dns | ||
kubernetes.io/cluster-service: "true" | ||
kubernetes.io/name: "CoreDNS" | ||
spec: | ||
selector: | ||
k8s-app: kube-dns | ||
clusterIP: {{ template "getCoreDNS" . }} | ||
ports: | ||
- name: dns | ||
port: 53 | ||
protocol: UDP | ||
- name: dns-tcp | ||
port: 53 | ||
protocol: TCP | ||
- name: metrics | ||
port: 9153 | ||
protocol: TCP |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{{- if .Values.coredns.enabled }} | ||
{{- $fullName := include "kubernetes.fullname" . -}} | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ $fullName }}-coredns-manifests | ||
data: | ||
{{- if .Values.coredns.enabled }} | ||
coredns.yaml: | | ||
{{- tpl (.Files.Get "manifests/coredns-1.8.yaml") . | nindent 4 }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there any specific reason for specifying version in filename? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It depends on whether you'd like to support several CoreDNS versions simultaneously. Because CoreDNS version does not have strict mapping on Kubernetes version in fact. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
How are two coredns versions can act together in single cluster?
That's true, but it has some defaults in kubeadm: |
||
{{- end }} | ||
{{- end }} |
Uh oh!
There was an error while loading. Please reload this page.