1

trying to setup my GC Kubernetes. Using the Ingress controller for the load balancing. While it works perfect for services connected to containers running on my kubernetes, I struggle to get it working for my external wordpress.

I followed the explaination on https://kubernetes.io/docs/concepts/services-networking/service/ and created a service without selector.

apiVersion: v1
kind: Service
metadata:
    name: external-wordpress-service
    annotations: 
        ingress.kubernetes.io/preserve-host: "false"
spec:
    type: ExternalName
    externalName: xyz.myraidbox.de

Then I edit my ingress.yaml to point to this service

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: spx-ingress
spec:
  tls:
  - hosts:
    - domain.com
    - www.domain.com
    secretName: le-tls-cert-prod-04
  backend:
    serviceName: frontend-service
    servicePort: 80
  rules:
  - http:
      paths:
      - path: /
        backend:
          serviceName: frontend-service
          servicePort: 80
      - path: /test/
        backend:
          serviceName: external-wordpress-service
          servicePort: 80

So the plan is to have to have www.domain.com/test/ to access my external wordpress on the root level

www.domain.com/test/ -> xyz.myraidbox.de

After almost a billion edits I still get the 404 and my frontend returns the 404 page instead of contents from my external WP.

Any suggestions? Thx in advance

Cheers Andy

0

I see that the Ingress backend is not configured to point to a kubernetes resource, but it points to an external website (wordpress). This is possible, you can create a backend that points to an external website in the Service, however, you would need to add more specifications to the Service.

Solution : Try to follow this example in this GitHub thread, and specify a port 80, a targetport and a protocol in the Service.

In the following way:

kind: Service
apiVersion: v1
metadata:
  name: external-wordpress-service
  annotations: 
        ingress.kubernetes.io/preserve-host: "false"
spec:
  ports:
  - protocol: TCP
    port: 80
    targetPort: 80
  type: ExternalName
  externalName: xyz.myraidbox.de
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.