Giter Site home page Giter Site logo

harbor-guide's Introduction

harbor-guide

Harbor 教程

安装

Argo CD

我们可以通过 Argo CD 这种 GitOps 的方式来安装 Harbor:

cat <<EOF | kubectl apply -n argocd -f -
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: harbor
  namespace: argocd
spec:
  project: default
  source:
    chart: harbor
    repoURL: https://helm.goharbor.io
    targetRevision: 1.10.2
    helm:
      releaseName: harbor
      parameters:
      - name: expose.type
        value: nodePort
      - name: expose.tls.enabled
        value: "false"
      - name: externalURL
        value: http://10.121.218.242:30002/             # 必须要设置外部访问地址
      values: |
        core:
          extraEnvVars:
          - name: configOverwriteJson
            value: |
              {
                "auth_mode": "oidc_auth",
                "oidc_admin_group": "infra-admin",
                "oidc_auto_onboard": true,
                "oidc_client_id": "harbor",
                "oidc_client_secret": "rick",
                "oidc_endpoint": "https://172.11.0.6:31392/api/dex",
                "oidc_name": "dex",
                "oidc_scope": "openid,offline_access,profile,groups,email",
                "oidc_user_claim": "username",
                "oidc_verify_cert": false
              }
  destination:
    server: "https://kubernetes.default.svc"
    namespace: harbor
  syncPolicy:
    syncOptions:
    - CreateNamespace=true
    automated:
      prune: true
      selfHeal: true
EOF

Docker Daemon

如果安装的 Harbor 没有证书签名的话,可以添加如下配置使得忽略:

{
  "insecure-registries": ["10.121.218.242:30002"]
}

Linux 下的文件路径为:/etc/docker/daemon.json

重启命令:systemctl restart docker

命令行登录:

docker login 10.121.218.242:30002 -u admin -pHarbor12345

Harbor 用户配置

用户可以通过配置环境变量 CONFIG_OVERWRITE_JSON修改用户配置

CONFIG_OVERWRITE_JSON: '{"auth_mode":"oidc_auth", "oidc_name":"dex", "oidc_endpoint":"https://10.121.218.184:31392/api/dex", "oidc_client_id":"harbor", "oidc_client_secret":"rick", "oidc_admin_group":"infra-admin", "oidc_scope": "openid,offline_access,profile,groups,email", "oidc_user_claim":"username", "oidc_verify_cert":false, "oidc_auto_onboard":true}'
  • oidc_auto_onboard 为 True 的话,用户登录后无需设置账户名,会自动从 oidc_user_claim 获取

harbor-guide's People

Contributors

linuxsuren avatar

Stargazers

Bisiriyu musbau Adekunle  avatar  avatar

Watchers

 avatar

Forkers

linuxsuren

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.