k8s external dns
k8s external dns
Configuración de external dns k8s
- nano externaldns-values.yaml
rbac:
create: true
provider: aws # tienes que crear la politica de acceso y atacharla al rol
#digitalocean:
# apiToken: your_api_token
interval: "1m"
policy: sync # or upsert-only
domainFilters: [ 'ncleguizamon.co' ]
2. Deploy external-dns pod
helm install stable/external-dns --name external-dns -f externaldns-values.yaml
3. nano ingress-nginx.yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: nginx-ingress
spec:
rules:
- host: nginx.ncleguizamon.co
http:
paths:
- backend:
serviceName: nginx #service name
servicePort: 80
4. nano service-nginx.yaml
apiVersion: v1
kind: Service
metadata:
name: nginx
annotations:
external-dns.alpha.kubernetes.io/hostname: nginx.ncleguizamon.co
spec:
type: LoadBalancer
ports:
- port: 80
targetPort: 5678
selector:
app: nginx
5. nano deployment-nginx.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
spec:
selector:
matchLabels:
app: nginx
replicas: 3
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
6.
kubectl apply -f .
Referencia :