-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use 'parallel' policy for workspace pod rollouts to avoid stalls (#802)
<!--Thanks for your contribution. See [CONTRIBUTING](CONTRIBUTING.md) for Pulumi's contribution guidelines. Help us merge your changes more quickly by adding more details such as labels, milestones, and reviewers.--> ### Proposed changes <!--Give us a brief description of what you've done and what it solves. --> This PR seeks to address this issue ([k8s: "Forced rollback"](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#forced-rollback)) that occurs when the workspace pod is in a crashloop: > When using [Rolling Updates](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#rolling-updates) with the default [Pod Management Policy](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#pod-management-policies) (OrderedReady), it's possible to get into a broken state that requires manual intervention to repair. The `parallel` policy seems to enable the statefulset controller to forcibly remove a pod when a new revision is available. The controller seems to obey the termination grace period as is important, and I can't think of any other negatives. But there's a concern in the k8s community about this approach: kubernetes/website#47085 Note that a workspace consists of one replica, and is rather like a singleton with good behavior w.r.t. Pulumi state locking and compatible with persistent volumes. ### Related issues (optional) <!--Refer to related PRs or issues: #1234, or 'Fixes #1234' or 'Closes #1234'. Or link to full URLs to issues or pull requests in other GitHub repositories. --> Closes #801
- Loading branch information
1 parent
fc48798
commit 1795411
Showing
11 changed files
with
174 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# note: image is purposefully set to a non-existent image to simulate a rollout problem | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: issue-801 | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: issue-801 | ||
namespace: issue-801 | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: issue-801:system:auth-delegator | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: system:auth-delegator | ||
subjects: | ||
- kind: ServiceAccount | ||
name: issue-801 | ||
namespace: issue-801 | ||
--- | ||
apiVersion: auto.pulumi.com/v1alpha1 | ||
kind: Workspace | ||
metadata: | ||
name: issue-801 | ||
namespace: issue-801 | ||
spec: | ||
image: pulumi/nosuchimage:3.147.0-nonroot | ||
securityProfile: restricted | ||
serviceAccountName: issue-801 | ||
git: | ||
url: https://github.com/pulumi/examples.git | ||
ref: 1e2fc471709448f3c9f7a250f28f1eafcde7017b | ||
dir: random-yaml | ||
shallow: true | ||
env: | ||
- name: PULUMI_CONFIG_PASSPHRASE | ||
value: test | ||
- name: PULUMI_BACKEND_URL | ||
value: file:///state/ | ||
|
||
podTemplate: | ||
spec: | ||
containers: | ||
- name: pulumi | ||
volumeMounts: | ||
- name: state | ||
mountPath: /state | ||
volumes: | ||
- name: state | ||
emptyDir: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# modified: image tag | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: issue-801 | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: issue-801 | ||
namespace: issue-801 | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: issue-801:system:auth-delegator | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: system:auth-delegator | ||
subjects: | ||
- kind: ServiceAccount | ||
name: issue-801 | ||
namespace: issue-801 | ||
--- | ||
apiVersion: auto.pulumi.com/v1alpha1 | ||
kind: Workspace | ||
metadata: | ||
name: issue-801 | ||
namespace: issue-801 | ||
spec: | ||
image: pulumi/pulumi:3.147.0-nonroot | ||
securityProfile: restricted | ||
serviceAccountName: issue-801 | ||
git: | ||
url: https://github.com/pulumi/examples.git | ||
ref: 1e2fc471709448f3c9f7a250f28f1eafcde7017b | ||
dir: random-yaml | ||
shallow: true | ||
env: | ||
- name: PULUMI_CONFIG_PASSPHRASE | ||
value: test | ||
- name: PULUMI_BACKEND_URL | ||
value: file:///state/ | ||
|
||
podTemplate: | ||
spec: | ||
containers: | ||
- name: pulumi | ||
volumeMounts: | ||
- name: state | ||
mountPath: /state | ||
volumes: | ||
- name: state | ||
emptyDir: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters