Refactor: add/remove services, general refactoring

This commit is contained in:
Michele Bologna
2024-11-23 13:43:15 +01:00
parent 8eecc2bb3f
commit afac4af31f
19 changed files with 510 additions and 498 deletions

52
k8s/bitlbee-deployment.yaml Executable file
View File

@@ -0,0 +1,52 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: bitlbee
namespace: bitlbee
spec:
replicas: 1
selector:
matchLabels:
app: bitlbee
template:
metadata:
labels:
app: bitlbee
spec:
containers:
- name: bitlbee
image: docker.io/mbologna/docker-bitlbee:latest
ports:
- containerPort: 6667
volumeMounts:
- mountPath: /var/lib/bitlbee
name: bitlbee-data
resources:
limits:
memory: "512Mi"
cpu: "1"
requests:
memory: "256Mi"
cpu: "1"
livenessProbe:
exec:
command:
- nc
- -z
- localhost
- "6667"
initialDelaySeconds: 30
periodSeconds: 30
readinessProbe:
exec:
command:
- nc
- -z
- localhost
- "6667"
initialDelaySeconds: 10
periodSeconds: 30
volumes:
- name: bitlbee-data
persistentVolumeClaim:
claimName: bitlbee-pvc

View File

@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: bitlbee

11
k8s/bitlbee-pvc.yaml Normal file
View File

@@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: bitlbee-pvc
namespace: bitlbee
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 128Mi

12
k8s/bitlbee-service.yaml Normal file
View File

@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: bitlbee
namespace: bitlbee
spec:
ports:
- protocol: TCP
port: 6667
targetPort: 6667
selector:
app: bitlbee

View File

@@ -0,0 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: stunnel-config
namespace: bitlbee
data:
STUNNEL_SERVICE: bitlbee-stunnel
STUNNEL_ACCEPT: "6697"
STUNNEL_CONNECT: bitlbee:6667

View File

@@ -0,0 +1,48 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: bitlbee-stunnel
namespace: bitlbee
spec:
replicas: 1
selector:
matchLabels:
app: bitlbee-stunnel
template:
metadata:
labels:
app: bitlbee-stunnel
spec:
containers:
- name: stunnel
image: docker.io/dweomer/stunnel:latest
ports:
- containerPort: 6697
envFrom:
- configMapRef:
name: stunnel-config
resources:
limits:
memory: "256Mi"
cpu: "1"
requests:
memory: "128Mi"
cpu: "1"
livenessProbe:
exec:
command:
- nc
- -z
- localhost
- "6697"
initialDelaySeconds: 30
periodSeconds: 30
readinessProbe:
exec:
command:
- nc
- -z
- localhost
- "6697"
initialDelaySeconds: 10
periodSeconds: 30

View File

@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: bitlbee-stunnel
namespace: bitlbee
spec:
ports:
- protocol: TCP
port: 6697
targetPort: 6697
selector:
app: bitlbee-stunnel