Cloud Intermediate
Kubernetes Deployment strategie¶
KubernetesDeploymentRolling Update 3 min read
RollingUpdate, Recreate, Blue-Green a Canary v Kubernetes.
RollingUpdate¶
apiVersion: apps/v1
kind: Deployment
metadata:
name: myapp
spec:
replicas: 4
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1 # Max pods navíc
maxUnavailable: 0 # Zero downtime
template:
spec:
containers:
- name: app
image: myapp:v2
Recreate¶
Smaže všechny pody a vytvoří nové. Má downtime, ale jednoduché pro stateful apps.
Canary s Argo Rollouts¶
apiVersion: argoproj.io/v1alpha1
kind: Rollout
spec:
strategy:
canary:
steps:
- setWeight: 5
- pause: {duration: 5m}
- setWeight: 25
- pause: {duration: 10m}
- setWeight: 75
- pause: {duration: 5m}
Summary¶
RollingUpdate je default a stačí většinou. Pro sofistikovanější strategie použijte Argo Rollouts.
Need Help with Implementation?¶
Our team has experience designing and implementing modern architectures. We’re happy to help.