Kustomize 资源 GitHub 私人仓库

Kustomize resource GitHub private repository

我想知道是否可以从私有 GitHub 存储库中的 kustomize 获取资源,我已经尝试过类似的方法但没有成功

apiVersion: kustomize.config.k8s.io/v1beta1

kind: Kustomization

resources:
- git@github.com:gituser/kustomize.git/kustomize/main/nginx.yaml

- ssh://github.com/gituser/kustomize.git/kustomize/main/nginx.yaml

错误

Error: accumulating resources: accumulation err='accumulating resources from 'ssh://github.com/diego1277/kustomize.git//kustomize/main/nginx.yaml': evalsymlink failure on '/Users/diego/Desktop/estudo/kustomize/see/base/ssh:/github.com/diego1277/kustomize.git/kustomize/main/nginx.yaml' : lstat /Users/diego/Desktop/estudo/kustomize/see/base/ssh:: no such file or directory': evalsymlink failure on '/private/var/folders/qq/mk6t7dpd5435qm78_zsfdjvm0000gp/T/kustomize-056937086/kustomize/main/nginx.yaml' : lstat /private/var/folders/qq/mk6t7dpd5435qm78_zsfdjvm0000gp/T/kustomize-056937086/kustomize: no such file or directory

您的远程资源需要解析为 目录,其中包含 kustomization.yaml 文件。也就是说,而不是:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- git@github.com:gituser/kustomize.git/kustomize/main/nginx.yaml

你需要:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- git@github.com:gituser/kustomize.git/kustomize/main/

你的 kustomize/main 目录应该包含 kustomization.yaml。您可以使用 public 存储库进行尝试, 例如:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
  - "git@github.com:kubernetes-sigs/kustomize/examples/helloWorld"