ui-svc.yaml 2.3 KB

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