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

Operator to generate k8s deployment manifests #375

Closed
pavolloffay opened this issue Apr 16, 2019 · 4 comments · Fixed by #1046
Closed

Operator to generate k8s deployment manifests #375

pavolloffay opened this issue Apr 16, 2019 · 4 comments · Fixed by #1046
Labels
enhancement New feature or request hacktoberfest help wanted Extra attention is needed

Comments

@pavolloffay
Copy link
Member

The operator could be used as a command line tool to generate k8s resource files based on supplied CR. So instead of posting objects to k8s API it would flush them to a file or standard output.

The main motivation behind this is to deprecate https://github.com/jaegertracing/jaeger-kubernetes. During the release process we could generate and publish the template for target deployments - all-in-one.

Example execution:

./jaeger-operator generate --cr cr.yml --output resources.yml
@jpkrohling jpkrohling added enhancement New feature or request help wanted Extra attention is needed labels May 28, 2019
@jpkrohling
Copy link
Contributor

This needs to come with very good test coverage in the form of end-to-end tests, so that we don't end up on a situation where we spend more time manually testing the output than the time that was spent writing the code.

@jpkrohling jpkrohling added needs-triage New issues, in need of classification and removed needs-triage New issues, in need of classification labels Dec 16, 2019
@jpkrohling
Copy link
Contributor

I think this could be a second binary, possibly published as a separate container image. Should be a fun feature to work on :-)

@chlunde
Copy link
Contributor

chlunde commented Apr 29, 2020

Wouldn't the end-to-end tests for jeager-operator itself be enough?

And would it not share enough code that it could just be the same image? I can whip up a quick POC.

@pavolloffay
Copy link
Member Author

Wouldn't the end-to-end tests for jeager-operator itself be enough?

I am also keen on testing this - at least for all-in-one deployment type.

And would it not share enough code that it could just be the same image? I can whip up a quick POC.

It would share most of the code. It depends on how intrusive it would be to the current main. A separate build might be better if this is considered a lower priority feature.

chlunde added a commit to chlunde/jaeger-operator that referenced this issue Apr 29, 2020
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]>
chlunde added a commit to chlunde/jaeger-operator that referenced this issue May 6, 2020
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]>
chlunde added a commit to chlunde/jaeger-operator that referenced this issue May 6, 2020
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]>
chlunde added a commit to chlunde/jaeger-operator that referenced this issue May 6, 2020
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]>
chlunde added a commit to chlunde/jaeger-operator that referenced this issue May 7, 2020
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]>
pavolloffay pushed a commit that referenced this issue May 12, 2020
* Add CLI command jaeger-operator generate to generate manifests

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 #375

Signed-off-by: Carl Henrik Lunde <[email protected]>

* Add missing TypeMeta for corev1.ServiceAccount

Signed-off-by: Carl Henrik Lunde <[email protected]>

* Add e2e tests for `jaeger-operator generate`

Signed-off-by: Carl Henrik Lunde <[email protected]>

* Avoid command line flag duplication

Signed-off-by: Carl Henrik Lunde <[email protected]>

* Fixup - allow EOF on stdin

Signed-off-by: Carl Henrik Lunde <[email protected]>

* README: Explain generate subcommand

Signed-off-by: Carl Henrik Lunde <[email protected]>

* Generate command description: update

Signed-off-by: Carl Henrik Lunde <[email protected]>

* Strategy: Test that All includes all types

Signed-off-by: Carl Henrik Lunde <[email protected]>

* Remove solved TODOs

Signed-off-by: Carl Henrik Lunde <[email protected]>

* Use AllInOneSmokeTest for e2e CLI generate

Signed-off-by: Carl Henrik Lunde <[email protected]>

* Fix tag name in README

Signed-off-by: Carl Henrik Lunde <[email protected]>

* Update docs

Signed-off-by: Carl Henrik Lunde <[email protected]>

* Use require.No* for better error message in e2e test

Signed-off-by: Carl Henrik Lunde <[email protected]>

* Update docs, mark as experimental

Signed-off-by: Carl Henrik Lunde <[email protected]>

* Minor refactor/cleanup

Signed-off-by: Carl Henrik Lunde <[email protected]>

Co-authored-by: Carl Henrik Lunde <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants