Monthly Archives: July 2025

Adding Nginx Ingress controller to your Kubernetes cluster

You’ve created your Kubernetes cluster, added a service, therefore you’ve set up deployments, services and ingress but now you want to expose the cluster to the outside world.

We need to add am ingress controller such as nginx.

  • helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
    
  • helm repo update
    
  • helm install ingress-nginx ingress-nginx/ingress-nginx \
      --create-namespace \
      --namespace ingress-nginx \
      --set controller.service.annotations."service\.beta\.kubernetes\.io/azure-load-balancer-health-probe-request-path"=/healthz \
      --set controller.service.externalTrafficPolicy=Local
    

Note: In my case my namespace is ingress-nginx, but you can set to what you prefer.

Now I should say, originally I installed using

helm install ingress-nginx ingress-nginx/ingress-nginx --namespace ingress-nginx --create-namespace

and I seemed to not be able to reach this from the web, but including here just for reference.

To get your EXTERNAL-IP, i.e. the one exposed to the web, use the following (replace the -n with the namespace you used).

kubectl get svc ingress-nginx-controller -n ingress-nginx

If you’re using some script to get the IP, you can extract just that using

kubectl get svc ingress-nginx-controller -n ingress-nginx -o jsonpath='{.status.loadBalancer.ingress[0].ip}'

Now my IP is not static, so upon redeploying the controller it’s possible this might change, so be aware of this. Ofcourse to get around it you could create a static IP with Azure (at a nominal cost).

Still not accessing your services, getting 404’s with Nginx web page displayed ?

Remember that in your ingress (i.e. the services ingress), you might have something similar to below.

Here, we set the host name, hence in this case the service will NOT be accessed via the IP itself, it needs to be used via the domain name so it matches against the ingress for the service.

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: hello-ingress
  namespace: development
  annotations:
    kubernetes.io/ingress.class: "nginx"
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - host: mydomain.com  # Replace with your actual domain
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: hello-service
            port:
              number: 80

Adding Prometheus/Grafana to your Kubernetes Cluster

Let’s assume you’ve got a running Kubernetes cluster set up, with some services running and you’d like to monitor the state of the cluster/namespace or specific pods. Using Prometheus along with Grafana is a great solution.

To deploy, just follow these steps by executing the following commands (you’ll need helm installed).

  • helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
  • helm repo update
  • helm install prometheus prometheus-community/kube-prometheus-stack –namespace monitoring –create-namespace

With the last command you should see something like the following

Response was
NAME: prometheus
LAST DEPLOYED: Sat Jul 26 12:03:34 2025
NAMESPACE: monitoring
STATUS: deployed
REVISION: 1
NOTES:
kube-prometheus-stack has been installed. Check its status by running:

Now to check everything is working and to use Grafana Dashboards, simply use port forwarding, i.e.

kubectl port-forward svc/prometheus-grafana 80:80 -n monitoring

Now you can access http://localhost:80 (or whatever port has been set up).

Default login credentials are username/password admin/prom-operator.

Azure Managed Prometheus

You can also use Azure’s managed Prometheus instance.

I’ve not tried setting this up via Azure, so the steps below are taken from another source (sorry I cannot recall where), feel free to try them

  • Enable Azure Monitor Managed Prometheus
  • Go to your AKS cluster in the Azure Portal.
  • Under Monitoring, enable Managed Prometheus.
  • Create Azure Managed Grafana
  • Use the Azure Portal or CLI to create a Grafana instance.
  • Link it to your Azure Monitor workspace.
  • Configure Grafana Data Source
  • In Grafana, add a Prometheus data source.
  • Use the Azure Monitor workspace query endpoint.
  • Assign Permissions
  • Ensure your Grafana instance or app registration has the Monitoring Data Reader role on the workspace.

Windows Terminal History

I really like the Windows Terminal application, it’s autocomplete is really useful for reminding me of commands I’ve used, but occasionally you have commands that are similar and one way to check what’s in the list that makes up the autocompletion options is to look at the ConsoleHost_history.txt file

$env:APPDATA\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt

dotnet says the runtime and sdk exists on Linux but Rider and Visual Code thinks they don’t

As part of my Macbook Air using Linux Mint, I’ve been getting my development environments set up.

I got .NET 8 and .NET 9 installed so that running both of the following listed them

dotnet --list-sdks
dotnet --line-runtimes

But Visual Studio Code and Rider complain that .NET 8 and .NET 9 need to be installed.

It was this Stackoverflow post that had the answer.

I deleted the /etc/dotnet folder as per the previous link suggests and things started working.

Installing Linux on my old Macbook Air

I’ve an old Intel based Macbook Air which, unfortunately Apple no longer support updates for, it’s a great little machine which I want to keep running. So, I do what I always do when the OS outgrows the hardware, I install Linux on it.

I would usually install Ubuntu but thought I’d try something lighter weight, by installing Linux Mint.

  • The first thing we need to do is download the ISO from the Linux Mint site (I went with the Cinnamon Edition).
  • New we need to write the ISO to a USB drive to create a bootable USB, I used Ubuntu and already had the tools for this but Etcher seems to be the go to application for this nowadays, so you could download/install this and create your bootable USB from the ISO.

Once you have the bootable USB, it’s over to your Mac.

  • Boot your Mac up whilst holding the Option key to go to the startup manager
  • Select the EFI drive (coloured orange)
  • Select “Start Cinnamon” option

The above will take you into a LIVE mode, i.e. you’ve not installed Linux but are running from the USB. Let’s check everything works for you before you commit to installing Linux Mint. From the Linux Mint, Cinnamon desktop…

  • Open Drive Manager look for your network adapter
  • Apply/install any required drivers
  • From network icon in desktop select your WiFi network

Play around with the OS and check it’s what you want to install and all works, then if you’re going to commit and overwrite MacOS

  • Double click the Install Linux Mint icon

I had an issue when I installed Mint, in that it no longer installed the drivers for the WiFi when I went to Driver Manager to select them. Instead it wanted to go online to get them – difficult as the WiFi drivers are what I’m trying to install and I had no ethernet attachment and to be honest, I know the drivers are on the USB as it worked in LIVE mode.

To get things working, I found that if I mounted the USB drive and searched for the Broadcom packages (and these are what was installed via testing in LIVE) and now double clicking on the two files/packages within the USB installation directories, then I could install the drivers and everything worked.

Disclaimer: I’ve only just installed Linux Mint on the Macbook Air, so I haven’t down any extensive testing.