Factorio
Création du Namespace et du label :
kubectl create namespace factorio
kubectl label namespace factorio istio-injection=enabled
Création du PVC :
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: factorio-srv-01-pvc
namespace: factorio
spec:
accessModes:
- ReadWriteOnce
storageClassName: longhorn
resources:
requests:
storage: 10Gi
EOF
Déployment + Service :
cat <<EOF | kubectl apply -f -
apiVersion: apps/v1
kind: Deployment
metadata:
name: factorio-01
namespace: factorio
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: factorio-01
template:
metadata:
labels:
app: factorio-01
spec:
containers:
- name: factorio-01
image: factoriotools/factorio:latest-rootless
ports:
- containerPort: 34197
protocol: UDP
resources:
requests:
memory: "1Gi"
cpu: "1000m"
volumeMounts:
- name: storage-volume
mountPath: /factorio
volumes:
- name: storage-volume
persistentVolumeClaim:
claimName: factorio-srv-01-pvc
---
apiVersion: v1
kind: Service
metadata:
name: factorio-01
namespace: factorio
labels:
expose: "true"
annotations:
lbipam.cilium.io/ips: "10.0.20.2"
spec:
type: LoadBalancer
selector:
app: factorio-01
ports:
- port: 34197
targetPort: 34197
protocol: UDP
EOF