minikube // creating a sample app

test internal vs external connection

lessons learned

internal service

    kubectl create deploy redis --image=redis
kubectl expose deploy redis --type=ClusterIP --port=6379

DIY CGI SCRIPT

deploy a single devuan instance

kubectl create deploy devuan --image=pbraun9/devuan
    kubectl expose deploy devuan --type=NodePort --port=80

install thttpd and setup CGI without chroot

kubectl get pods | grep devuan
kubectl exec -ti <POD> bash

apt update -y
apt install build-essential -y
apt install redis-tools nmap -y
nmap -p 6379 redis -Pn
redis-cli -h redis

set testkey testvalue

^D

and proceed with some minimal http daemon

vi /etc/thttpd.conf

dir=/var/www/html
logfile=/var/log/thttpd.log
pidfile=/var/run/thttpd.pid
cgipat=**.cgi

mkdir -p /var/www/html/
cd /var/www/html/
vi index.cgi

#!/bin/bash
echo -e "Content-type: text/html\n"
echo "<p>ok as cgi script"
echo -n "<p>testkey key has this value: "
redis-cli -h redis get testkey

chmod +x index.cgi

start the daemon

/usr/local/sbin/thttpd -C /etc/thttpd.conf
ps auxw | grep thttpd # runs as nobody by default
netstat -lntup

acceptance

    minikube service devuan --url
curl -i http://192.168.49.2:3XXXX

resources

https://stackoverflow.com/questions/58986178/microservice-calling-another-microservice-in-same-kubernetes-cluster

https://stackoverflow.com/questions/48092942/call-a-service-from-any-pod

https://stackoverflow.com/questions/53406249/how-to-access-the-service-deployed-on-one-pod-via-another-pod-in-kubernetes

https://kubernetes.io/docs/tutorials/services/connect-applications-service/

https://stackoverflow.com/questions/58741807/pods-in-microservices

redis

https://redis.io/commands/set/


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun