-
Notifications
You must be signed in to change notification settings - Fork 780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature request] Support SidecarSet update strategy when pod recreate or inject #783
Comments
Here is an example: first, # sidecarset.yaml
apiVersion: apps.kruise.io/v1alpha1
kind: SidecarSet
metadata:
name: test-sidecarset
spec:
selector:
matchLabels:
sidecarset: test-sidecarset
updateStrategy:
type: RollingUpdate
# type: NotUpdate
maxUnavailable: 1
partition: 2
containers:
- name: sidecar1
image: centos:6.7
command: ["sleep", "999d"] # do nothing at all
volumeMounts:
- name: log-volume
mountPath: /var/log
volumes: # this field will be merged into pod.spec.volumes
- name: log-volume
emptyDir: {} apiVersion: apps/v1
kind: Deployment
metadata:
name: test-nginx
spec:
replicas: 5
selector:
matchLabels:
app: test-nginx
template:
metadata:
labels:
app: test-nginx
sidecarset: test-sidecarset
spec:
containers:
- name: test-nginx
image: nginx:1.15.1
resources:
limits:
memory: "256Mi"
cpu: "500m"
ports:
- containerPort: 10000 now, result is
then, Team A update SidecarSet. # sidecarset.yaml
apiVersion: apps.kruise.io/v1alpha1
kind: SidecarSet
metadata:
name: test-sidecarset
spec:
selector:
matchLabels:
sidecarset: test-sidecarset
updateStrategy:
type: RollingUpdate
# type: NotUpdate
maxUnavailable: 1
partition: 2
containers:
- name: sidecar1
image: centos:7
command: ["sleep", "999d"] # do nothing at all
volumeMounts:
- name: log-volume
mountPath: /var/log
volumes: # this field will be merged into pod.spec.volumes
- name: log-volume
emptyDir: {} result
at the same time, Team B update Deployment. apiVersion: apps/v1
kind: Deployment
metadata:
name: test-nginx
spec:
replicas: 5
selector:
matchLabels:
app: test-nginx
template:
metadata:
labels:
app: test-nginx
sidecarset: test-sidecarset
spec:
containers:
- name: test-nginx
image: nginx:1.15.1
resources:
limits:
memory: "128Mi"
cpu: "500m"
ports:
- containerPort: 10000 result
expect two centos: 6.7 and three centos: 7 |
Very Good Issue! In fact, we have noticed this problem and are solving it. The current progress about the solution is as follows:
|
Oh, I notice this #715.
|
Another issue is the update strategy equal NotUpdate. I want to apply a new version SidecarSet only if Team B update their application (risk considerations). Of course, new version SidecarSet have some update strategy. |
|
What would you like to be added:
Support SidecarSet update strategy when pod recreate or inject
Why is this needed:
There are two teams under one organizational structure. Team A maintain SidecarSet. Team B maintain Application which can use Deployment.
Team A inject SidecarSet to Pod which may controlled by Team B. Now, Team A want to update SidecarSet to new version. They use a partition update strategy.
At the same time, Team B want to release a new application version which may fix an emergency bug. Unfortunately, SidecarSet is all new version now.
So, I want to apply update strategy when pod inject.
The text was updated successfully, but these errors were encountered: