Skip to content

DANIILNEDOSTUP/harbor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Deploying Harbor with High Availability via Helm

https://www.digitalocean.com/community/pages/kubernetes-challenge


Description: goal of the project is deploy an internal container registry - Harbor (https://goharbor.io/)

Harbor registry: https://161.35.246.128/ (deprecated)
Small demo: https://youtu.be/yr9I_htGURI

Steps involved to complete the challenge:

  • Creating the kubernetes cluster on Digital Ocean
  • Deploy and configure Harbor Helm chart
  • Testing the result (+ small demo)

Creating the kubernetes cluster on Digital Ocean

My cluster consists of 3 nodes.
Get the cluster ID:

doctl kubernetes cluster list

Apply kubeconfig by ID:

doctl kubernetes cluster kubeconfig save <cluster_id>

Check the cluster status:

kubectl get nodes

setting_mysql_operator


Deploy and configure Harbor Helm chart

Download harbor Helm chart:

helm repo add harbor https://helm.goharbor.io
helm fetch harbor/harbor --untar

Edit certain fields in values.yaml:

expose:
  type: loadBalancer
  tls:
    enabled: true
    certSource: auto
    auto:
      commonName: "161.35.246.128"
  loadBalancer:
    name: harbor
    IP: "161.35.246.128"
externalURL: https://my.local.harbor

Install chart:

helm install -n harbor harbor .

Check the status:

kubectl get pods -n harbor

setting_mysql_operator

Go to https://161.35.246.128 or https://my.local.harbor and log in:

Login: admin
Password: Harbor12345

setting_mysql_operator

Create a project:

setting_mysql_operator

Set Up certificate:

openssl s_client -connect my.local.cluster:443

Copy certificate to ca.crt:

-----BEGIN CERTIFICATE-----
MIIC6TCC...
-----END CERTIFICATE-----

Apply cert (Windows method):

- Start > "Manage Computer Certificates" (also available in the control panel)
- Right-click on "Trusted Root Certification Authoritites" > "All tasks" > "Import"
- Browse to the crt file and then keep pressing "Next" to complete the wizard
- Restart Docker for Windows

Add exception to docker desktop:
setting_mysql_operator


Testing the result (+ small demo)

YouTube small demo here -> https://youtu.be/yr9I_htGURI

Use Harbor as an internal registry:

docker login my.local.harbor

or

docker login 161.35.246.128

Pull nginx for example:

docker pull nginx

Tag the nginx image:

docker tag nginx:latest my.local.harbor/daniil/nginx:v2 

* where 'daniil' is Harbor project

Push image to Harbor registry:

docker push my.local.harbor/daniil/nginx:v2

Check the result in Harbor project:
setting_mysql_operator

Congratulations! You have a Harbor registry! 😄


Useful links:

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published