diff --git a/apps/README.md b/apps/README.md index d689716e..ed3b038b 100644 --- a/apps/README.md +++ b/apps/README.md @@ -385,6 +385,40 @@ EOF
HARBOR +### w/ INGRESS (DAGGER) + +```bash +dagger call -m github.com/stuttgart-things/dagger/helm@v0.57.0 \ +helmfile-operation \ +--helmfile-ref "git::https://github.com/stuttgart-things/helm.git@apps/harbor.yaml.gotmpl" \ +--operation apply \ +--state-values "namespace=harbor,domain=idp.kubermatic.sva.dev,issuerName=letsencrypt-prod,storageClass=vsphere-csi,adminPassword=" \ +--kube-config file://config.yaml \ +--progress plain -vv +``` + +### w/ HTTPROUTE (GATEWAY API) + +```bash +cat < harbor.yaml +--- +helmfiles: + - path: git::https://github.com/stuttgart-things/helm.git@apps/harbor.yaml.gotmpl + values: + - namespace: harbor + - hostname: harbor + - domain: 172.18.0.2.nip.io + - storageClass: standard + - adminPassword: + - deployHttpRoute: true + - gatewayName: cilium-gateway + - gatewayNamespace: default +EOF + +helmfile template -f harbor.yaml # RENDER ONLY +helmfile apply -f harbor.yaml # APPLY HELMFILE +``` + ### w/ INGRESS + CERT (INGRESS ANNOTATION - CERT-MANAGER) ```bash diff --git a/apps/harbor.yaml.gotmpl b/apps/harbor.yaml.gotmpl index 3215b8bb..4d26c7c6 100644 --- a/apps/harbor.yaml.gotmpl +++ b/apps/harbor.yaml.gotmpl @@ -17,6 +17,9 @@ environments: - issuerKind: ClusterIssuer - issuerKindAnnotation: cluster-issuer - createCertificateResource: false + - deployHttpRoute: false + - gatewayName: cilium-gateway + - gatewayNamespace: default - certificates: harbor: hostname: {{ .Values.hostname }} @@ -49,6 +52,19 @@ releases: values: - "values/harbor.values.yaml.gotmpl" +{{- if .Values.deployHttpRoute }} + - name: harbor-httproute + disableValidationOnInstall: true + installed: true + namespace: {{ .Values.namespace }} + chart: stuttgart-things/sthings-cluster + version: 0.3.20 + needs: + - {{ .Values.namespace }}/harbor + values: + - "values/harbor-httproute.values.yaml.gotmpl" +{{- end }} + repositories: - name: bitnami url: https://charts.bitnami.com/bitnami diff --git a/apps/values/harbor-httproute.values.yaml.gotmpl b/apps/values/harbor-httproute.values.yaml.gotmpl new file mode 100644 index 00000000..0a533b4c --- /dev/null +++ b/apps/values/harbor-httproute.values.yaml.gotmpl @@ -0,0 +1,18 @@ +--- +customresources: + harbor-httproute: + apiVersion: gateway.networking.k8s.io/v1 + kind: HTTPRoute + metadata: + name: harbor + namespace: {{ .Values.namespace }} + spec: + parentRefs: + - name: {{ .Values.gatewayName }} + namespace: {{ .Values.gatewayNamespace }} + hostnames: + - "{{ .Values.hostname }}.{{ .Values.domain }}" + rules: + - backendRefs: + - name: harbor + port: 443 diff --git a/apps/values/harbor.values.yaml.gotmpl b/apps/values/harbor.values.yaml.gotmpl index c1a79f6d..bc0ddfa3 100644 --- a/apps/values/harbor.values.yaml.gotmpl +++ b/apps/values/harbor.values.yaml.gotmpl @@ -44,7 +44,11 @@ volumePermissions: +{{- if .Values.deployHttpRoute }} +exposureType: clusterIP +{{- else }} exposureType: ingress +{{- end }} service: type: ClusterIP @@ -54,6 +58,7 @@ ipFamily: ipv4: enabled: true +{{- if not .Values.deployHttpRoute }} ingress: core: ingressClassName: {{ .Values.ingressClassName }} @@ -71,6 +76,7 @@ ingress: ingress.kubernetes.io/proxy-body-size: "0" nginx.ingress.kubernetes.io/ssl-redirect: "true" nginx.ingress.kubernetes.io/proxy-body-size: "0" +{{- end }} {{- if .Values.enablePersistence }} global: