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

OLM generate bundle silently drops k8s resources existing in manifests #3196

Closed
totahuanocotl opened this issue Apr 2, 2024 · 5 comments
Closed

Comments

@totahuanocotl
Copy link

totahuanocotl commented Apr 2, 2024

Support

Help around the operator-sdk generate bundle

Question

How can I include k8s resources that are not part of the k8s core apis, or config-maps generated by kustomize?

What did you do?
Alongside my operator, I want to rollout k8s resources that are not part of the core apis as well as a kustomize generated config map.
Specifically, I want to deploy the following:

---
apiVersion: secrets.hashicorp.com/v1beta1
kind: VaultStaticSecret
metadata:
  name: my-secret
spec: ...
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: another-sa
  namespace: system
---
kind: ConfigMap
metadata:
  name: config
...

What did you expect to see?
I expect:

  1. the contents of the bundle to contain said resources amongst the bundle/manifests:
bundle/manifests
    another-sa_v1_serviceaccount.yaml
    my-secret_v1beta1_vaultstaticsecret.yaml
    config_v1_configmap.yaml
  1. the configmap to be created as part of the installation of the CSV

What did you see instead? Under which circumstances?
Bundle Creation:

  • While another-sa and config are present in the bundle, my-secret is missing from the bundle.

Operator Deployment:

  • When installing the CSV, config is not created in the target cluster, and the operator deployment can't start.

Environment

  • operator-sdk version:
operator-sdk version: "v1.33.0", commit: "542966812906456a8d67cf7284fc6410b104e118", kubernetes version: "1.27.0", go version: "go1.21.5", GOOS: "linux", GOARCH: "amd64"
  • Kubernetes version information:
Client Version: v1.28.3
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.27.10-eks-508b6b3
  • Kubernetes cluster kind:

Additional context
Add any other context about the question here.

@everettraven
Copy link
Contributor

I believe OLM has a limitation as to which resources are valid to be included in a bundle. You should be able to find that list of resources here: https://olm.operatorframework.io/docs/tasks/creating-operator-manifests/#packaging-additional-objects-alongside-an-operator

@everettraven
Copy link
Contributor

Just to note, we are currently working on OLM v1 which, as far as I am aware, will not have this same limitation.

@totahuanocotl
Copy link
Author

Ah! That is it. Thanks for highlighting that!
Can't believe I missed it.

Is there a recommended approach to work around this limitation at the moment?

If I can't deploy all the resources as part of the bundle, I'm not sure I can continue with the OLM approach and might need to consider going back to helm charts instead.

@everettraven
Copy link
Contributor

Is there a recommended approach to work around this limitation at the moment?

Not that I am personally aware of. maybe @joelanford or @kevinrizza have some insights into workarounds?

@totahuanocotl
Copy link
Author

Closing, as the main question has been resolved and there is clear documentation about it.
Thanks!

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

No branches or pull requests

2 participants