nigelpoulton / TheK8sBook

YAML files for use with The Kubernetes Book
822 stars 665 forks source link

Update Git-Sync to v4.1.0 to resolve arm64 issue #44

Closed nicholas-heaton closed 10 months ago

nicholas-heaton commented 10 months ago

Updating git-sync to registry.k8s.io/git-sync/git-sync:v4.1.0 to resolve an issue with the prior git-sync version not running properly on arm64 architecture.

Git-sync 3.1.6 running against a raspberry pi cluster running k3s would fail. The error was:

$ kubectl logs git-sync -c ctr-sync INFO: detected pid 1, running init handler I0106 12:18:03.166056 12 main.go:321] "level"=0 "msg"="starting up" "args"=["/git-sync"] "pid"=12 I0106 12:18:03.166221 12 main.go:574] "level"=0 "msg"="cloning repo" "origin"="https://github.com/.../ps-sidecar.git" "path"="/tmp/git" E0106 12:18:03.172930 12 main.go:347] "msg"="failed to sync repo, aborting" "error"="error running command: fork/exec /usr/bin/git: exec format error: { stdout: \"\", stderr: \"\" }"

This is apparently a common issue with running the wrong architecture.

Despite version 3.1.6 having an arm64 release (https://console.cloud.google.com/gcr/images/k8s-artifacts-prod/us/git-sync@sha256:aa88eb188b3bd4bdd2a4237a4d7be2b8df0cad5be002ad82c13bf47aa2f9bd13/details?tab=pull), it fails to run properly.

Moving to 4.1.0 has resolved the issue.

nicholas-heaton commented 10 months ago

Although this allows us to progress further, it does not sync properly as git-sync has several changes between v3 and v4.

All of the arguments changed names, and I believe the new ones are as follows:

that said, I cannot get it to sync properly with v4 and will be backing out of this PR.

nicholas-heaton commented 10 months ago

Although this allows us to progress further, it does not sync properly as git-sync has several changes between v3 and v4.

All of the arguments changed names, and I believe the new ones are as follows:

that said, I cannot get it to sync properly with v4 and will be backing out of this PR.

jlyons210 commented 2 months ago

Not sure if you fixed this on your own or not, but k8s.gcr.io/git-sync/git-sync:v3.6.5 worked for me on arm64 (Pi 5, microk8s). (ref)