我是Helm的新手,我想知道,在service.yaml文件中是否允许有多服务,比如:apiVersion: v1 kind of: apiVersion: v1 kind of: apiVersion: v1 kind of: apiVersion: v1 kind of: apiVersion: v1 kind of: apiVersion: v1 kind of: apiVersion: v1 kind of: apiVersion: v1 kind of: apiVersion: v1 kind of: apiVersion: v1 kind of: apiVersion: v1 kind of: apiVersion: v1 kind of: apiVersion: v1 kind of: apiVersion: v1 kind of: apiVersion: v1 kind of: apiVersion: v1 kind of: apiVersion: v1 kind of: apiVersion: v1 kind of: apiVersion: v1 kind of: apiVersion: v1 kind of: apiVersion: v1 kind of: apiVersion: v1 kind of: apiVersion: v1 kind of: mail
apiVersion: v1
kind: Service
metadata:
name: {{ include "keycloak.fullname" . }}
labels:
{{- include "keycloak.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
{{- include "keycloak.selectorLabels" . | nindent 4 }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "keycloak.fullname" . }}
labels:
{{- include "keycloak.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
{{- include "keycloak.selectorLabels" . | nindent 4 }}
是的,你是否面临任何问题?
一个更简单的方法是使用两个不同的文件service-a.yaml和service-b.yaml。
注意:最好不要让两个服务同名。