Contents

LFS258-14-11-2026

Contents

Another day, another study day.

Just finish watching a live session with techworld nana yesterday. It was about promoting her bootcamp. Look interesting though. Well let me get back to where i’m still working on and that is the LFS258. Today I’ll will be working on acces the application that is running in the cluster from outside the cluster: I will go through some commands that might be usefull for later reference.

The following command will show the environment variables for a certain pod:

kubectl exec nginx-56c45fd5ff-jr6l5 -- printenv | grep KUBERNETES

I’m not quite sure why this is being shown to me beside that its good to know.

The following is used to make the deployment accesible from outside.

kubectl expose deployment nginx --type=LoadBalancer

Above will put the External IP as pending. ‘Unless a provider responds with a load balancer it will continue to show as pending’

MetalLB would be a solution in my case since my cluster running is running on bare metal. That is says pending is something like its requesting for an external address, but there must be something that implements it.

In the case of the example of the course it suggest the following command to get its external IP.

curl ifconfig.io

In my case that won’t seem to matter. Its due to the fact the Raspberry PI are more isolated. They are behind a router in the first place. A future perspective would be that my main nginx docker-container running on my homelab-thinkclient’s machine will delegate traffic through a reverse to the Kubernetes cluster. For now I could just access the Nginx page from outside by first looking up the external port number.

mjerta@pi-control-1:~ $ kubectl get svc
NAME         TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)        AGE
kubernetes   ClusterIP      10.96.0.1        <none>        443/TCP        215d
nginx        LoadBalancer   10.107.193.242   <pending>     80:31780/TCP   2m3s

So rather using the external public IP i’m using the local subnet IP.

~ ❯ curl 192.168.1.81:31780
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, nginx is successfully installed and working.
Further configuration is required for the web server, reverse proxy,
API gateway, load balancer, content cache, or other features.</p>

<p>For online documentation and support please refer to
<a href="https://nginx.org/">nginx.org</a>.<br/>
To engage with the community please visit
<a href="https://community.nginx.org/">community.nginx.org</a>.<br/>
For enterprise grade support, professional services, additional
security features and capabilities please refer to
<a href="https://f5.com/nginx">f5.com/nginx</a>.</p>

<p><em>Thank you for using nginx.</em></p>
</body>
</html>

Furthermore it was just about scaling down and deleting the deployment and the service as well.