My deployment already looks pretty good:
apiVersion: apps/v1
kind: Deployment
metadata:
name: ejabberd-server
namespace: ejabberd
labels:
app: ejabberd
spec:
replicas: 1
selector:
matchLabels:
pod-label: ejabberd-server-pod
template:
metadata:
labels:
pod-label: ejabberd-server-pod
spec:
containers:
- name: ejabberd
image: ejabberd/ecs:22.05
imagePullPolicy: IfNotPresent
ports:
- containerPort: 5222
protocol: TCP
name: c2s
- containerPort: 5223
protocol: TCP
name: c2s2
- containerPort: 5269
protocol: TCP
name: s2s
- containerPort: 5280
protocol: TCP
name: http
- containerPort: 5443
protocol: TCP
name: http-upload
- containerPort: 3478
protocol: UDP
name: stun
volumeMounts:
- name: ejabberd-pv
mountPath: /home/ejabberd/conf
subPath: conf
- name: ejabberd-pv
mountPath: /home/ejabberd/database
subPath: database
- name: ejabberd-pv
mountPath: /home/ejabberd/logs
subPath: logs
- name: ejabberd-pv
mountPath: /home/ejabberd/upload
subPath: upload
volumes:
- name: ejabberd-pv
persistentVolumeClaim:
claimName: ejabberd-pv
---
apiVersion: v1
kind: Service
metadata:
name: ejabberd-server
namespace: ejabberd
labels:
app: ejabberd
spec:
selector:
pod-label: ejabberd-server-pod
ports:
- port: 5222
targetPort: c2s
protocol: TCP
name: c2s
- port: 5223
targetPort: c2s2
protocol: TCP
name: c2s2
- port: 5269
targetPort: s2s
protocol: TCP
name: s2s
- port: 5280
targetPort: http
protocol: TCP
name: http
- port: 5443
targetPort: http-upload
protocol: TCP
name: http-upload
- port: 3478
targetPort: stun
protocol: UDP
name: stun
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ejabberd-ingress
namespace: ejabberd
annotations:
kubernetes.io/ingress.class: "public"
cert-manager.io/cluster-issuer: "letsencrypt-prod"
spec:
tls:
- hosts:
- example.com
secretName: ejabberd-secret
rules:
- host: example.com
http:
paths:
- pathType: Prefix
path: /
backend:
service:
name: ejabberd-server
port:
name: http
No errors in the logs.
Logs from ejabberd-server pod:
kubectl logs -n ejabberd pod/ejabberd-server-58c9f99bd7-gfs8m
2022-08-01 19:23:18.087105+00:00 [info] Loading configuration from /home/ejabberd/conf/ejabberd.yml
2022-08-01 19:23:18.549191+00:00 [info] Configuration loaded successfully
2022-08-01 19:23:18.733995+00:00 [info] Got no NOTIFY_SOCKET, notifications disabled
2022-08-01 19:23:18.749134+00:00 [info] Building language translation cache
2022-08-01 19:23:18.885865+00:00 [info] Creating Mnesia ram table 'ejabberd_commands'
2022-08-01 19:23:18.921770+00:00 [info] Creating Mnesia ram table 'route'
2022-08-01 19:23:18.926292+00:00 [info] Creating Mnesia ram table 'route_multicast'
2022-08-01 19:23:18.937374+00:00 [info] Creating Mnesia ram table 'session'
2022-08-01 19:23:18.940233+00:00 [info] Creating Mnesia ram table 'session_counter'
2022-08-01 19:23:18.947815+00:00 [info] Creating Mnesia ram table 's2s'
2022-08-01 19:23:18.950106+00:00 [info] Creating Mnesia ram table 'temporarily_blocked'
2022-08-01 19:23:18.957565+00:00 [info] Loading modules for localhost
2022-08-01 19:23:18.957766+00:00 [info] Creating Mnesia ram table 'mod_register_ip'
2022-08-01 19:23:18.960606+00:00 [info] Creating Mnesia disc table 'sr_group'
2022-08-01 19:23:18.964085+00:00 [info] Creating Mnesia disc table 'sr_user'
2022-08-01 19:23:18.975274+00:00 [info] Creating Mnesia disc_only table 'privacy'
2022-08-01 19:23:18.992369+00:00 [warning] Mnesia backend for mod_mam is not recommended: it's limited to 2GB and often gets corrupted when reaching this limit. SQL backend is recommended. Namely, for small servers SQLite is a preferred choice because it's very easy to configure.
2022-08-01 19:23:18.992517+00:00 [info] Creating Mnesia disc_only table 'archive_msg'
2022-08-01 19:23:18.996109+00:00 [info] Creating Mnesia disc_only table 'archive_prefs'
2022-08-01 19:23:19.024877+00:00 [info] Creating Mnesia disc table 'muc_room'
2022-08-01 19:23:19.028728+00:00 [info] Creating Mnesia disc table 'muc_registered'
2022-08-01 19:23:19.032222+00:00 [info] Creating Mnesia ram table 'muc_online_room'
2022-08-01 19:23:19.036094+00:00 [info] Creating Mnesia disc_only table 'vcard'
2022-08-01 19:23:19.039410+00:00 [info] Creating Mnesia disc table 'vcard_search'
2022-08-01 19:23:19.049908+00:00 [info] Creating Mnesia disc_only table 'motd'
2022-08-01 19:23:19.053793+00:00 [info] Creating Mnesia disc_only table 'motd_users'
2022-08-01 19:23:19.066604+00:00 [info] Creating Mnesia ram table 'bosh'
2022-08-01 19:23:19.069363+00:00 [info] Creating Mnesia disc_only table 'push_session'
2022-08-01 19:23:19.083791+00:00 [info] Going to offer STUN/TURN service: 10.1.84.163:3478 (udp)
2022-08-01 19:23:19.084000+00:00 [info] Creating Mnesia disc_only table 'roster'
2022-08-01 19:23:19.095523+00:00 [info] Creating Mnesia disc_only table 'roster_version'
2022-08-01 19:23:19.131199+00:00 [info] Creating Mnesia disc_only table 'last_activity'
2022-08-01 19:23:19.142272+00:00 [info] Creating Mnesia disc_only table 'offline_msg'
2022-08-01 19:23:19.180095+00:00 [info] Creating Mnesia disc_only table 'caps_features'
2022-08-01 19:23:19.184118+00:00 [info] Creating Mnesia ram table 'pubsub_last_item'
2022-08-01 19:23:19.187907+00:00 [info] Creating Mnesia disc table 'pubsub_index'
2022-08-01 19:23:19.194377+00:00 [info] Creating Mnesia disc table 'pubsub_node'
2022-08-01 19:23:19.198379+00:00 [info] Creating Mnesia disc table 'pubsub_state'
2022-08-01 19:23:19.201806+00:00 [info] Creating Mnesia disc_only table 'pubsub_item'
2022-08-01 19:23:19.207546+00:00 [info] Creating Mnesia disc table 'pubsub_orphan'
2022-08-01 19:23:19.211797+00:00 [info] Creating Mnesia disc_only table 'private_storage'
2022-08-01 19:23:19.223678+00:00 [info] Creating Mnesia disc_only table 'mqtt_pub'
2022-08-01 19:23:19.230761+00:00 [info] Creating Mnesia ram table 'mqtt_session'
2022-08-01 19:23:19.233345+00:00 [info] Creating Mnesia ram table 'mqtt_sub'
2022-08-01 19:23:19.244795+00:00 [info] Building MQTT cache for localhost, this may take a while
2022-08-01 19:23:19.251889+00:00 [info] Creating Mnesia ram table 'bytestream'
2022-08-01 19:23:19.259759+00:00 [info] Creating Mnesia disc_only table 'passwd'
2022-08-01 19:23:19.263053+00:00 [info] Creating Mnesia ram table 'reg_users_counter'
2022-08-01 19:23:19.278022+00:00 [info] Creating Mnesia disc_only table 'oauth_token'
2022-08-01 19:23:19.281537+00:00 [info] Creating Mnesia disc table 'oauth_client'
2022-08-01 19:23:19.309833+00:00 [info] Waiting for Mnesia synchronization to complete
2022-08-01 19:23:19.368156+00:00 [warning] No certificate found matching localhost
2022-08-01 19:23:19.368406+00:00 [warning] No certificate found matching pubsub.localhost
2022-08-01 19:23:19.368592+00:00 [warning] No certificate found matching upload.localhost
2022-08-01 19:23:19.368708+00:00 [warning] No certificate found matching conference.localhost
2022-08-01 19:23:19.368791+00:00 [warning] No certificate found matching proxy.localhost
2022-08-01 19:23:19.368988+00:00 [info] ejabberd 22.5.0 is started in the node 'ejabberd@ejabberd-server-58c9f99bd7-gfs8m' in 1.42s
2022-08-01 19:23:19.369226+00:00 [info] Start accepting TCP connections at [::]:5269 for ejabberd_s2s_in
2022-08-01 19:23:19.369269+00:00 [info] Start accepting TLS connections at [::]:5443 for ejabberd_http
2022-08-01 19:23:19.369273+00:00 [info] Start accepting TLS connections at [::]:5223 for ejabberd_c2s
2022-08-01 19:23:19.369355+00:00 [info] Start accepting TCP connections at [::]:5222 for ejabberd_c2s
2022-08-01 19:23:19.369405+00:00 [info] Start accepting TCP connections at [::]:5280 for ejabberd_http
2022-08-01 19:23:19.369441+00:00 [info] Start accepting TCP connections at [::]:1883 for mod_mqtt
2022-08-01 19:23:19.369467+00:00 [info] Start accepting TCP connections at 10.1.84.163:7777 for mod_proxy65_stream
2022-08-01 19:23:19.369470+00:00 [info] Start accepting UDP connections at [::]:3478 for ejabberd_stun
But how does it work with the Ingress and the certificates?
Someone here who might have a working example or can give me tips?