-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add tool to update CRDs in a Kubernetes job without kubectl #50
Conversation
71022ec
to
43a65e3
Compare
Pull Request Test Coverage Report for Build 11774740600Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Signed-off-by: Tobias Giese <[email protected]>
43a65e3
to
31e447f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM !
Thanks for the reviews. I am not able to merge this PR as I don‘t have write access. I think only you @cdesiniotis and @adrianchiris are able to do this |
Thanks for raising this PR @tobiasgiese . This is indeed very useful and a great alternative to using the Do we also plan on adding the |
Signed-off-by: Tobias Giese <[email protected]>
We can show an example, but this Dockerfile cannot be re-used.
The problelm is that we need the CRD manifests inside the docker containers. We CAN mount them as configmaps, but this is probably not a good idea IMHO. The current idea is to re-use it inside the repo via a custom package and build the container as mentioned above, e.g.: package main
import (
applycrds "github.com/nvidia/k8s-operator-libs/cmd/apply-crds"
)
func main() {
applycrds.Run()
} We can/should improve the readme for sure, it was just a first shot :) |
Thanks for all the details @tobiasgiese! I've approved this PR for now.
What if we provided the raw link to the CRD files we push on github as a parameter to this app? As long as we provide a raw github link from a tag, it should be stable enough as an input and CRD source. If you think this is a good idea, we could implement this in a follow-up |
That is a good idea @tariq1890, but on the other hand it has some downsides if you think about Helm Chart dependencies.
Thus, I think it might be possible to add the feature, but the core-feature should be stay with local files IMHO :) Appendix: In a downstream repo we will copy the CRDs in our Dockerfile via RUN apk add yq
WORKDIR /workspace
COPY ./deploy/helm/operator deploy
RUN mkdir -p \
/workspace/crds/operator \
/workspace/crds/node-feature-discovery
# Helm show crds does not support adding only the local CRDs but will add all CRD of all dependencies, so we need to manually concatenate them.
RUN yq deploy/crds/* > /workspace/crds/operator/operator.yaml
# Add the CRDs from the helm charts separately to be able to opt-out.
RUN helm show crds deploy/charts/node-feature-discovery*.tgz > /workspace/crds/node-feature-discovery/node-feature-discovery.yaml and as containers:
- name: upgrade-crd
image: example.com/operator
imagePullPolicy: IfNotPresent
command:
- /apply-crds
args:
- --crds-dir=/crds/operator
{{ if index .Values "node-feature-discovery" "enabled" }}
- --crds-dir=/crds/node-feature-discovery
{{- end }} |
This PR adds a tool to update CRDs based on the initial PR Mellanox/network-operator#1118.
To easily re-use this tool (as it should be build inside a container) this repository might be the best choice.