Expose your Kubernetes services to the internet using ingress controllers and custom domains.
Before using a custom domain, ensure it is whitelisted in your DKS cluster settings.
*.yourdomain.com) to the whitelistDKS comes with NGINX Ingress Controller pre-installed and ready to use. No installation required.
Create an Ingress resource for your application:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-app-ingress
spec:
rules:
- host: myapp.yourdomain.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: my-app-service
port:
number: 80
Apply the Ingress resource:
kubectl apply -f ingress.yaml
To expose your service, you need to create a DNS CNAME record in your DNS provider:
Create a wildcard CNAME record pointing to your cluster:
*.yourdomain.com -> edge.dcptunnel.net
Example:
*.example.com -> edge.dcptunnel.net
edge.dcptunnel.net is the global endpoint for DKS clusters.
* (wildcard)edge.dcptunnel.netOnce the DNS record is propagated, your service will be accessible at myapp.yourdomain.com (or any subdomain matching your wildcard).
DKS automatically provisions SSL certificates using Let's Encrypt for your domains. Certificates are automatically generated and renewed.
dig or nslookupkubectl logs -n ingress-nginx <ingress-controller-pod>