weaveworks / wks-quickstart-firekube

Example configuration to create Kubernetes clusters powered by ignite and gitops
343 stars 374 forks source link

Starting setup.sh with git-deploy-key fails #56

Open kingdonb opened 4 years ago

kingdonb commented 4 years ago

Creating a firekube cluster with the --git-deploy-key as described in README fails, with an error indicating that the git URL was not authenticatable via the provided authentication.

This seems to be because of an issue, where there are git_http_url and git_ssh_url helpers defined, but only one is ever used in setup.sh:

 log "Updating container images and git parameters"
-wksctl init --git-url=$(git_http_url $(git config --get remote.origin.url)) --git-branch=$(git rev-parse --abbrev-ref HEAD)
+wksctl init --git-url=$(git_ssh_url $(git config --get remote.origin.url)) --git-branch=$(git rev-parse --abbrev-ref HEAD)
 log "Installing Kubernetes cluster"
-wksctl apply --git-url=$(git_http_url $(git config --get remote.origin.url)) --git-branch=$(git rev-parse --abbrev-ref HEAD) $git_deploy_key
+wksctl apply --git-url=$(git_ssh_url $(git config --get remote.origin.url)) --git-branch=$(git rev-parse --abbrev-ref HEAD) $git_deploy_key
 wksctl kubeconfig

These simple changes appear to have solved it for me, and my cluster comes online successfully, but ideally the PR that resolves this will have some logic so the user does not need to update setup.sh and the process described in README will be all that is needed.

kingdonb commented 4 years ago

What I was really trying to do, was just enable Flux to write to the repo, because I am used to seeing those flux sync tags. It turns out there is a --read-only set somewhere inside of this stack, and flux is operating in secret mode without the git tags.

This looks like progress, as far as I'm concerned, I can see a lot of questions about the reasons why Flux should be allowed to write to the repo handled much easier when it's possible to say "this is not required and it is not enabled by default" – although I may prefer the git-based mode!