Skip to content

Commit

Permalink
add external-dns support (#95)
Browse files Browse the repository at this point in the history
* add external-dns

Signed-off-by: Michael Fornaro <[email protected]>

* [Auto Generation] Adding hydrated manifests

Signed-off-by: Michael Fornaro <[email protected]>

* fix namespace scope

Signed-off-by: Michael Fornaro <[email protected]>

* verbose debugging

Signed-off-by: Michael Fornaro <[email protected]>

* updating virtual services

Signed-off-by: Michael Fornaro <[email protected]>

* add external-dns secret

Signed-off-by: Michael Fornaro <[email protected]>
  • Loading branch information
xunholy authored Sep 2, 2020
1 parent 90d846e commit ca1da4e
Show file tree
Hide file tree
Showing 15 changed files with 88 additions and 32 deletions.
Binary file added .secrets/k8s-secret-cloudflare-external-dns.yaml
Binary file not shown.
5 changes: 3 additions & 2 deletions config/flux/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ git:
registry:
disableScanning: true

# Disabled due to circular dependency with prometheus-operator being deployed via Flux
prometheus:
enabled: true
enabled: false
serviceMonitor:
# Enables ServiceMonitor creation for the Prometheus Operator
create: true
create: false
interval: 30s
scrapeTimeout: 10s
namespace: flux
Expand Down
5 changes: 3 additions & 2 deletions config/helm-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ resources:
cpu: 50m
memory: 64Mi

# Disabled due to circular dependency with prometheus-operator being deployed via Flux
prometheus:
enabled: true
enabled: false
serviceMonitor:
# Enables ServiceMonitor creation for the Prometheus Operator
create: true
create: false
interval:
scrapeTimeout:
namespace:
Expand Down
23 changes: 0 additions & 23 deletions namespaces/flux/helm-operator/helm-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,6 @@ spec:
metadata:
annotations:
checksum/repositories: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
prometheus.io/scrape: "true"
labels:
app: helm-operator
release: default
Expand Down Expand Up @@ -793,25 +792,3 @@ spec:
secret:
defaultMode: 256
secretName: flux-git-ssh-private-key
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
app: helm-operator
chart: helm-operator-1.2.0
heritage: Helm
release: default
name: default-helm-operator
namespace: flux
spec:
endpoints:
- honorLabels: true
port: http
namespaceSelector:
matchNames:
- flux
selector:
matchLabels:
app: helm-operator
release: default
2 changes: 2 additions & 0 deletions namespaces/istio-system/vs-jaeger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ kind: VirtualService
metadata:
name: jaeger
namespace: istio-system
annotations:
external-dns.alpha.kubernetes.io/target: raspbernetes.com
spec:
hosts:
- 'jaeger.raspbernetes.com'
Expand Down
2 changes: 2 additions & 0 deletions namespaces/kube-system/sealed-secrets/vs-sealed-secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ kind: VirtualService
metadata:
name: sealed-secrets
namespace: kube-system
annotations:
external-dns.alpha.kubernetes.io/target: raspbernetes.com
spec:
hosts:
- 'sealed-secrets.raspbernetes.com'
Expand Down
2 changes: 1 addition & 1 deletion namespaces/network/dex/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
Enter valid secrets into the values.yaml and use the following command to generate the secret, then use sealed secrets to encrypt these values to be used within the helm release resource.

```bash
kubectl -n network create secret generic dex-values --from-file=values.yaml=config/dex/values.yaml --dry-run=true -o yaml > secret.yaml
kubectl -n network create secret generic dex-helm-values --from-file=values.yaml=config/dex/values.yaml --dry-run=true -o yaml > secret.yaml
```
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ kind: VirtualService
metadata:
name: dex
namespace: network
annotations:
external-dns.alpha.kubernetes.io/target: raspbernetes.com
spec:
hosts:
- 'dex.raspbernetes.com'
Expand Down
47 changes: 47 additions & 0 deletions namespaces/network/external-dns/external-dns.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
apiVersion: helm.fluxcd.io/v1
kind: HelmRelease
metadata:
name: external-dns
namespace: network
annotations:
fluxcd.io/ignore: 'false'
fluxcd.io/automated: 'false'
spec:
releaseName: external-dns
chart:
repository: https://charts.bitnami.com/bitnami
name: external-dns
version: 3.3.0
values:
image:
registry: docker.io
repository: raspbernetes/external-dns
tag: v0.7.3
pullPolicy: IfNotPresent
provider: cloudflare
policy: upsert-only
registry: 'txt'
replicas: 1
logLevel: debug
rbac:
create: true
pspEnabled: true
metrics:
enabled: true
serviceMonitor:
enabled: true
namespace: observability
crd:
create: true
sources:
- service
- ingress
- istio-gateway
- istio-virtualservice
domainFilters:
- raspbernetes.com
cloudflare:
secretName: 'cloudflare-external-dns'
email: '[email protected]'
proxied: true
15 changes: 15 additions & 0 deletions namespaces/network/external-dns/secret.encrypted.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: bitnami.com/v1alpha1
kind: SealedSecret
metadata:
creationTimestamp: null
name: cloudflare-external-dns
namespace: network
spec:
encryptedData:
cloudflare_api_token: AgCAGo8+uhIFpkMVasAWDRC3Vnr98ZH/JWsSQhY9pwYyEd01Wd3LQlZOiRToajW2ZWEMfzzDSR2j5cJbqfHV9U6xeY3NB3tooQX5fOxhAQ0Q5EVWGXLSczBuEID4+y7SH16SnZhNDbwmRzUf1Iqn5AfQ/Ybma52zTsYG+WLT6lfrcDTl0odsTa5+6nl+ti2AekEdNiu1WSr7qVHZBUV+q9pfUoal/gRHsFWcdZ5XFhsse0bbZ9mvWHLgCOrBQNb4Cy8Nyv7ImaUQM1tnKN67rASx0OAHiZNu8En36dRryYO1G0VxQ+WbMFOTZqLv8qr0Vrs7TPYQRRxYLW0s9cQrLw1uRf2xeRfyXwcUYMSMuDxfxkdYeBzB6ZAOjXzaT3dlNp1LMQCwdTNPUOZ5fG4rDIefdQ7wVTjcv+6UMNAur/MKRLLPdsV//UFHGhRRgdxErfWdcuvhtK8n4bOJcEUYzMSgoMVH6kcbkul5TZLFErnaXEe8+KpOaQpPIwXuzs/VCQWFYKWy95EXJLZTAuiz5s3KKVDCRWbv4gBqnj9HwxLsdLZW4/oX2upsTc2SbBaO9IFN5/AI0HmJS0ABEJMCJ9ppvBdOIyLVuSHT3HgNf3V/esEVWtbAmVvjsWS3fKZ7OySIKenUoSN8VBOiNrr8xS3SivrQVqkkmSDp4jNyz5Sdpn3ZOfZBrdRa6eFnk45fOdHuERtiBR8hrTo8QQ3WHHZ5SbvG/m7TBFg/lu03yZsAZVzll32UWbuq
template:
metadata:
creationTimestamp: null
name: cloudflare-external-dns
namespace: network

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ kind: VirtualService
metadata:
name: auth
namespace: network
annotations:
external-dns.alpha.kubernetes.io/target: raspbernetes.com
spec:
hosts:
- 'auth.raspbernetes.com'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: kiali
namespace: istio-system
namespace: observability
annotations:
external-dns.alpha.kubernetes.io/target: raspbernetes.com
spec:
hosts:
- 'kiali.raspbernetes.com'
gateways:
- istio-system/istio-system-ingress-gateway
http:
- match:
- port: 443
route:
- route:
- destination:
port:
number: 20001
host: kiali.observability.svc.cluster.local
weight: 100
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ kind: VirtualService
metadata:
name: alert-manager
namespace: observability
annotations:
external-dns.alpha.kubernetes.io/target: raspbernetes.com
spec:
hosts:
- 'alert-manager.raspbernetes.com'
Expand Down
2 changes: 2 additions & 0 deletions namespaces/observability/prometheus-operator/vs-grafana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ kind: VirtualService
metadata:
name: grafana
namespace: observability
annotations:
external-dns.alpha.kubernetes.io/target: raspbernetes.com
spec:
hosts:
- 'grafana.raspbernetes.com'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ kind: VirtualService
metadata:
name: prometheus
namespace: observability
annotations:
external-dns.alpha.kubernetes.io/target: raspbernetes.com
spec:
hosts:
- 'prometheus.raspbernetes.com'
Expand Down

0 comments on commit ca1da4e

Please sign in to comment.