diff --git a/external-dns/.gitignore b/external-dns/.gitignore new file mode 100644 index 0000000..c996e50 --- /dev/null +++ b/external-dns/.gitignore @@ -0,0 +1 @@ +*.key diff --git a/external-dns/application.yml b/external-dns/k-space.yaml similarity index 87% rename from external-dns/application.yml rename to external-dns/k-space.yaml index e29b1a2..423b87a 100644 --- a/external-dns/application.yml +++ b/external-dns/k-space.yaml @@ -62,26 +62,27 @@ subjects: apiVersion: apps/v1 kind: Deployment metadata: - name: external-dns + name: k-space namespace: external-dns spec: revisionHistoryLimit: 0 selector: - matchLabels: - app: external-dns + matchLabels: &selectorLabels + app.kubernetes.io/name: external-dns + domain: k-space.ee template: metadata: - labels: - app: external-dns + labels: *selectorLabels spec: serviceAccountName: external-dns containers: - name: external-dns - image: k8s.gcr.io/external-dns/external-dns:v0.13.1 + image: registry.k8s.io/external-dns/external-dns:v0.13.5 envFrom: - secretRef: name: tsig-secret args: + - --events - --registry=txt - --txt-prefix=external-dns- - --txt-owner-id=k8s @@ -90,6 +91,7 @@ spec: - --source=service - --source=crd - --domain-filter=k-space.ee + - --rfc2136-tsig-axfr - --rfc2136-host=193.40.103.2 - --rfc2136-port=53 - --rfc2136-zone=k-space.ee diff --git a/external-dns/k6.yaml b/external-dns/k6.yaml new file mode 100644 index 0000000..515cb86 --- /dev/null +++ b/external-dns/k6.yaml @@ -0,0 +1,72 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: k6 + namespace: external-dns +spec: + revisionHistoryLimit: 0 + selector: + matchLabels: &selectorLabels + app.kubernetes.io/name: external-dns + domain: k6.ee + template: + metadata: + labels: *selectorLabels + spec: + serviceAccountName: external-dns + containers: + - name: external-dns + image: registry.k8s.io/external-dns/external-dns:v0.13.5 + envFrom: + - secretRef: + name: tsig-secret + args: + - --log-level=debug + - --events + - --registry=noop + - --provider=rfc2136 + - --source=service + - --source=crd + - --domain-filter=k6.ee + - --rfc2136-tsig-axfr + - --rfc2136-host=193.40.103.2 + - --rfc2136-port=53 + - --rfc2136-zone=k6.ee + - --rfc2136-tsig-keyname=acme + - --rfc2136-tsig-secret-alg=hmac-sha512 + - --rfc2136-tsig-secret=$(TSIG_SECRET) + # https://github.com/kubernetes-sigs/external-dns/issues/2446 +--- +apiVersion: externaldns.k8s.io/v1alpha1 +kind: DNSEndpoint +metadata: + name: k6 +spec: + endpoints: + - dnsName: k6.ee + recordTTL: 300 + recordType: SOA + targets: + - "ns1.k-space.ee. hostmaster.k-space.ee. (1 300 300 300 300)" + - dnsName: k6.ee + recordTTL: 300 + recordType: NS + targets: + - ns1.k-space.ee + - ns2.k-space.ee + - dnsName: ns1.k-space.ee + recordTTL: 300 + recordType: A + targets: + - 193.40.103.2 + - dnsName: ns2.k-space.ee + recordTTL: 300 + recordType: A + targets: + - 62.65.250.2 + - dnsName: k-space.ee + recordTTL: 300 + recordType: MX + targets: + - 10 mail.k-space.ee diff --git a/external-dns/kspace.yaml b/external-dns/kspace.yaml new file mode 100644 index 0000000..35b3886 --- /dev/null +++ b/external-dns/kspace.yaml @@ -0,0 +1,67 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: kspace + namespace: external-dns +spec: + revisionHistoryLimit: 0 + selector: + matchLabels: &selectorLabels + app.kubernetes.io/name: external-dns + domain: kspace.ee + template: + metadata: + labels: *selectorLabels + spec: + serviceAccountName: external-dns + containers: + - name: external-dns + image: registry.k8s.io/external-dns/external-dns:v0.13.5 + envFrom: + - secretRef: + name: tsig-secret + args: + - --events + - --registry=noop + - --provider=rfc2136 + - --source=ingress + - --source=service + - --source=crd + - --domain-filter=kspace.ee + - --rfc2136-tsig-axfr + - --rfc2136-host=193.40.103.2 + - --rfc2136-port=53 + - --rfc2136-zone=kspace.ee + - --rfc2136-tsig-keyname=acme + - --rfc2136-tsig-secret-alg=hmac-sha512 + - --rfc2136-tsig-secret=$(TSIG_SECRET) + # https://github.com/kubernetes-sigs/external-dns/issues/2446 +--- +apiVersion: externaldns.k8s.io/v1alpha1 +kind: DNSEndpoint +metadata: + name: kspace +spec: + endpoints: + - dnsName: kspace.ee + recordTTL: 300 + recordType: SOA + targets: + - "ns1.k-space.ee. hostmaster.k-space.ee. (1 300 300 300 300)" + - dnsName: kspace.ee + recordTTL: 300 + recordType: NS + targets: + - ns1.k-space.ee + - ns2.k-space.ee + - dnsName: ns1.k-space.ee + recordTTL: 300 + recordType: A + targets: + - 193.40.103.2 + - dnsName: ns2.k-space.ee + recordTTL: 300 + recordType: A + targets: + - 62.65.250.2