舵机图中是否允许有多个服务?

问题描述 投票:0回答:1

我是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 }}  
kubernetes kubernetes-helm
1个回答
1
投票

是的,你是否面临任何问题?

一个更简单的方法是使用两个不同的文件service-a.yaml和service-b.yaml。

注意:最好不要让两个服务同名。

© www.soinside.com 2019 - 2024. All rights reserved.