fix status checks for multiple modules#9370
Closed
jashandeep-sohi wants to merge 1 commit intoGoogleContainerTools:mainfrom
Closed
fix status checks for multiple modules#9370jashandeep-sohi wants to merge 1 commit intoGoogleContainerTools:mainfrom
jashandeep-sohi wants to merge 1 commit intoGoogleContainerTools:mainfrom
Conversation
dbc2111 to
c00f7bf
Compare
Issue:
If you have workloads in different namespaces managed in different modules,
Skaffold will only run status checks on the first module it encounters. This
can be a problem when you have dependencies between the modules, where workloads
in one must be healthy before moving onto the next (e.g. CRD operators).
For example,
```yaml
apiVersion: skaffold/v4beta8
kind: Config
metadata:
name: a
manifests:
kustomize:
paths:
- ./deploy-a.yaml
deploy:
kubectl:
flags:
apply:
- --server-side
---
apiVersion: skaffold/v4beta8
kind: Config
metadata:
name: b
manifests:
kustomize:
paths:
- ./deploy-b.yaml
deploy:
kubectl:
flags:
apply:
- --server-side
```
Where `deploy-a.yaml` looks something like:
```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: a
namespace: a
spec:
template:
spec:
containers:
- name: default
image: ...
command: ["sleep", "inf"]
livenessProbe:
exec:
command: ["true"]
initialDelaySeconds: 15
periodSeconds: 5
```
And `deploy-b.yaml` looks something like:
```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: b
namespace: b
spec:
template:
spec:
containers:
- name: default
image: ...
command: ["sleep", "inf"]
livenessProbe:
exec:
command: ["true"]
initialDelaySeconds: 15
periodSeconds: 5
```
Notes:
- There's a Deployer created per config/module
- A Deployer holds a reference to a list of namespaces to monitor that it
updates as it deploys resources
- A reference to this list is also passed to the Status Monitor that it uses
to figure our what resources to monitor
- But the Status Monitor is deduped per kubecontext, which leads to a mismatch
between the reference to the namespace list for subsequent modules (assuming
they use the same kubecontext)
- There should be a Status Monitor per Deployer
- Dedup on the config name (those are unique right?)
Also added a Flake to this project, making it easy to install/run Skaffold with Nix:
```sh
nix run github:<org>/skaffold/<rev-or-ref>
```
c00f7bf to
e57813c
Compare
Contributor
|
I think this only makes sense if you convert all code paths where Skaffold currently checks for multiple namespaces to actually immediately fail upon more than one namespace. Plus add quite a few test cases to ensure this keeps working. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue:
If you have workloads in different namespaces managed in different modules, Skaffold will only run status checks on the first module it encounters. This can be a problem when you have dependencies between the modules, where workloads in one must be healthy before moving onto the next (e.g. CRD operators).
For example,
Where
deploy-a.yamllooks something like:And
deploy-b.yamllooks something like:Notes:
Also added a Flake to this project, making it easy to install/run Skaffold with Nix: