Kubernetes with Manifest files
OliveTin works just fine on Kubernetes. The easiest way to deploy it is with a
Kubernetes ConfigMap
, Deployment
, Service
and finally Ingress
. Like so;
ConfigMap
apiVersion: v1
kind: ConfigMap
metadata:
name: olivetin-config
data:
config.yaml: |
actions:
- title: "Hello world!"
shell: echo 'Hello World!'
The main application config.yml for OliveTin is specified in the ConfigMap
above. You will want to edit this later - see the "Configuration" section.
Next, we need a deployment;
Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: olivetin
spec:
replicas: 1
selector:
matchLabels:
app: olivetin
template:
metadata:
labels:
app: olivetin
spec:
containers:
- name: olivetin
image: docker.io/jamesread/olivetin:latest
ports:
- containerPort: 1337
volumeMounts:
- name: olivetin-config
mountPath: "/config"
readOnly: true
livenessProbe:
exec:
command:
- curl
- localhost:1337
initialDelaySeconds: 5
periodSeconds: 30
volumes:
- name: olivetin-config
configMap:
name: olivetin-config
That should deploy OliveTin.
Service
Now that OliveTin is deployed, expose it’s port as a service;
user@host: kubectl expose deployment/olivetin
Lastly, create a Ingress rule for for that service;
Ingress
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: olivetin-ingress
spec:
defaultBackend:
service:
name: olivetin
port:
number: 1337
rules:
- host: olivetin.apps.ocp.teratan.net
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: olivetin
port:
number: 1337
You should be able to browse to http://yourserver:1337 (or similar) to get to the web interface.
If you see the OliveTin page popup in your browser, you can jump to the configuration section as the next step.