1
0

service-portaldb.yaml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #
  2. # Copyright 2021 Apollo Authors
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # 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. #
  16. {{- if .Values.portaldb.service.enabled -}}
  17. ---
  18. # service definition for mysql
  19. kind: Service
  20. apiVersion: v1
  21. metadata:
  22. name: {{include "apollo.portaldb.serviceName" .}}
  23. labels:
  24. {{- include "apollo.portal.labels" . | nindent 4 }}
  25. spec:
  26. type: {{ .Values.portaldb.service.type }}
  27. {{- if eq .Values.portaldb.service.type "ExternalName" }}
  28. externalName: {{ required "portaldb.host is required!" .Values.portaldb.host }}
  29. {{- else }}
  30. ports:
  31. - protocol: TCP
  32. port: {{ .Values.portaldb.service.port }}
  33. targetPort: {{ .Values.portaldb.port }}
  34. ---
  35. kind: Endpoints
  36. apiVersion: v1
  37. metadata:
  38. name: {{include "apollo.portaldb.serviceName" .}}
  39. subsets:
  40. - addresses:
  41. - ip: {{ required "portaldb.host is required!" .Values.portaldb.host }}
  42. ports:
  43. - protocol: TCP
  44. port: {{ .Values.portaldb.port }}
  45. {{- end }}
  46. {{- end }}