forked from kosmos-io/coredns
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: wangyizhi1 <[email protected]>
- Loading branch information
wangyizhi1
committed
Oct 12, 2023
1 parent
ea2611e
commit 0ed08f9
Showing
22 changed files
with
1,160 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# This workflow will build a golang project | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | ||
|
||
name: Go | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
jobs: | ||
push-images: | ||
runs-on: ubuntu-latest | ||
permissions: write-all | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up qemu | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Login registry | ||
run: | | ||
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
- name: Push images | ||
env: | ||
ON_PLUGINS: true | ||
run: | | ||
make upload-images |
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 |
---|---|---|
|
@@ -6,4 +6,4 @@ build/ | |
release/ | ||
vendor/ | ||
|
||
.idea | ||
.idea |
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,19 @@ | ||
.:53 { | ||
errors | ||
health { | ||
lameduck 5s | ||
} | ||
ready | ||
kubernetes kosmos.local cluster.local in-addr.arpa ip6.arpa { | ||
pods insecure | ||
ttl 30 | ||
kubeconfig /Users/wangyizhi/env/kubeconfig/ecs/gy-host [email protected] | ||
} | ||
hosts /etc/add-hosts/customer-hosts . { | ||
fallthrough kosmos.local cluster.local in-addr.arpa ip6.arpa | ||
} | ||
prometheus :9153 | ||
cache 30 | ||
reload | ||
loadbalance | ||
} |
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,15 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: kosmos-coredns | ||
rules: | ||
- apiGroups: | ||
- '*' | ||
resources: | ||
- '*' | ||
verbs: | ||
- '*' | ||
- nonResourceURLs: | ||
- '*' | ||
verbs: | ||
- get |
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,12 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: kosmos-coredns | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: kosmos-coredns | ||
subjects: | ||
- kind: ServiceAccount | ||
name: coredns | ||
namespace: kosmos-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,29 @@ | ||
apiVersion: v1 | ||
data: | ||
Corefile: | | ||
.:53 { | ||
errors | ||
health { | ||
lameduck 5s | ||
} | ||
ready | ||
rewrite stop { | ||
name regex (.*).kosmos.local {1}.cluster.local | ||
answer name (.*).cluster.local {1}.kosmos.local | ||
} | ||
kubernetes cluster.local in-addr.arpa ip6.arpa { | ||
pods insecure | ||
ttl 30 | ||
} | ||
hosts /etc/add-hosts/customer-hosts . { | ||
fallthrough cluster.local in-addr.arpa ip6.arpa | ||
} | ||
prometheus :9153 | ||
cache 30 | ||
reload | ||
loadbalance | ||
} | ||
kind: ConfigMap | ||
metadata: | ||
name: coredns | ||
namespace: kosmos-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,9 @@ | ||
apiVersion: v1 | ||
data: | ||
customer-hosts: | | ||
#customer-hosts | ||
#10.10.10.10 myhost | ||
kind: ConfigMap | ||
metadata: | ||
name: coredns-customer-hosts | ||
namespace: kosmos-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,130 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
kosmos.io/app: coredns | ||
name: coredns | ||
namespace: kosmos-system | ||
spec: | ||
progressDeadlineSeconds: 600 | ||
replicas: 2 | ||
revisionHistoryLimit: 10 | ||
selector: | ||
matchLabels: | ||
kosmos.io/app: coredns | ||
strategy: | ||
rollingUpdate: | ||
maxSurge: 25% | ||
maxUnavailable: 1 | ||
type: RollingUpdate | ||
template: | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
kosmos.io/app: coredns | ||
spec: | ||
containers: | ||
- args: | ||
- -conf | ||
- /etc/coredns/Corefile | ||
image: ghcr.io/kosmos-io/coredns:v1.8.0 | ||
imagePullPolicy: Always | ||
livenessProbe: | ||
failureThreshold: 5 | ||
httpGet: | ||
path: /health | ||
port: 8080 | ||
scheme: HTTP | ||
initialDelaySeconds: 60 | ||
periodSeconds: 10 | ||
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: | ||
failureThreshold: 3 | ||
httpGet: | ||
path: /ready | ||
port: 8181 | ||
scheme: HTTP | ||
periodSeconds: 10 | ||
successThreshold: 1 | ||
timeoutSeconds: 1 | ||
resources: | ||
limits: | ||
cpu: 2000m | ||
memory: 2560Mi | ||
requests: | ||
cpu: 1000m | ||
memory: 1280Mi | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
capabilities: | ||
add: | ||
- NET_BIND_SERVICE | ||
drop: | ||
- all | ||
readOnlyRootFilesystem: true | ||
terminationMessagePath: /dev/termination-log | ||
terminationMessagePolicy: File | ||
volumeMounts: | ||
- mountPath: /etc/coredns | ||
name: config-volume | ||
readOnly: true | ||
- mountPath: /etc/add-hosts | ||
name: customer-hosts | ||
readOnly: true | ||
dnsPolicy: Default | ||
priorityClassName: system-cluster-critical | ||
restartPolicy: Always | ||
schedulerName: default-scheduler | ||
securityContext: {} | ||
serviceAccount: coredns | ||
serviceAccountName: coredns | ||
terminationGracePeriodSeconds: 30 | ||
affinity: | ||
podAntiAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchLabels: | ||
kosmos.io/app: coredns | ||
topologyKey: kubernetes.io/hostname | ||
tolerations: | ||
- effect: NoSchedule | ||
key: node-role.kubernetes.io/master | ||
operator: Exists | ||
- effect: NoSchedule | ||
key: node.kubernetes.io/unschedulable | ||
operator: Exists | ||
- effect: NoExecute | ||
key: node.kubernetes.io/not-ready | ||
operator: Exists | ||
tolerationSeconds: 300 | ||
- effect: NoExecute | ||
key: node.kubernetes.io/unreachable | ||
operator: Exists | ||
tolerationSeconds: 300 | ||
volumes: | ||
- configMap: | ||
defaultMode: 420 | ||
items: | ||
- key: Corefile | ||
path: Corefile | ||
name: coredns | ||
name: config-volume | ||
- configMap: | ||
defaultMode: 420 | ||
items: | ||
- key: customer-hosts | ||
path: customer-hosts | ||
name: coredns-customer-hosts | ||
name: customer-hosts |
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,5 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: coredns | ||
namespace: kosmos-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,28 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
kosmos.io/app: coredns | ||
name: coredns | ||
namespace: kosmos-system | ||
spec: | ||
ipFamilies: | ||
- IPv4 | ||
ipFamilyPolicy: SingleStack | ||
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: | ||
kosmos.io/app: coredns | ||
sessionAffinity: None | ||
type: ClusterIP |
Oops, something went wrong.