skip to Main Content

I deploy a kubernetes cluster on Ubuntu following the steps described at this link

Then I deploy a WordPress following steps found at here

Everything works fine but I miss what I should do to serve the wp instance at a specific hostname like http://wp.example.com instead of http://[kubeip]:port

I’d like to have several different WP instances which respond to specific url.
I tried to have a look at Ingress but I did not find nothing clear and I don’t know if it’s the right choice.

Can someone suggest me something?
Thanks

3

Answers


  1. Chosen as BEST ANSWER

    TY. I follow the guide to add the nginx-ingress-controller in a bare-metal at https://kubernetes.github.io/ingress-nginx/deploy/#provider-specific-steps

    Then I tried to use a ingress.yaml like this

    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
        name: wordpress-ingress
        annotations:
            nginx.ingress.kubernetes.io/rewrite-target: /
    spec:
        defaultBackend:
            service:
                name: wordpress
                port:
                    number: 80
        rules:
          - host: wp.example.com
            http:
                paths:
                  - path: /
                    pathType: Prefix
                    backend:
                        service:
                            name: wordpress
                            port:
                                number: 80
    

    But it doesn't work as expected


  2. You’re looking for an ingress controller.

    You could go with the nginx-ingress-controller, traefik, haproxy, … several implementations exist.

    Then, in addition to creating a Service exposing your wordpress container, you would create an Ingress object.

    Login or Signup to reply.
  3. I suggest to you use Helm to install your wordpress with this command

    helm upgrade --install picvec-wp bitnami/wordpress --set global.storageClass=nfs-client --set ingress.enabled=true --set ingress.hostname=wp.novinparva.com --set ingress.path=/ --set ingress.tls=true --set ingress.extraHosts[0].name=wp.novinparva.com --set ingress.extraHosts[0].path=/ --set ingress.certManager=true --set wordpressPassword=asdvqwkjn --set mariadb.auth.rootPassword=$MARIADB_ROOT_PASSWORD --set mariadb.auth.password=$MARIADB_PASSWORD  --set allowOverrideNone=false --set htaccessPersistenceEnabled=true
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search