I have a local Kubernetes cluster based on MicroK8s running on an Ubuntu 18.04 machine.
What I want to achieve: Generally I want to expose my applications to DNS names and test them locally.
My setup:
I created the following test deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-app
labels:
app: hello-app
tier: backend
version: v1
spec:
selector:
matchLabels:
app: hello-app
replicas: 2
template:
metadata:
labels:
app: hello-app
spec:
containers:
- name: hello-app
image: localhost:5000/a-local-hello-image
ports:
- containerPort: 3000
I added the following service descriptor:
apiVersion: v1
kind: Service
metadata:
name: hello-app
spec:
selector:
app: hello-app
ports:
- protocol: TCP
port: 3000
targetPort: 3000
Now I want to see my app available, let's say, at http://hello.someurl.com:3000
.
Question: What do I need to setup in addition to my current configuration to map my application to a DNS name locally?
Note: I have read the documentation which unfortunately didn't help. I also enabled DNS addon on my cluster.
I would appreciate any help, any directions on how to move forward.