ZBLOG

k3s 搭建harbor配置文件

以下是一个示例k3s搭建Harbor的配置文件:

  1. # k3s-server-harbor.yaml
  2. # k3s server config
  3. write-kubeconfig-mode: 0644
  4. tls-san:
  5. - "my-k3s-server.example.com"
  6. - "my-k3s-harbor.example.com"
  7. # Harbor setup
  8. kubelet-arg:
  9. cloud-provider: external
  10. feature-gates: CSINodeInfo=true,CSIDriverRegistry=true,VolumeSnapshotDataSource=true
  11. node-taint:
  12. # Ensure that the harbor node runs only the harbor components
  13. "node-role.kubernetes.io/not-ready": "true:NoSchedule"
  14. "node-role.kubernetes.io/harbor": "true:NoSchedule"
  15. extra_binds:
  16. # Bind /data to a persistent volume for Harbor data storage
  17. - "/mnt/data/harbor:/data"
  18. # Harbor-specific environment variables
  19. env:
  20. - name: SECRET_KEY
  21. value: "mysecretpassword"
  22. - name: ROOT_PASSWORD
  23. value: "mypassword"
  24. - name: HARBOR_ADMIN_PASSWORD
  25. value: "myadminpassword"
  26. # Ingress configuration for Harbor
  27. ingress-nginx:
  28. enabled: true
  29. options:
  30. --set controller.publishService.enabled=false
  31. --set controller.metrics.enabled=true
  32. --set-string ssl-passthrough.enabled=true
  33. --set-string ssl-passthrough.hostname=my-k3s-harbor.example.com
  34. harbor:
  35. enabled: true
  36. image: harbor/harbor:v2.3.0
  37. expose:
  38. type: ingress
  39. tls:
  40. hosts:
  41. - my-k3s-harbor.example.com
  42. secretName: harbor-tls-secret
  43. database:
  44. password: mydbpassword
  45. redis:
  46. password: myredispassword

上述配置文件中,我们指定了k3s server的TLS证书信息和Harbor的相关配置,包括kubelet参数,taint节点标记,数据挂载点,环境变量以及Ingress和Harbor的相关设置。可以根据实际需要进行更改。

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:https://golang.0voice.com/?id=1915

分享:
扫描分享到社交APP
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?