-
Notifications
You must be signed in to change notification settings - Fork 344
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 CLI command to generate k8s manifests #1046
Conversation
POC for discussion, primarily because I wanted when looking at the code :) |
Codecov Report
@@ Coverage Diff @@
## master #1046 +/- ##
==========================================
+ Coverage 64.58% 64.78% +0.19%
==========================================
Files 84 84
Lines 6715 6758 +43
==========================================
+ Hits 4337 4378 +41
- Misses 2236 2237 +1
- Partials 142 143 +1
Continue to review full report at Codecov.
|
Could you please document this feature in readme how to use it as a docker command? |
pkg/cmd/generate/main.go
Outdated
|
||
// TODO: Did I get all the relevant options? Too many? | ||
|
||
cmd.Flags().String("jaeger-agent-image", "jaegertracing/jaeger-agent", "The Docker image for the Jaeger Agent") |
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.
This is no-go to have double copy of all the flags. It should be unified with start/main.go
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.
Now shared, if you have an idea for a better name/package, please say where :)
Could you add a e2e test that would generate all-in-one deployment from a generated file? |
88fb60a
to
b697b77
Compare
Signed-off-by: Carl Henrik Lunde <[email protected]>
Defaults to stdin/stdout Examples: jaeger-operator generate --jaeger-all-in-one-image localimage --cr ./deploy/examples/all-in-one-with-options.yaml | kubectl apply -f - cat jaeger.yaml | podman run jaeger-operator generate > manifest.yaml Fixes jaegertracing#375 Signed-off-by: Carl Henrik Lunde <[email protected]>
Signed-off-by: Carl Henrik Lunde <[email protected]>
Signed-off-by: Carl Henrik Lunde <[email protected]>
Signed-off-by: Carl Henrik Lunde <[email protected]>
Signed-off-by: Carl Henrik Lunde <[email protected]>
Signed-off-by: Carl Henrik Lunde <[email protected]>
Signed-off-by: Carl Henrik Lunde <[email protected]>
Signed-off-by: Carl Henrik Lunde <[email protected]>
Signed-off-by: Carl Henrik Lunde <[email protected]>
Signed-off-by: Carl Henrik Lunde <[email protected]>
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, great work!
@kevinearls could you please have a look at e2e tests?
README.md
Outdated
|
||
## Command line invocation | ||
|
||
To dry-run, experiment or run adapt the generated output with kustomize, command line invocation using the `generate`subcommand is possible. In this example we apply the manifest generated by examples/simple-prod.yaml to the namespace `jaeger-test`: |
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.
It might not be just dry-run some people still prefer to use plain manifest files. This paragraph should tell that jaeger-operator generate
generates kubernetes manifest file from a given CR.
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.
Updated, but I'm not sure if you wanted the introduction sentence at all. Maybe you want to spell our the whole paragraph instead? :)
If anything, maybe we should have an example with kustomize or hint that people should use kustomize instead of manually patching the generated file. This would allow them to run generate with a newer version of the operator to get upgrades later, and hopefully not update/redo the local changes.
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.
I've requested 2 minor test changes. I am also running this PR on our internal CI that uses OpenShift and will update this review once that finishes.
Signed-off-by: Carl Henrik Lunde <[email protected]>
Signed-off-by: Carl Henrik Lunde <[email protected]>
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
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, just a couple of nits
Signed-off-by: Carl Henrik Lunde <[email protected]>
Signed-off-by: Carl Henrik Lunde <[email protected]>
thanks @chlunde 🚀 ! |
Defaults to stdin/stdout
Examples:
Fixes #375