Skip to content
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

fix: install.yaml missing crb subject ns #8280

Merged
merged 2 commits into from
Mar 31, 2022

Conversation

gdsoumya
Copy link
Member

This PR fixes the issue with missing ns in crb subjects inside the install.yaml file, introduced in PR #8266

ref: #8250 (comment)

Signed-off-by: Soumya Ghosh Dastidar <[email protected]>
@gdsoumya gdsoumya requested review from terrytangyuan, alexec and jessesuen and removed request for terrytangyuan and alexec March 31, 2022 04:41
@jessesuen jessesuen merged commit 954a3ee into argoproj:master Mar 31, 2022
@tiwarisanjay
Copy link
Contributor

tiwarisanjay commented Mar 31, 2022

@gdsoumya Why exactly we are hardcoding the namespace for cluster install ? whoever refers the cluster install can mention the namespace in their own kustomization.yaml
@alexec @jessesuen
I would like to change the namespace where I am installing argo workflow and this is how I am doing it :
kustomization.yaml

@gdsoumya
Copy link
Member Author

gdsoumya commented Mar 31, 2022

@tiwarisanjay the install.yaml file is supposed to be used directly for installing argo workflows, as pointed out in the examples this file should be okay to just use with kubectl apply -f but with your changes the generated manifest is missing the ns in crb subject which would fail installation. The intall.yaml file in short should be a valid k8s manifest.

You can still get your kustomization to work by replicating this Kustomization file and updating it with your ns. My Pr just makes sure the generated install.yaml is a valid k8s manifest that can be directly installed.

@tiwarisanjay
Copy link
Contributor

@gdsoumya Yes, Apologies for install.yaml bug I introduced, as it was showing diff when I was fixing kustomize. But isn't kustomize supposed to be for generic use instead of hard-coding a namespace.
Also with kustomize you can not override namespace if its hardcoded. There is a open ticket for the same. :

kubernetes-sigs/kustomize#880

@gdsoumya
Copy link
Member Author

@tiwarisanjay no worries, agreed I did not revert all your changes. The only thing I changed was that I added the ns in the cluster install kustomization - the individual base files are still without ns. We need to do this because the kustomization is used to generate the install.yaml which needs the ns there.

@tiwarisanjay
Copy link
Contributor

@gdsoumya can you please direct me to code where we are running kustomize command to generate install.yaml file? I will try to fix the same by passing namespace. It will help us to make our cluster-install generic for any one to use.

@terrytangyuan
Copy link
Member

You can use make manifests: https://github.com/argoproj/argo-workflows/blob/master/Makefile#L353

@sarabala1979 sarabala1979 mentioned this pull request Apr 14, 2022
85 tasks
@alexec alexec mentioned this pull request May 3, 2022
alexec pushed a commit that referenced this pull request May 3, 2022
brews added a commit to ClimateImpactLab/downscaleCMIP6 that referenced this pull request Jun 3, 2022
Versions of Argo workflows after v3.3.4 appear to have a namespace added to their install.yaml resources (see argoproj/argo-workflows#8280 and argoproj/argo-workflows#8250 (comment)), with causes an error when kustomization tries to apply updates:

```
ComparisonError  rpc error: code = Unknown desc = Manifest generation error (cached): `kustomize build /tmp/https___github.com_climateimpactlab_downscalecmip6/infrastructure/kubernetes-gcp/argo` failed exit status 1: Error: no matches for Id ~G_v1_ConfigMap|~X|workflow-controller-configmap; failed to find unique target for patch ~G_v1_ConfigMap|workflow-controller-configmap  2022-06-02 18:16:15 -0700 PDT
```
This *might* relate to a bug in customization (see kubernetes-sigs/kustomize#1332).

So we're specifying the namespace in the install.yaml resource when defining the patch for the customization with the hopes that it will be able to find its target.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants