harbor - deptno/deptno.github.io GitHub Wiki
harbor
container registry
private λ ν¬μ§ν°λ¦¬ μ¬μ©
docker build -t harbor.example.com/test/hello:latest
docker login harbor.example.com
docker push harbor.example.com/test/hello:latest
kubernetes μμ private μ΄λ―Έμ§ pull νκΈ°
- harbor web μ μ μν΄μ robot κ³μ μ μμ±, project μμμ μ€μ ν΄λ μκ΄μκ³ , κ΄λ ¨λ κΆνμ μ μ ν λΆμ¬
- μμ±λ token μ password λ‘ μ¬μ©νμ¬ docker-registry secret μ
password
λ‘ μ¬μ©νμ¬ κ³μ μμ± pod.spec.imagePullSecrets
μ λͺ μ
kubectl create secret docker-registry harbor -bot \
--docker-server=https://harbor.example.com
--docker-username=[bot name]
--docker-password=[bot token]
containers:
- name: hello
image: harbor.example.com/test/hello:latest
imagePullSecrets:
- name: harbor-bot
error
image push, pull error
Error: trying to reuse blob sha256:8e012198eea15b2554b07014081c85fec4967a1b9cc4b65bd9a4bce3ae1c0c88 at destination: failed to read from destination repository test/image_name: 500 (Internal Server Error)
The push refers to repository [harbor.deptno.dev/test/image_name]
ef3fca5020c3: Retrying in 1 second
c1f5993c08fb: Retrying in 1 second
0c8fc885a0f0: Retrying in 1 second
c2debf87e43a: Retrying in 1 second
c890fdde5b6c: Retrying in 1 second
a44f831aabcc: Waiting
5f70bf18a086: Waiting
58c6b0bd90b7: Waiting
53ca831d1016: Waiting
b89b9c6e1861: Waiting
b7e3600bfeb3: Waiting
c7e43350508a: Waiting
9b279096649b: Waiting
c2a86085bb2a: Waiting
6649379ee3b2: Waiting
2277bc8d4e09: Waiting
ed6682c37f64: Waiting
395626b7a3b8: Waiting
8e012198eea1: Waiting
received unexpected HTTP status: 200 OK
$ podman pull harbor.deptno.dev/test/hello-world:test INT 16.15.0 node 10:26:30
Trying to pull harbor.deptno.dev/test/hello-world:test...
Error: initializing image from source docker://harbor.deptno.dev/test/hello-world:test: invalid character '<' looking for beginning of value
traefik μ ν΅ν΄ ingress routing μ νκ³ μμλλ°, μ€κ°μ middleware λ₯Ό ν΅ν΄ forward-auth μΈμ¦μ κ»΄λ£μΌλ©΄μ λ¬Έμ κ° λ°μνλ€.
- image: thomseddon/traefik-forward-auth:latest
- μ체 μΈμ¦μ΄ μκΈ° λλ¬Έμ forward-auth λ₯Ό μ κ±°νλ€.
traefik tls
tarefik μμ tls λ°κΈμ μ€ν¨νλ κ²½μ° harbor μ μ κ·Όνμ§ λͺ»ν΄μ μ΄λ―Έμ§ pull μ΄ μ€ν¨νλ©΄μ λͺ¨λ νλκ° λͺ»λ¨λ λ¬Έμ κ° μλ€.
$ sudo vi /etc/containerd/config.toml
[plugins."io.containerd.grpc.v1.cri".registry.mirrors]
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."harbor.example.com"]
endpoint = ["http://harbor.example.com"]
[plugins."io.containerd.grpc.v1.cri".registry.configs."harbor.example.com".tls]
insecure_skip_verify = true
sudo systemctl restart containerd