docs: add deployment playbooks and templates
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
# Compose App Plus Worker Migration
|
||||
|
||||
Use this when one compose file contains an HTTP app and a separate worker or bot process.
|
||||
@@ -0,0 +1,9 @@
|
||||
services:
|
||||
app:
|
||||
build: .
|
||||
env_file: .env
|
||||
ports:
|
||||
- "3000:3000"
|
||||
worker:
|
||||
build: .
|
||||
env_file: .env
|
||||
@@ -0,0 +1,6 @@
|
||||
# After
|
||||
|
||||
1. `Deployment` for app
|
||||
2. `Service` and `Ingress` for app
|
||||
3. Separate `Deployment` for worker
|
||||
4. Shared `Secret` if both need the same env
|
||||
@@ -0,0 +1,14 @@
|
||||
# Compose Single Service Migration
|
||||
|
||||
Before:
|
||||
|
||||
1. One compose service
|
||||
2. Optional `env_file`
|
||||
3. Exposed port
|
||||
|
||||
After:
|
||||
|
||||
1. One Kubernetes deployment
|
||||
2. One service
|
||||
3. One ingress
|
||||
4. One secret
|
||||
@@ -0,0 +1,20 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: #APP_NAME
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: #APP_NAME
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: #APP_NAME
|
||||
spec:
|
||||
containers:
|
||||
- name: #APP_NAME
|
||||
image: #IMAGE
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: #SECRET_NAME
|
||||
@@ -0,0 +1,6 @@
|
||||
services:
|
||||
#APP_NAME:
|
||||
build: .
|
||||
env_file: .env
|
||||
ports:
|
||||
- "3000:3000"
|
||||
@@ -0,0 +1,3 @@
|
||||
# Swarm Single Service Migration
|
||||
|
||||
Use this when the source repo still uses `docker stack deploy`.
|
||||
@@ -0,0 +1,4 @@
|
||||
git pull --rebase --autostash
|
||||
IMAGE=#APP_NAME:$(git rev-parse --short HEAD)
|
||||
docker build -t $IMAGE .
|
||||
IMAGE=$IMAGE docker stack deploy -c compose.yml #APP_NAME
|
||||
@@ -0,0 +1,6 @@
|
||||
# After
|
||||
|
||||
1. Image build should target the cluster architecture
|
||||
2. Compose file is replaced by `k8s/` manifests
|
||||
3. Secret values move to Kubernetes
|
||||
4. Rollout is either on-demand or CI-driven GitOps deploy
|
||||
Reference in New Issue
Block a user