-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reapply "helm: manage CoreDNS addon as Helm chart (#3236)"
This reverts commit 4a9422d.
- Loading branch information
Showing
22 changed files
with
689 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
apiVersion: v2 | ||
name: kube-dns | ||
version: 0.0.0 |
23 changes: 23 additions & 0 deletions
23
internal/constellation/helm/charts/coredns/templates/clusterrole.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: system:coredns | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- endpoints | ||
- services | ||
- pods | ||
- namespaces | ||
verbs: | ||
- list | ||
- watch | ||
- apiGroups: | ||
- discovery.k8s.io | ||
resources: | ||
- endpointslices | ||
verbs: | ||
- list | ||
- watch |
13 changes: 13 additions & 0 deletions
13
internal/constellation/helm/charts/coredns/templates/clusterrolebinding.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: system:coredns | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: system:coredns | ||
subjects: | ||
- kind: ServiceAccount | ||
name: coredns | ||
namespace: kube-system |
28 changes: 28 additions & 0 deletions
28
internal/constellation/helm/charts/coredns/templates/configmap.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: coredns | ||
namespace: kube-system | ||
data: | ||
Corefile: | | ||
.:53 { | ||
errors | ||
health { | ||
lameduck 5s | ||
} | ||
ready | ||
kubernetes {{ .Values.dnsDomain }} in-addr.arpa ip6.arpa { | ||
pods insecure | ||
fallthrough in-addr.arpa ip6.arpa | ||
ttl 30 | ||
} | ||
prometheus :9153 | ||
forward . /etc/resolv.conf { | ||
max_concurrent 1000 | ||
} | ||
cache 30 | ||
loop | ||
reload | ||
loadbalance | ||
} |
109 changes: 109 additions & 0 deletions
109
internal/constellation/helm/charts/coredns/templates/deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
k8s-app: kube-dns | ||
name: coredns | ||
namespace: kube-system | ||
spec: | ||
replicas: 2 | ||
selector: | ||
matchLabels: | ||
k8s-app: kube-dns | ||
strategy: | ||
rollingUpdate: | ||
maxUnavailable: 1 | ||
type: RollingUpdate | ||
template: | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
k8s-app: kube-dns | ||
spec: | ||
affinity: | ||
podAntiAffinity: | ||
preferredDuringSchedulingIgnoredDuringExecution: | ||
- podAffinityTerm: | ||
labelSelector: | ||
matchExpressions: | ||
- key: k8s-app | ||
operator: In | ||
values: | ||
- kube-dns | ||
topologyKey: kubernetes.io/hostname | ||
weight: 100 | ||
containers: | ||
- args: | ||
- -conf | ||
- /etc/coredns/Corefile | ||
image: '{{ .Values.image }}' | ||
imagePullPolicy: IfNotPresent | ||
livenessProbe: | ||
failureThreshold: 5 | ||
httpGet: | ||
path: /health | ||
port: 8080 | ||
scheme: HTTP | ||
initialDelaySeconds: 60 | ||
successThreshold: 1 | ||
timeoutSeconds: 5 | ||
name: coredns | ||
ports: | ||
- containerPort: 53 | ||
name: dns | ||
protocol: UDP | ||
- containerPort: 53 | ||
name: dns-tcp | ||
protocol: TCP | ||
- containerPort: 9153 | ||
name: metrics | ||
protocol: TCP | ||
readinessProbe: | ||
httpGet: | ||
path: /ready | ||
port: 8181 | ||
scheme: HTTP | ||
resources: | ||
limits: | ||
memory: 170Mi | ||
requests: | ||
cpu: 100m | ||
memory: 70Mi | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
capabilities: | ||
add: | ||
- NET_BIND_SERVICE | ||
drop: | ||
- ALL | ||
readOnlyRootFilesystem: true | ||
volumeMounts: | ||
- mountPath: /etc/coredns | ||
name: config-volume | ||
readOnly: true | ||
dnsPolicy: Default | ||
nodeSelector: | ||
kubernetes.io/os: linux | ||
priorityClassName: system-cluster-critical | ||
serviceAccountName: coredns | ||
tolerations: | ||
- key: CriticalAddonsOnly | ||
operator: Exists | ||
- effect: NoSchedule | ||
key: node-role.kubernetes.io/control-plane | ||
- effect: NoSchedule | ||
key: node.cloudprovider.kubernetes.io/uninitialized | ||
value: "true" | ||
- effect: NoExecute | ||
key: node.kubernetes.io/unreachable | ||
operator: Exists | ||
tolerationSeconds: 10 | ||
volumes: | ||
- configMap: | ||
items: | ||
- key: Corefile | ||
path: Corefile | ||
name: coredns | ||
name: config-volume | ||
status: {} |
33 changes: 33 additions & 0 deletions
33
internal/constellation/helm/charts/coredns/templates/service.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
k8s-app: kube-dns | ||
kubernetes.io/cluster-service: "true" | ||
kubernetes.io/name: "CoreDNS" | ||
name: kube-dns | ||
namespace: kube-system | ||
annotations: | ||
prometheus.io/port: "9153" | ||
prometheus.io/scrape: "true" | ||
# Without this resourceVersion value, an update of the Service between versions will yield: | ||
# Service "kube-dns" is invalid: metadata.resourceVersion: Invalid value: "": must be specified for an update | ||
resourceVersion: "0" | ||
spec: | ||
clusterIP: "{{ .Values.clusterIP }}" | ||
ports: | ||
- name: dns | ||
port: 53 | ||
protocol: UDP | ||
targetPort: 53 | ||
- name: dns-tcp | ||
port: 53 | ||
protocol: TCP | ||
targetPort: 53 | ||
- name: metrics | ||
port: 9153 | ||
protocol: TCP | ||
targetPort: 9153 | ||
selector: | ||
k8s-app: kube-dns |
6 changes: 6 additions & 0 deletions
6
internal/constellation/helm/charts/coredns/templates/serviceaccount.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: coredns | ||
namespace: kube-system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
clusterIP: 10.96.0.10 | ||
dnsDomain: cluster.local | ||
image: registry.k8s.io/coredns/coredns:v1.11.1@sha256:1eeb4c7316bacb1d4c8ead65571cd92dd21e27359f0d4917f1a5822a73b75db1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") | ||
|
||
go_library( | ||
name = "corednsgen_lib", | ||
srcs = ["corednsgen.go"], | ||
importpath = "github.com/edgelesssys/constellation/v2/internal/constellation/helm/corednsgen", | ||
visibility = ["//visibility:private"], | ||
deps = [ | ||
"//internal/versions", | ||
"@com_github_regclient_regclient//:regclient", | ||
"@com_github_regclient_regclient//types/ref", | ||
"@io_k8s_api//apps/v1:apps", | ||
"@io_k8s_api//core/v1:core", | ||
"@io_k8s_kubernetes//cmd/kubeadm/app/apis/kubeadm", | ||
"@io_k8s_kubernetes//cmd/kubeadm/app/images", | ||
"@io_k8s_kubernetes//cmd/kubeadm/app/phases/addons/dns", | ||
"@io_k8s_kubernetes//cmd/kubeadm/app/util", | ||
"@io_k8s_sigs_yaml//:yaml", | ||
], | ||
) | ||
|
||
go_binary( | ||
name = "corednsgen", | ||
embed = [":corednsgen_lib"], | ||
visibility = ["//:__subpackages__"], | ||
) |
Oops, something went wrong.