Skip to content

kustomize feature of kubectl does not function #3988

Description

@darrenstarr

Summary

microk8s kubectl apply -k

Has issues resolving paths.

What Should Happen Instead?

I discovered this problem while trying to deploy awx on microk8s. See the installation instructions here :
https://github.com/ansible/awx-operator#basic-install

The correct behavior is that when I execute

kubectl apply -k .

in a directory containing a properly formatted kustomization.yaml file, the awx deployment should take effect.

What is seen however is the following

root@microk8s:~# microk8s kubectl apply -k .
error: accumulating resources: accumulation err='accumulating resources from 'github.com/ansible/awx-operator/config/default?ref=2.2.1': evalsymlink failure on '/root/github.com/ansible/awx-operator/config/default?ref=2.2.1' : lstat /root/github.com: no such file or directory': git cmd = '/snap/microk8s/5219/usr/bin/git fetch --depth=1 origin 2.2.1': exit status 128

Reproduction Steps

  1. Install microk8s on a fresh Ubuntu 22.04 LTS system using snap
  2. Create a file named kustomization.yaml containing the following text
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
  - github.com/ansible/awx-operator/config/default?ref=2.2.1
images:
  - name: quay.io/ansible/awx-operator
    newTag: 2.2.1
namespace: awx
  1. execute microk8s kubectl apply -k .

Introspection Report

I don't have a fresh installation, the reproduction steps are consistent on every machine I've tried.

Can you suggest a fix?

I'm not sure about a fix, but this is a temporary work around.

Install kustomize on its own following the instructions on their website.

curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"  |  bash

Which installs kustomize in the current directory. Then use kustomize in "legacy form"

./kustomize build | microk8s kubectl apply -f -

Are you interested in contributing with a fix?

no, thought I am willing to test the fix if one is provided.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions