1

I'm trying to expose an kubernetes service (AWX Operator) to access it outside from the deployed localhost. Port-forwarding is not an option, because it should be persistence.

My .yaml file (awx.yaml) looks like this:

---
apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
  name: awx
spec:
  service_type: NodePort
  nodeport_port: 30080
  ingress_type: ingress
  hostname: awx.company.com
  ingress_annotations: |
    environment: production

And will be deployed within a kustomization.yaml file, looks like this:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
  - github.com/ansible/awx-operator/config/default?ref=0.20.0
  - awx.yaml

images:
  - name: quay.io/ansible/awx-operator
    newTag: 0.20.0

namespace: awx-operator

The deployment is working properly. But now I'm not able to use Ingress in the right way to expose the web UI from AWX Operator to access it outside from the local machine (apart from port forwarding, but that's no solution regarding persistence as already mentioned).

$ kubectl get svc

NAME                                              TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)        AGE
awx-operator-controller-manager-metrics-service   ClusterIP   10.110.255.144   <none>        8443/TCP       4d
awx-postgres                                      ClusterIP   None             <none>        5432/TCP       3d23h
awx-service                                       NodePort    10.111.46.98     <none>        80:30080/TCP   3d23h

$ kubectl describe ingress

Name:             awx-ingress
Labels:           app.kubernetes.io/component=awx
                  app.kubernetes.io/managed-by=awx-operator
                  app.kubernetes.io/name=awx
                  app.kubernetes.io/operator-version=0.20.0
                  app.kubernetes.io/part-of=awx
Namespace:        awx-operator
Address:          192.168.49.2
Default backend:  default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
Rules:
  Host               Path  Backends
  ----               ----  --------
  awx.company.com  
                     /   awx-service:80 (172.17.0.3:8052)
Annotations:         environment: production
Events:              <none>

$ kubectl get ingress --all-namespaces

NAMESPACE      NAME          CLASS   HOSTS               ADDRESS        PORTS   AGE
awx-operator   awx-ingress   nginx   awx.company.com   192.168.49.2   80      3d16h

I'm quite new to Kubernetes, so hopefully someone is able to say what's wrong / missing here. Thanks in advance.

L.Writer
  • 87
  • 7

1 Answers1

0

Running minikube with --driver=none exposed the service. However, this introduced a problem when running Ubuntu 20.04 that AWX data was not persisting after VM was restarted since minikube's PersistentVolume gets created under /tmp/hostpath-provisioner more info on this.

fabian
  • 111
  • 1
  • 10