fluxcd / flux2-kustomize-helm-example

A GitOps workflow example for multi-env deployments with Flux, Kustomize and Helm.
https://fluxcd.io
Apache License 2.0
935 stars 992 forks source link

Bootstrap fails with Azure Devops Repo #49

Closed khauser closed 2 years ago

khauser commented 2 years ago

Hi,

since the bootstrap command fails in our environment:

flux bootstrap git \
  --url=ssh://git@ssh.dev.azure.com/v3/<org>/<product>/<repo> \
  --branch=master \
  --path=clusters/staging \
  --private-key-file=./identity

gives: failed to clone repository: empty git-upload-pack given

What would be the alternative command list without bootstrap to reach the same?

Thanks for help

stefanprodan commented 2 years ago

Bootstrap is not supported for Azure DevOps because Azure does not implement the Git v1 API specifications. Please see the Azure docs on how to do this manually: https://fluxcd.io/docs/use-cases/azure/#flux-installation-for-azure-devops

khauser commented 2 years ago
mkdir clusters/staging/flux-system -p

flux install \
  --export > ./clusters/staging/flux-system/gotk-components.yaml

git add -A && git commit -m "add components" && git push

kubectl apply -f ./clusters/staging/flux-system/gotk-components.yaml

flux create source git podinfo \
  --url=https://github.com/khauser/flux2-kustomize-helm-example.git \
  --branch=main \
  --interval=1m \
  --export > ./clusters/staging/podinfo-source.yaml

git add -A && git commit -m "add podinfo source" && git push

flux create kustomization infra \
  --source=podinfo \
  --path="./infrastructure" \
  --prune=true \
  --interval=10m

flux create kustomization apps \
  --source=podinfo \
  --path="./apps/staging" \
  --prune=true \
  --interval=10m \
  --depends-on=infra

Now I see a HelmRelease.

stefanprodan commented 2 years ago

After "add components" there is another step in the Azure doc, where you configure gotk-sync.yaml to sync the whole staging cluster, please read the docs.