rancher-partner-charts/charts/jfrog/artifactory-ha/107.68.11/templates/artifactory-service.yaml

67 lines
2.3 KiB
YAML

# Service for all Artifactory cluster nodes.
apiVersion: v1
kind: Service
metadata:
name: {{ template "artifactory-ha.fullname" . }}
labels:
app: {{ template "artifactory-ha.name" . }}
chart: {{ template "artifactory-ha.chart" . }}
component: {{ .Values.artifactory.name }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{- with .Values.artifactory.node.labels }}
{{ toYaml .| indent 4 }}
{{- end }}
{{- if .Values.artifactory.service.annotations }}
annotations:
{{ toYaml .Values.artifactory.service.annotations | indent 4 }}
{{- end }}
spec:
type: {{ .Values.artifactory.service.type }}
{{- if and (eq .Values.artifactory.service.type "ClusterIP") .Values.artifactory.service.clusterIP }}
clusterIP: {{ .Values.artifactory.service.clusterIP }}
{{- end }}
{{- if .Values.artifactory.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{ toYaml .Values.artifactory.service.loadBalancerSourceRanges | indent 4 }}
{{- end }}
ports:
- port: {{ .Values.artifactory.externalPort }}
targetPort: {{ .Values.artifactory.internalPort }}
protocol: TCP
name: http-router
- port: {{ .Values.federation.internalPort }}
targetPort: {{ .Values.federation.internalPort }}
protocol: TCP
name: http-rtfs
{{- if .Values.artifactory.ssh.enabled }}
- port: {{ .Values.artifactory.ssh.externalPort }}
targetPort: {{ .Values.artifactory.ssh.internalPort }}
protocol: TCP
name: tcp-ssh
{{- end }}
- port: {{ .Values.artifactory.externalArtifactoryPort }}
targetPort: {{ .Values.artifactory.internalArtifactoryPort }}
protocol: TCP
name: http-artifactory
{{- with .Values.artifactory.node.javaOpts.jmx }}
{{- if .enabled }}
- port: {{ .port }}
targetPort: {{ .port }}
{{- if $.Values.artifactory.service.nodePort }}
nodePort: {{ $.Values.artifactory.service.nodePort }}
{{- end }}
protocol: TCP
name: tcp-jmx
{{- end }}
{{- end }}
selector:
{{- if eq (int .Values.artifactory.node.replicaCount) 0 }}
role: {{ template "artifactory-ha.primary.name" . }}
{{- else if eq .Values.artifactory.service.pool "members" }}
role: {{ template "artifactory-ha.node.name" . }}
{{- end }}
app: {{ template "artifactory-ha.name" . }}
component: "{{ .Values.artifactory.name }}"
release: {{ .Release.Name }}