harbor_heml_deploy
Differences
This shows you the differences between two versions of the page.
| harbor_heml_deploy [2025/07/26 17:09] – - Imported by DokuWiki Advanced Plugin wikiadm | harbor_heml_deploy [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Harbor ====== | ||
| - | ===== Instalando o harbor via helm ===== | ||
| - | ==== Baixando o repositório ==== | ||
| - | <file bash> | ||
| - | $ helm repo add harbor https:// | ||
| - | $ helm repo update | ||
| - | </ | ||
| - | |||
| - | ==== Baixando e editando os values ==== | ||
| - | |||
| - | <file bash> | ||
| - | $ helm show values harbor/ | ||
| - | </ | ||
| - | |||
| - | <file yaml values.yaml> | ||
| - | expose: | ||
| - | ingress: | ||
| - | hosts: | ||
| - | core: hub.juntotelecom.com.br | ||
| - | notary: notary.juntotelecom.com.br | ||
| - | className: " | ||
| - | |||
| - | externalURL: | ||
| - | |||
| - | persistence: | ||
| - | persistentVolumeClaim: | ||
| - | registry: | ||
| - | storageClass: | ||
| - | size: 32Gi | ||
| - | chartmuseum: | ||
| - | storageClass: | ||
| - | jobservice: | ||
| - | storageClass: | ||
| - | database: | ||
| - | storageClass: | ||
| - | size: 4Gi | ||
| - | redis: | ||
| - | storageClass: | ||
| - | trivy: | ||
| - | storageClass: | ||
| - | </ | ||
| - | |||
| - | ==== Fazendo o deployment ==== | ||
| - | <file bash> | ||
| - | $ kubectl create namespace harbor-system | ||
| - | namespace/ | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ helm install harbor -f values.yaml harbor/ | ||
| - | </ | ||
| - | |||
| - | ==== Checando o status ==== | ||
| - | |||
| - | <file bash> | ||
| - | $ kubectl get all -n harbor-system | ||
| - | NAME | ||
| - | pod/ | ||
| - | pod/ | ||
| - | pod/ | ||
| - | pod/ | ||
| - | pod/ | ||
| - | pod/ | ||
| - | pod/ | ||
| - | pod/ | ||
| - | pod/ | ||
| - | pod/ | ||
| - | |||
| - | NAME | ||
| - | service/ | ||
| - | service/ | ||
| - | service/ | ||
| - | service/ | ||
| - | service/ | ||
| - | service/ | ||
| - | service/ | ||
| - | service/ | ||
| - | service/ | ||
| - | service/ | ||
| - | |||
| - | NAME | ||
| - | deployment.apps/ | ||
| - | deployment.apps/ | ||
| - | deployment.apps/ | ||
| - | deployment.apps/ | ||
| - | deployment.apps/ | ||
| - | deployment.apps/ | ||
| - | deployment.apps/ | ||
| - | |||
| - | NAME | ||
| - | replicaset.apps/ | ||
| - | replicaset.apps/ | ||
| - | replicaset.apps/ | ||
| - | replicaset.apps/ | ||
| - | replicaset.apps/ | ||
| - | replicaset.apps/ | ||
| - | replicaset.apps/ | ||
| - | |||
| - | NAME | ||
| - | statefulset.apps/ | ||
| - | statefulset.apps/ | ||
| - | statefulset.apps/ | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ kubectl get pvc -n harbor-system | ||
| - | NAME STATUS | ||
| - | data-harbor-redis-0 | ||
| - | data-harbor-trivy-0 | ||
| - | database-data-harbor-database-0 | ||
| - | harbor-chartmuseum | ||
| - | harbor-jobservice | ||
| - | harbor-registry | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ kubectl get pods -n harbor-system -o wide | ||
| - | NAME | ||
| - | harbor-chartmuseum-bc8d6988b-7cgx2 | ||
| - | harbor-core-858469fffc-mqmc2 | ||
| - | harbor-database-0 | ||
| - | harbor-jobservice-6b9f555f74-c9ql9 | ||
| - | harbor-notary-server-57c64f449-m6rdk | ||
| - | harbor-notary-server-fb67ffbc6-27bl8 | ||
| - | harbor-notary-signer-6fb6bbf88-klhfj | ||
| - | harbor-portal-97fcbbd96-r5zrq | ||
| - | harbor-redis-0 | ||
| - | harbor-registry-77545c67ff-bfp4g | ||
| - | harbor-trivy-0 | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ kubectl get ingress -n harbor-system | ||
| - | NAME CLASS | ||
| - | harbor-ingress | ||
| - | harbor-ingress-notary | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ kubectl describe ingress harbor-ingress -n harbor-system | ||
| - | Name: | ||
| - | Labels: | ||
| - | app.kubernetes.io/ | ||
| - | chart=harbor | ||
| - | heritage=Helm | ||
| - | release=harbor | ||
| - | Namespace: | ||
| - | Address: | ||
| - | Default backend: | ||
| - | TLS: | ||
| - | harbor-ingress terminates hub.juntotelecom.com.br | ||
| - | Rules: | ||
| - | Host | ||
| - | ---- | ||
| - | hub.juntotelecom.com.br | ||
| - | / | ||
| - | / | ||
| - | / | ||
| - | / | ||
| - | / | ||
| - | / | ||
| - | Annotations: | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | Events: | ||
| - | Type Reason | ||
| - | ---- ------ | ||
| - | Normal | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ kubectl describe ingress harbor-ingress-notary -n harbor-system | ||
| - | Name: | ||
| - | Labels: | ||
| - | app.kubernetes.io/ | ||
| - | chart=harbor | ||
| - | heritage=Helm | ||
| - | release=harbor | ||
| - | Namespace: | ||
| - | Address: | ||
| - | Default backend: | ||
| - | TLS: | ||
| - | harbor-ingress terminates notary.juntotelecom.com.br | ||
| - | Rules: | ||
| - | Host Path Backends | ||
| - | ---- ---- -------- | ||
| - | notary.juntotelecom.com.br | ||
| - | / | ||
| - | Annotations: | ||
| - | ingress.kubernetes.io/ | ||
| - | meta.helm.sh/ | ||
| - | meta.helm.sh/ | ||
| - | nginx.ingress.kubernetes.io/ | ||
| - | nginx.ingress.kubernetes.io/ | ||
| - | Events: | ||
| - | Type Reason | ||
| - | ---- ------ | ||
| - | Normal | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ kubectl get configmap -n harbor-system | ||
| - | NAME DATA AGE | ||
| - | harbor-chartmuseum | ||
| - | harbor-core | ||
| - | harbor-jobservice | ||
| - | harbor-jobservice-env | ||
| - | harbor-portal | ||
| - | harbor-registry | ||
| - | harbor-registryctl | ||
| - | kube-root-ca.crt | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ kubectl get secret -n harbor-system | ||
| - | NAME | ||
| - | default-token-f8gzd | ||
| - | harbor-chartmuseum | ||
| - | harbor-core | ||
| - | harbor-database | ||
| - | harbor-ingress | ||
| - | harbor-jobservice | ||
| - | harbor-notary-server | ||
| - | harbor-registry | ||
| - | harbor-registry-htpasswd | ||
| - | harbor-registryctl | ||
| - | harbor-trivy | ||
| - | sh.helm.release.v1.harbor.v1 | ||
| - | sh.helm.release.v1.harbor.v2 | ||
| - | </ | ||
| - | |||
| - | ===== Senha do usuáriodo admin ===== | ||
| - | |||
| - | <file bash> | ||
| - | $ kubectl -n harbor-system get secrets harbor-core -o jsonpath=" | ||
| - | </ | ||
| - | |||
| - | ===== Sertificado ===== | ||
| - | <file bash> | ||
| - | $ kubectl -n harbor-system get secrets harbor-ingress -o jsonpath=" | ||
| - | </ | ||
| - | |||
| - | ===== Usando o hub no docker ===== | ||
| - | <file bash> | ||
| - | $ docker login hub.juntotelecom.com.br | ||
| - | Username: admin | ||
| - | Password: | ||
| - | Error response from daemon: Get " | ||
| - | </ | ||
| - | |||
| - | ==== Copiando o certificado para a vm do docker ==== | ||
| - | <file bash> | ||
| - | $ cp harbor-ca.crt /tmp/ | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ scp [2804: | ||
| - | suporte@2804: | ||
| - | harbor-ca.crt | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo mkdir -p / | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo cp harbor-ca.crt / | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo systemctl restart docker | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ docker login hub.juntotelecom.com.br | ||
| - | Username: admin | ||
| - | Password: | ||
| - | WARNING! Your password will be stored unencrypted in / | ||
| - | Configure a credential helper to remove this warning. See | ||
| - | https:// | ||
| - | |||
| - | Login Succeeded | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ docker pull busybox | ||
| - | Using default tag: latest | ||
| - | latest: Pulling from library/ | ||
| - | 50e8d59317eb: | ||
| - | Digest: sha256: | ||
| - | Status: Downloaded newer image for busybox: | ||
| - | docker.io/ | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ docker tag busybox hub.juntotelecom.com.br/ | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ docker push hub.juntotelecom.com.br/ | ||
| - | The push refers to repository [hub.juntotelecom.com.br/ | ||
| - | eb6b01329ebe: | ||
| - | latest: digest: sha256: | ||
| - | </ | ||
| - | |||
| - | {{ : | ||
| - | |||
| - | ===== Usando o Kubernetes ===== | ||
| - | <file bash> | ||
| - | $ kubectl create secret docker-registry harbor \ | ||
| - | --docker-server=hub.juntotelecom.com.br \ | ||
| - | --docker-email=noc@juntotelecom.com.br \ | ||
| - | --docker-username=admin \ | ||
| - | --docker-password=' | ||
| - | </ | ||
| - | |||
| - | **Inserir em ambos os nodes** | ||
| - | <file bash> | ||
| - | $ sudo vim / | ||
| - | [...] | ||
| - | # # An array of host[:port] registries to try when pulling an unqualified image, in order. | ||
| - | unqualified-search-registries = [" | ||
| - | # | ||
| - | [[registry]] | ||
| - | location = " | ||
| - | insecure = true | ||
| - | [...] | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo systemctl restart crio kubelet | ||
| - | </ | ||
| - | |||
| - | ==== Teste de deploy ==== | ||
| - | |||
| - | <file bash> | ||
| - | $ docker tag nginx: | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ docker push hub.juntotelecom.com.br/ | ||
| - | The push refers to repository [hub.juntotelecom.com.br/ | ||
| - | a059c9abe376: | ||
| - | 09be960dcde4: | ||
| - | 18be1897f940: | ||
| - | dfe7577521f0: | ||
| - | d253f69cb991: | ||
| - | fd95118eade9: | ||
| - | latest: digest: sha256: | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ kubectl create deploy nginx --image=hub.juntotelecom.com.br/ | ||
| - | deployment.apps/ | ||
| - | </ | ||
| - | |||
| - | <file basg> | ||
| - | $ kubectl get deploy | ||
| - | NAME READY | ||
| - | nginx | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ kubectl describe deploy nginx | ||
| - | Name: nginx | ||
| - | Namespace: | ||
| - | CreationTimestamp: | ||
| - | Labels: | ||
| - | Annotations: | ||
| - | Selector: | ||
| - | Replicas: | ||
| - | StrategyType: | ||
| - | MinReadySeconds: | ||
| - | RollingUpdateStrategy: | ||
| - | Pod Template: | ||
| - | Labels: | ||
| - | Containers: | ||
| - | | ||
| - | Image: | ||
| - | Port: < | ||
| - | Host Port: < | ||
| - | Environment: | ||
| - | Mounts: | ||
| - | Volumes: | ||
| - | Conditions: | ||
| - | Type | ||
| - | ---- | ||
| - | Available | ||
| - | Progressing | ||
| - | OldReplicaSets: | ||
| - | NewReplicaSet: | ||
| - | Events: | ||
| - | Type Reason | ||
| - | ---- ------ | ||
| - | Normal | ||
| - | </ | ||
| - | |||
| - | <file yaml> | ||
| - | $ kubectl get deploy nginx -o yaml | ||
| - | apiVersion: apps/v1 | ||
| - | kind: Deployment | ||
| - | metadata: | ||
| - | annotations: | ||
| - | deployment.kubernetes.io/ | ||
| - | creationTimestamp: | ||
| - | generation: 1 | ||
| - | labels: | ||
| - | app: nginx | ||
| - | name: nginx | ||
| - | namespace: default | ||
| - | resourceVersion: | ||
| - | uid: d9190efc-48f3-4b2f-bf7b-9b0ca41c4672 | ||
| - | spec: | ||
| - | progressDeadlineSeconds: | ||
| - | replicas: 1 | ||
| - | revisionHistoryLimit: | ||
| - | selector: | ||
| - | matchLabels: | ||
| - | app: nginx | ||
| - | strategy: | ||
| - | rollingUpdate: | ||
| - | maxSurge: 25% | ||
| - | maxUnavailable: | ||
| - | type: RollingUpdate | ||
| - | template: | ||
| - | metadata: | ||
| - | creationTimestamp: | ||
| - | labels: | ||
| - | app: nginx | ||
| - | spec: | ||
| - | containers: | ||
| - | - image: hub.juntotelecom.com.br/ | ||
| - | imagePullPolicy: | ||
| - | name: nginx | ||
| - | resources: {} | ||
| - | terminationMessagePath: | ||
| - | terminationMessagePolicy: | ||
| - | dnsPolicy: ClusterFirst | ||
| - | restartPolicy: | ||
| - | schedulerName: | ||
| - | securityContext: | ||
| - | terminationGracePeriodSeconds: | ||
| - | status: | ||
| - | availableReplicas: | ||
| - | conditions: | ||
| - | - lastTransitionTime: | ||
| - | lastUpdateTime: | ||
| - | message: Deployment has minimum availability. | ||
| - | reason: MinimumReplicasAvailable | ||
| - | status: " | ||
| - | type: Available | ||
| - | - lastTransitionTime: | ||
| - | lastUpdateTime: | ||
| - | message: ReplicaSet " | ||
| - | reason: NewReplicaSetAvailable | ||
| - | status: " | ||
| - | type: Progressing | ||
| - | observedGeneration: | ||
| - | readyReplicas: | ||
| - | replicas: 1 | ||
| - | updatedReplicas: | ||
| - | </ | ||
| - | |||
| - | ===== Referências ===== | ||
| - | - [[https:// | ||
| - | - [[https:// | ||
| - | - [[https:// | ||
| - | - [[https:// | ||
| - | - [[https:// | ||
| - | - [[https:// | ||
| - | - [[https:// | ||
| - | - [[https:// | ||
harbor_heml_deploy.1753560543.txt.gz · Last modified: by wikiadm
