Month: August 2021

  • How to Setup Ingress on Minikube Kubernetes with example

    If you are learning Kubernetes then you might had heard of Ingress object which is used to allow external network access to the Kubernetes cluster. For doing a hands on, Minikube is one of the widely used software which setups Kubernetes environment. In this article, I am going to show you how to enable Ingress in Minikube and a example on how to use it.

    Before You Begin

    If you are new to Minikube and haven't installed it yet, then refer to the below article for the installation steps.

    • Install Kubernetes using Minikube on Linux, CentOS, Fedora, Red Hat

    You should have a working Minikube setup and dashboard. The kubectl tool must be installed and working in tandem with Minikube.

    Start Minikube

    minkube start

    Enable Ingress Controller

    • Run the following command to enable the NGINX Ingress controller:
    minikube addons enable ingress
    • Verify whether Ingress controller is running or not:
    kubectl get pods -n kube-system

    Use Kubernetes Dashboard as application

    Since Ingress controller is enabled and ready for use, lets deploy Ingress service for Minikube Kubernetes dashboard.

    • Get the Kubernetes dashboard details which is present in kubernetes-dashboard namespace by running following command:
    kubectl get all -n kubernetes-dashboard

    Output:

    NAME                                             READY   STATUS    RESTARTS   AGE
    pod/dashboard-metrics-scraper-7976b667d4-f6q74   1/1     Running   6          23d
    pod/kubernetes-dashboard-6fcdf4f6d-ghq97         1/1     Running   12         23d
    
    NAME                                TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)    AGE
    service/dashboard-metrics-scraper   ClusterIP   10.100.4.35      <none>        8000/TCP   23d
    service/kubernetes-dashboard        ClusterIP   10.110.150.181   <none>        80/TCP     23d
    
    NAME                                        READY   UP-TO-DATE   AVAILABLE   AGE
    deployment.apps/dashboard-metrics-scraper   1/1     1            1           23d
    deployment.apps/kubernetes-dashboard        1/1     1            1           23d
    
    NAME                                                   DESIRED   CURRENT   READY   AGE
    replicaset.apps/dashboard-metrics-scraper-7976b667d4   1         1         1       23d
    replicaset.apps/kubernetes-dashboard-6fcdf4f6d         1         1         1       23d
    • Note down the Kubernetes dashboard service name and port (highlighted in above output) which will be used to create ingress resource.

    Create Ingress Resource and Validate

    • Let's create a ingress resource using dashboard-ingress.yaml file with below contents:
    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
      name: dashboard-ingress
      namespace: kubernetes-dashboard
    spec:
        rules:
          - host: kub-dashboard.com
            http:
              paths:
              - path: /
                pathType: Prefix
                backend:
                  service:
                    name: kubernetes-dashboard
                    port:
                      number: 80
    • In the above file, apiVersion  and kind denotes ingress resource.
    • The name of the resource will be dashboard-ingress which will be created under kubernetes-dashboard namespace. Note that we are not using default namespace here because kubernetes-dashboard is present in kubernetes-dashboard namespace.
    • Under specification we define host name as kub-dashboard.com as an example here. You can use any domain here as we will be creating host file entry later. Under http, provide path to which dashboard opens, service name to use and port number on which service is exposed. If you recollect, this information is already gathered in previous step.
    • Let's create ingress resource using the above file now by running following command:
    kubectl apply -f dashboard-ingress.yaml

    Output:

    ingress.networking.k8s.io/dashboard-ingress created
    • Get the ingress resource details like IP and port by running following command:
    kubectl get ingress -n kubernetes-dashboard

    Output:

    NAME                CLASS    HOSTS               ADDRESS          PORTS   AGE
    dashboard-ingress   <none>   kub-dashboard.com   192.168.99.100   80      3m53s
    • We have specified domain name kub-dashboard.com in ingress resource file. Let's create a local host file entry on system and point it to the IP 192.168.99.100 which is assigned by ingress service as in above output.
    • After adding the entry, browse the domain kub-dashboard.com and you should see the kubernetes dashboard displayed as in following image:

    kub-dashboard

    Do you have any additional comments, questions, or concerns you would like to share? Please post in comments section.

  • How to fix widget loading error in WordPress 5.8

    WordPress recently made a major change in 5.8 version where widgets are displayed in block editor style instead of classic style. Many users started to face the problem with loading the widgets after updating WordPress version to 5.8. There is no option provided to switch back to classic style in WordPress by default. Even WordPress haven't made any official statement on the same but we should expect a fix soon.

    Solution 1:  Fix WordPress widget not showing error by using plugin

    For now, users facing issue with loading of the widgets can bring back the old classic style by installing a plugin called Classic Widgets developed by WordPress team. After installation, activate the plugin and widgets will be loaded in classic style. At any point you can switch back to block editor style by disabling the plugin.

    Solution 2:  Fix WordPress widgets not showing up in dashboard error by updating WordPress theme

    The theme creators have started to take a note of the widget error & other issues introduced in WordPress 5.8. Therefore, check if there is a new update available for your theme and change log which mentions the fix and updates. If there is no update pushed by the theme developers then try reaching them out through their support channel

    Solution 3:  Fix WordPress widget error by downgrading WordPress version

    The problem does not get resolve by switching to default WordPress theme or deactivating activating WordPress plugins. But you can consider downgrading the WordPress version to 5.7.x. Checkout the post below on how to downgrade the WordPress version.

    How to Downgrade WordPress version to any previous version

    Hope one of the above solution works for you and widgets are visible again from admin dashboard. Happy Blogging!

Back to top button