By glvr182
I have a grafana dashboard, an nginx-ingress and an OpenVPN service running in my cluster just fine, and I am able to reach everything I need using the cluster IP, but I want to use a domain name, lets say grafana.my-domain.com. How can I achieve this?
This might be some usefull information:
My grafana service:
▶ k get svc --namespace monitoring
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
doks-cluster-monitoring-grafana ClusterIP 10.245.162.148 <none> 80/TCP 120m
My OpenVPN service:
▶ k get svc --namespace access
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
openvpn ClusterIP 10.245.122.233 <none> 1194/TCP 56m
My nginx-ingress:
▶ k get svc --namespace nginx-ingress
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
nginx-ingress-controller LoadBalancer 10.245.199.175 xxx.xxx.xxx.xxx 80:31883/TCP,443:32254/TCP,1194:32021/TCP 48m
nginx-ingress-controller-metrics ClusterIP 10.245.185.36 <none> 9913/TCP 48m
nginx-ingress-default-backend ClusterIP 10.245.242.220 <none> 80/TCP 48m
My CoreDNS:
▶ k get svc --namespace kube-system
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kube-dns ClusterIP 10.245.0.10 <none> 53/UDP,53/TCP,9153/TCP 143m
My /etc/resolv.conf:
▶ cat /etc/resolv.conf
# Generated by NetworkManager
search localdomain
nameserver 10.245.0.10
nameserver 192.168.1.1
My CoreDNS configmap:
▶ k describe cm --namespace kube-system coredns
Name: coredns
Namespace: kube-system
Labels: <none>
Annotations: kubectl.kubernetes.io/last-applied-configuration:
{"apiVersion":"v1","data":{"Corefile":".:53 {\n errors\n health\n ready\n kubernetes cluster.local in-addr.arpa ip6.arpa {\n ...
Data
====
Corefile:
----
.:53 {
errors
health
ready
kubernetes cluster.local in-addr.arpa ip6.arpa {
pods insecure
fallthrough in-addr.arpa ip6.arpa
}
prometheus :9153
forward . /etc/resolv.conf
cache 30
loop
reload
loadbalance
}
Events: <none>
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Do you want this to just work locally on your machine? or globally? If locally, You could setup an /etc/hosts entry on your machine to manually resolve your hostname to the IP of the LB. Then configure ingress rules to route based on that hostname. If globally, do you already own your domain? If so, you would configure your domain’s DNS to resolve to the IP of the Loadbalancer, then ensure you have an ingress rule to appropriately route to your service based on the hostname you have chosen.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.