# Deploying awx-operator with Kustomize gives error

**URL:** <https://forum.ansible.com/t/deploying-awx-operator-with-kustomize-gives-error/8430>\
**Category:** Get Help\
**Tags:** awx-operator, awx, kubernetes\
**Created:** [September 11, 2024, 7:44am UTC](https://forum.ansible.com/t/deploying-awx-operator-with-kustomize-gives-error/8430 "2024-09-11T07:44:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![xibriz](https://avatars.discourse-cdn.com/v4/letter/x/7bcc69/32.png) [@xibriz](https://forum.ansible.com/u/xibriz)\
**Post date:** [September 11, 2024, 7:44am UTC](https://forum.ansible.com/t/deploying-awx-operator-with-kustomize-gives-error/8430/1 "2024-09-11T07:44:31Z")

</div>

When deploying the awx-operator for the first time on a new K3s cluster, i use the following command: `kubectl apply -k .`

This procudes the following output:

```bash
namespace/awx created
customresourcedefinition.apiextensions.k8s.io/awxbackups.awx.ansible.com created
customresourcedefinition.apiextensions.k8s.io/awxmeshingresses.awx.ansible.com created
customresourcedefinition.apiextensions.k8s.io/awxrestores.awx.ansible.com created
customresourcedefinition.apiextensions.k8s.io/awxs.awx.ansible.com created
serviceaccount/awx-operator-controller-manager created
role.rbac.authorization.k8s.io/awx-operator-awx-manager-role created
role.rbac.authorization.k8s.io/awx-operator-leader-election-role created
clusterrole.rbac.authorization.k8s.io/awx-operator-metrics-reader created
clusterrole.rbac.authorization.k8s.io/awx-operator-proxy-role created
rolebinding.rbac.authorization.k8s.io/awx-operator-awx-manager-rolebinding created
rolebinding.rbac.authorization.k8s.io/awx-operator-leader-election-rolebinding created
clusterrolebinding.rbac.authorization.k8s.io/awx-operator-proxy-rolebinding created
configmap/awx-operator-awx-manager-config created
service/awx-operator-controller-manager-metrics-service created
deployment.apps/awx-operator-controller-manager created
ingress.networking.k8s.io/awx-network-ingress created
error: resource mapping not found for name: "awx-network" namespace: "awx" from ".": no matches for kind "AWX" in version "awx.ansible.com/v1beta1"
ensure CRDs are installed first

```

If I do a `kubectl delete -k .` and wait a few minutes, then try `kubectl apply -k .` again everything works fine.

I guess there may be some depencencies or the order I have defined things that causes this behavior. Anyone with any insights?

Below are the files involved:

**kustomization.yaml**

```yaml
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
  - github.com/ansible/awx-operator/config/default?ref=2.19.1
  - awx-network.yaml
  - awx-traefik-ingress.yaml

# Set the image tags to match the git version from above
images:
  - name: quay.io/ansible/awx-operator
    newTag: 2.19.1

# Specify a custom namespace in which to install AWX
namespace: awx

```

**awx-network.yaml**

```yaml
---
apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
  name: awx-network
spec:
  service_type: LoadBalancer

```

**awx-traefik-ingress.yaml**

```yaml
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  namespace: awx
  name: awx-network-ingress
  annotations:
    traefik.ingress.kubernetes.io/router.entrypoints: websecure
    traefik.ingress.kubernetes.io/router.tls: "true"
spec:
  tls:
    - hosts:
        - awx.domain.com
      secretName: awx-network-cert
  rules:
    - host: awx.domain.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: awx-network-service
                port:
                  number: 80

```
