11 Ekim 2022 Salı

Kubernetes kind : Deployment Strategy

Giriş
Açıklaması şöyle
Options for strategy type include:

Recreate: The Recreate strategy ensures that old and new pods do not run concurrently. This can be useful when synchronizing changes to a backend datastore that does not support access from two different client versions.

Rolling update: The RollingUpdate strategy ensures there are some pods available to continue serving traffic during the update, so there is no downtime. However, both the old and new pods run side by side while the update is taking place, meaning any data stores or clients must be able to interact with both versions.
1. Recreate
Açıklaması şöyle. Geriye uyumluluğun kırıldığı durumda kullanılır. Hizmette kesinti olur
1. Suppose there are 5 instances of your app running
2. When deploying a new version, we can destroy the 5 instances of older version and then deploy 5 instances of newer version.
3. The issue is there will be a downtime.
4. This is majorly done during major changes, breaking changes or when backward compatibility is not possible.
5. This is not the default strategy in K8s.
Örnek
Şöyle yaparız. Recreate ile yeni deployment yapılınca eski podlar kapatılır ve yeni podlar açılır
apiVersion : apps/v1
kind : Deployment
metadata:
  name: echo-blue
spec:
  selector:
    matchLabels:
      app: echo
  strategy:
    type: Recreate
  replicas: 2
2. RollingUpdate
RollingUpdate yazısına taşıdım

Hiç yorum yok:

Yorum Gönder

Cluster Propotional Autoscaler - ReplicaSet Ekler/Siler

Giriş Açıklaması şöyle CPA aims to horizontally scale the number of Pod replicas based on the cluster’s scale. A common example is DNS ser...