我对Kubernetes还是很陌生,所以我已经使用头盔3将castlemock应用程序部署在Kubernetes容器中。
这里是舵对象。
values.yml(不是全部内容):
replicaCount: 1
image:
repository: castlemock/castlemock
tag: 1.39
pullPolicy: IfNotPresent
service:
type: ClusterIP
port: 80
ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: traefik
hosts:
- host: chart-example.local
paths:
- /castlemock
deployment.yml(不是全部内容:):
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 8080
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
然后我进行端口转发:kubectl port-forward svc/castlemock 3000:8080
从Castlemock背后的人那里,可以在/ castlemock路径后面访问该应用程序。
但是当我尝试localhost:3000时,我会看到tomcat主页,当我尝试localhost:3000 / castlemock时,我有一个404。
我是否弄乱了东西,或者应该如何设置Kubernetes objets来访问由tomcat运行的应用程序?