我有一个基于MicroK8s的本地Kubernetes集群,该集群在Ubuntu 18.04计算机上运行。
我要实现的目标:通常,我希望将应用程序公开给DNS名称,并在本地对其进行测试。
我的设置:
我创建了以下测试部署
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
我添加了以下服务描述符:
apiVersion: v1
kind: Service
metadata:
name: hello-app
spec:
selector:
app: hello-app
ports:
- protocol: TCP
port: 3000
targetPort: 3000
现在,我想在http://hello.someurl.com:3000
看到我的应用可用。
问题:除了当前的配置之外,我还需要设置什么才能将应用程序本地映射到DNS名称?
注意:不幸的是,我读过the documentation并没有帮助。我也enabled DNS addon在我的集群上。
我将对您的帮助,前进方向的任何指导表示感谢。