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

Quarkus kubernetes/openshift/minikube extension should allow for common resources #22290

Closed
edeandrea opened this issue Dec 16, 2021 · 13 comments · Fixed by #28684
Closed

Quarkus kubernetes/openshift/minikube extension should allow for common resources #22290

edeandrea opened this issue Dec 16, 2021 · 13 comments · Fixed by #28684
Assignees
Milestone

Comments

@edeandrea
Copy link
Contributor

edeandrea commented Dec 16, 2021

Following the use existing resources section of the Quarkus Kubernetes Guide it mentions I can place files in src/main/kubernetes that will be picked up by the extensions.

It says

Those resources can be added under src/main/kubernetes directory and can be named after the target environment (e.g. kubernetes.json, openshift.json, knative.json, or the yml equivalents). Each of these files may contain one or more Kubernetes resources.

What if I have some resources that I want added to the generated kubernetes.yml and openshift.yml? It seems that only specific filenames of kubernetes.yml or openshift.yml are picked up in src/main/kubernetes. What if I have a resource, like a ConfigMap, that I want to appear in all the generated descriptors? Do I need to create both a src/main/kubernetes/kubernetes.yml and a src/main/kubernetes/openshift.yml with the same content?

@edeandrea indeed you do. @iocanel maybe it makes sense to improve on that somehow

Originally posted by @geoand in #22258 (comment)

@quarkus-bot
Copy link

quarkus-bot bot commented Dec 16, 2021

/cc @geoand, @iocanel

@geoand geoand assigned geoand and iocanel and unassigned geoand Dec 17, 2021
@iocanel
Copy link
Contributor

iocanel commented Apr 19, 2022

I have fixed that upstream: dekorateio/dekorate#942.
Will pick the fix up on next dekorate release.

@edeandrea
Copy link
Contributor Author

Thank you @iocanel ! When this gets pulled into Quarkus will the documentation be updated as well, showing how to use the feature?

@geoand
Copy link
Contributor

geoand commented May 17, 2022

@Sgitario mind updating the docs to reflect that we know support this feature?

Thanks

@Sgitario
Copy link
Contributor

@iocanel was going to update it, but first Dekorate needs to release this change and Quarkus needs to be updated accordingly.

@geoand
Copy link
Contributor

geoand commented May 17, 2022

Oh, I thought that was already done

@edeandrea
Copy link
Contributor Author

Hi @Sgitario / @iocanel Do you know if this has been released in dekorate yet?

@Sgitario
Copy link
Contributor

Dekorate's bump version will be done in #26303, which will include this feature.

@edeandrea
Copy link
Contributor Author

Hey @geoand / @Sgitario has this been done? If it was, I don't see anything in the documentation (https://quarkus.io/guides/deploying-to-kubernetes#using-existing-resources) describing how to use this?

@geoand
Copy link
Contributor

geoand commented Oct 18, 2022

I doubt it, it probably slipped through the cracks, but @Sgitario would know more.

@edeandrea
Copy link
Contributor Author

Sounds good. The ticket he referenced (#26303) seems to be closed, so if it is "in" I don't know how to use it.

@Sgitario
Copy link
Contributor

Yes, this should be already supported as the changes in dekorateio/dekorate#942 are included in the Dekorate version, but indeed we need to update the documentation and perhaps also some tests.
I need to figure out how it works, and then I will provide a PR with this.

Sgitario added a commit to Sgitario/quarkus that referenced this issue Oct 19, 2022
When generating the manifests for multiple deployment targets like Kubernetes, OpenShift or Knative, we can place the common resources in `src/main/kubernetes/common.yml`, so these resources will be integrated into the generated `kubernetes.json`/`kubernetes.yml`, and `openshift.json`/`openshift.yml` files (if you configure the Kubernetes and Openshift extensions at the same time).

For example, we can write a ConfigMap resource only once in the file `src/main/kubernetes/common.yml`:

```yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: common-configmap
data:
  hello: world
```

And this config map resource will be integrated into the generated `kubernetes.json`/`kubernetes.yml`, and `openshift.json`/`openshift.yml` files.

Fix quarkusio#22290
@Sgitario
Copy link
Contributor

It seems that the changes in dekorateio/dekorate#942 were not relevant for Quarkus. Therefore, I've created a pull request to implement this feature, and also to document it.

Sgitario added a commit to Sgitario/quarkus that referenced this issue Oct 19, 2022
When generating the manifests for multiple deployment targets like Kubernetes, OpenShift or Knative, we can place the common resources in `src/main/kubernetes/common.yml`, so these resources will be integrated into the generated `kubernetes.json`/`kubernetes.yml`, and `openshift.json`/`openshift.yml` files (if you configure the Kubernetes and Openshift extensions at the same time).

For example, we can write a ConfigMap resource only once in the file `src/main/kubernetes/common.yml`:

```yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: common-configmap
data:
  hello: world
```

And this config map resource will be integrated into the generated `kubernetes.json`/`kubernetes.yml`, and `openshift.json`/`openshift.yml` files.

Fix quarkusio#22290
@quarkus-bot quarkus-bot bot added this to the 2.14 - main milestone Oct 24, 2022
tmihalac pushed a commit to tmihalac/quarkus that referenced this issue Oct 27, 2022
When generating the manifests for multiple deployment targets like Kubernetes, OpenShift or Knative, we can place the common resources in `src/main/kubernetes/common.yml`, so these resources will be integrated into the generated `kubernetes.json`/`kubernetes.yml`, and `openshift.json`/`openshift.yml` files (if you configure the Kubernetes and Openshift extensions at the same time).

For example, we can write a ConfigMap resource only once in the file `src/main/kubernetes/common.yml`:

```yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: common-configmap
data:
  hello: world
```

And this config map resource will be integrated into the generated `kubernetes.json`/`kubernetes.yml`, and `openshift.json`/`openshift.yml` files.

Fix quarkusio#22290
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants