svc-dolphinscheduler-api.yaml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #
  2. # Licensed to the Apache Software Foundation (ASF) under one or more
  3. # contributor license agreements. See the NOTICE file distributed with
  4. # this work for additional information regarding copyright ownership.
  5. # The ASF licenses this file to You under the Apache License, Version 2.0
  6. # (the "License"); you may not use this file except in compliance with
  7. # the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. #
  17. apiVersion: v1
  18. kind: Service
  19. metadata:
  20. name: {{ include "dolphinscheduler.fullname" . }}-api
  21. labels:
  22. app.kubernetes.io/name: {{ include "dolphinscheduler.fullname" . }}-api
  23. {{- include "dolphinscheduler.common.labels" . | nindent 4 }}
  24. {{- if and (eq .Values.api.service.type "LoadBalancer") .Values.api.service.annotations }}
  25. annotations:
  26. {{- range $key, $value := .Values.api.service.annotations }}
  27. {{ $key }}: {{ $value | quote }}
  28. {{- end }}
  29. {{- end }}
  30. spec:
  31. type: {{ .Values.api.service.type }}
  32. {{- if and (eq .Values.api.service.type "ClusterIP") .Values.api.service.clusterIP }}
  33. clusterIP: {{ .Values.api.service.clusterIP }}
  34. {{- end }}
  35. ports:
  36. - port: 12345
  37. targetPort: api-port
  38. {{- if and (eq .Values.api.service.type "NodePort") .Values.api.service.nodePort }}
  39. nodePort: {{ .Values.api.service.nodePort }}
  40. {{- end }}
  41. protocol: TCP
  42. name: api-port
  43. - port: 25333
  44. targetPort: python-api-port
  45. {{- if and (eq .Values.api.service.type "NodePort") .Values.api.service.nodePort }}
  46. nodePort: {{ .Values.api.service.nodePort }}
  47. {{- end }}
  48. protocol: TCP
  49. name: python-api-port
  50. {{- if .Values.api.service.externalIPs }}
  51. externalIPs:
  52. {{- toYaml .Values.api.service.externalIPs | nindent 4 }}
  53. {{- end }}
  54. {{- if and (eq .Values.api.service.type "ExternalName") .Values.api.service.externalName }}
  55. externalName: {{ .Values.api.service.externalName }}
  56. {{- end }}
  57. {{- if and (eq .Values.api.service.type "LoadBalancer") .Values.api.service.loadBalancerIP }}
  58. loadBalancerIP: {{ .Values.api.service.loadBalancerIP }}
  59. {{- end }}
  60. selector:
  61. {{- include "dolphinscheduler.api.labels" . | nindent 4 }}