Martin Koníček

Blog

MicroK8s git fetch kustomize error

Showcase image

This is a simple workaround when you get a git fetch error when trying deploy kustomize on MicroK8s

Error

kubectl kustomize "github.com/kubernetes-sigs/gateway-api/config/crd/experimental?ref=444631bfe06f3bcca5d0eadf1857eac1d369421d" | kubectl apply -f -
error: git cmd = '/snap/microk8s/6572/usr/bin/git fetch --depth=1 origin 444631bfe06f3bcca5d0eadf1857eac1d369421d': exit status 128

Solution

 sudo mount --bind -o nodev,ro /usr/bin /snap/microk8s/current/usr/bin

Resolution

$ sudo mount --bind -o nodev,ro /usr/bin /snap/microk8s/current/usr/bin
$ kubectl kustomize "github.com/kubernetes-sigs/gateway-api/config/crd/experimental?ref=444631bfe06f3bcca5d0eadf1857eac1d369421d" | kubectl apply -f -
customresourcedefinition.apiextensions.k8s.io/gatewayclasses.gateway.networking.k8s.io configured
customresourcedefinition.apiextensions.k8s.io/gateways.gateway.networking.k8s.io configured
customresourcedefinition.apiextensions.k8s.io/grpcroutes.gateway.networking.k8s.io configured
customresourcedefinition.apiextensions.k8s.io/httproutes.gateway.networking.k8s.io configured
customresourcedefinition.apiextensions.k8s.io/referencegrants.gateway.networking.k8s.io configured
customresourcedefinition.apiextensions.k8s.io/tcproutes.gateway.networking.k8s.io configured
customresourcedefinition.apiextensions.k8s.io/tlsroutes.gateway.networking.k8s.io configured
customresourcedefinition.apiextensions.k8s.io/udproutes.gateway.networking.k8s.io configured

This is regarding wrong version of git related to bug https://github.com/canonical/microk8s/issues/4202

  • MicroK8S failing with Kustomize
    MicroK8S failing with KustomizeWhen you get an error message error: failed to run '/snap/microk8s/5250/usr/bin/git fetch --depth=1 https://... main': fatal: couldn't find remote ref main this might be a solution
  • cs | en