Merge pull request #5159 from reasonerjt/helm-chart-ingress-refinement

Add externalPort in values.yaml
This commit is contained in:
Wenkai Yin 2018-06-19 14:16:49 +08:00 committed by GitHub
commit 05fd9c8836
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 3 deletions

View File

@ -30,6 +30,14 @@ release: {{ .Release.Name }}
app: "{{ template "harbor.name" . }}" app: "{{ template "harbor.name" . }}"
{{- end -}} {{- end -}}
{{- define "harbor.externalURL" -}}
{{- if .Values.externalPort -}}
{{- printf "%s:%s" .Values.externalDomain (toString .Values.externalPort) -}}
{{- else -}}
{{- .Values.externalDomain -}}
{{- end -}}
{{- end -}}
{{/* {{/*
Use *.domain.com as the Common Name in the certificate, Use *.domain.com as the Common Name in the certificate,
so it can match Harbor service FQDN and Notary service FQDN. so it can match Harbor service FQDN and Notary service FQDN.

View File

@ -56,7 +56,7 @@ data:
"auth": { "auth": {
"type": "token", "type": "token",
"options": { "options": {
"realm": "https://{{ .Values.externalDomain }}/service/token", "realm": "https://{{ template "harbor.externalURL" . }}/service/token",
"service": "harbor-notary", "service": "harbor-notary",
"issuer": "harbor-token-issuer", "issuer": "harbor-token-issuer",
"rootcertbundle": "/root.crt" "rootcertbundle": "/root.crt"

View File

@ -38,7 +38,7 @@ data:
auth: auth:
token: token:
issuer: harbor-token-issuer issuer: harbor-token-issuer
realm: "https://{{ .Values.externalDomain }}/service/token" realm: "https://{{ template "harbor.externalURL" . }}/service/token"
rootcertbundle: /etc/registry/root.crt rootcertbundle: /etc/registry/root.crt
service: harbor-registry service: harbor-registry

View File

@ -35,7 +35,7 @@ spec:
- containerPort: 5000 - containerPort: 5000
- containerPort: 5001 - containerPort: 5001
volumeMounts: volumeMounts:
{{- if not .Values.registry.objectStorage }} {{- if and (not .Values.registry.objectStorage) .Values.persistence.enabled }}
- name: registry-data - name: registry-data
mountPath: /var/lib/registry mountPath: /var/lib/registry
{{- end }} {{- end }}

View File

@ -33,6 +33,9 @@ harborImageTag: &harbor_image_tag v1.5.0-chart-patch
# The FQDN for Harbor service. # The FQDN for Harbor service.
externalDomain: harbor.my.domain externalDomain: harbor.my.domain
# externalPort is the Port for Harbor service, leave empty if the service is to be bound to
# port 80/443
externalPort: 32700
# If set to true, you don't need to set tlsCrt/tlsKey/caCrt, but must add # If set to true, you don't need to set tlsCrt/tlsKey/caCrt, but must add
# Harbor FQDN as insecure-registries for your docker client. # Harbor FQDN as insecure-registries for your docker client.
insecureRegistry: false insecureRegistry: false