Skip to content

Latest commit

 

History

History
115 lines (97 loc) · 3.42 KB

README.md

File metadata and controls

115 lines (97 loc) · 3.42 KB

Webserver Dwarfs !

Tired of seeing "hello nginx" when deploying test containers? Why not use dwarfs?

What is this?

This repository defines four distinquished webpages with colored dwarfs and docker containers for deployment with nginx.

OriKiliDvalinBifur

Why is this?

When deploying contianers, for example to Kubernetes, one often deploys a small webserver "just to see it works". This project provides a playful alternative to the default webpage that says "Welcome to nginx" or "It works!".

Docker hub images

The docker images conatain a plain nginx image with the HTML files copied inside. Dockerfiles are present in each of the color-folders. Container images are public at Docker hub:

Deploy with Docker

For deployment of the blue dwarf locally use:

docker pull smidra/blue-dwarf
docker run -p 8099:80 --name blue-dwarf smidra/blue-dwarf

The dwarf shall be available at http://localhost:8099

Deploy with Kubernetes (imperative)

# Deploy resources
kubectl create deployment blue-dwarf --image=smidra/blue-dwarf
kubectl expose deployment blue-dwarf --name=blue-dwarf-svc --type=NodePort --port=80

If deploying with minikube...

# Watch for the assigned XYZ high port
kubectl get services
# Get minikube cluster ip
minikube ip

The dwarf shall be available at http://cluster-ip:XYZ

Deploy with Kubernetes (declarative)

Add to cluster with kubectl apply -f ...

Blue dwarf service:

apiVersion: v1
kind: Service
metadata:
  name: dwarf-svc
spec:
  selector:
    app: webserver-dwarf
  type: NodePort
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
      nodePort: 30073

Blue dwarf deployment:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: blue-dwarf
  labels:
    app: webserver-dwarf
spec:
  replicas: 1
  selector:
    matchLabels:
      app: webserver-dwarf
  template:
    metadata:
      labels:
        app: webserver-dwarf
    spec:
      containers:
      - name: blue-dwarf
        image: smidra/blue-dwarf
        ports:
        - containerPort: 80
      terminationGracePeriodSeconds: 4

The dwarf shall be available at http://cluster-ip:30073

Is it any good?

Yes

Credits

Garden Gnome Clip art by LA is used under the tems of CC BY-NC-SA 3.0

HTML index is based on the bootstrap sign in example

This work is lincensed under the MIT licence, mainly because the Greater Lunduke Lincese is not a real thing.