I can run ejabberd service on docker swarm. Do I Deployment a ejabberd service on kubernetes ?
YML for swarm:
version: "3.3"
services:
ejabberd:
image: ejabberd/ecs:18.03
networks:
- backend
ports:
- 5222:5222
- 5269:5269
- 5280:5280
volumes:
- ./ejabberd/database/:/home/ejabberd/database/
- ./ejabberd/logs/:/home/ejabberd/logs/
- ./ejabberd/conf/ejabberd.yml:/home/ejabberd/conf/ejabberd.yml
networks:
backend:
external: true
This is a basic deployment yaml file for kubernetes without volumes. you can add some volume mounts also depending how are you using them.
apiVersion: apps/v1
kind: Deployment
metadata:
name: ejabberd-deployment
labels:
app: ejabberd
spec:
replicas: 1
selector:
matchLabels:
app: ejabberd
template:
metadata:
labels:
app: ejabberd
spec:
containers:
- name: ejabberd
image: ejabberd/ecs
ports:
- containerPort: 5280
- containerPort: 5222
- containerPort: 5269