#HARBOR kubectl create namespace harbor helm repo add harbor https://helm.goharbor.io helm repo update cat < harbor-cert.yaml - apiVersion: cert-manager.io/v1 kind: Certificate metadata: name: harbor-tls namespace: harbor spec: secretName: harbor-tls issuerRef: name: letsencrypt-prod kind: ClusterIssuer dnsNames: - harbor.italiadatacenter.com EOF kubectl apply -f harbor-cert.yaml cat < harborvalues.yaml - # ----------------------- # EXPOSURE # ----------------------- expose: # Set how to expose the service. Set the type as "ingress", "clusterIP", "nodePort" or "loadBalancer" # and fill the information in the corresponding section type: clusterIP externalURL: https://harbor.italiadatacenter.com # ----------------------- # ADMIN # ----------------------- harborAdminPassword: "KAYQE1QA7uwUZ8uI" # ----------------------- # PERSISTENCE # ----------------------- persistence: enabled: true persistentVolumeClaim: registry: storageClass: csi-rbdfs-sc size: 50Gi jobservice: storageClass: csi-rbdfs-sc size: 2Gi trivy: storageClass: csi-rbdfs-sc size: 2Gi # ----------------------- # POSTGRESQL (EXTERNAL) # ----------------------- database: type: external external: host: pg-devops-rw.devops.svc port: 5432 username: harbor password: "KAYQE1QA7uwUZ8uI" database: registry sslmode: require # ----------------------- # REDIS (EXTERNAL) # ----------------------- redis: type: external external: addr: redis.redis.svc.cluster.local:6379 password: "KAYQE1QA7uwUZ8uI" database: 0 # ----------------------- # DISABLE INTERNAL SERVICES # ----------------------- postgresql: enabled: false redisInternal: enabled: false # ----------------------- # COMPONENTS # ----------------------- trivy: enabled: true metrics: enabled: false EOF kubectl cnpg psql pg-devops -n devops CREATE DATABASE registry; CREATE USER harbor WITH PASSWORD 'KAYQE1QA7uwUZ8uI'; GRANT ALL PRIVILEGES ON DATABASE registry TO harbor; ALTER DATABASE registry OWNER TO harbor; #test kubectl run psql-test --rm -it --image=postgres:16 -- psql -h pg-prod-rw.database.svc -U harbor kubectl run redis-test --rm -it --image=redis:7 -- redis-cli -h redis.redis.svc.cluster.local -a Japp0cam helm install harbor harbor/harbor -n harbor -f harborvalues.yaml --- httproute & body setting nginx ---- kubectl apply -f - <