-
Notifications
You must be signed in to change notification settings - Fork 23
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
Enable configuring the Shim via the spin-operator #248
Comments
Thanks for filing this @kate-goldenring. An alternative would be to have something like I think we need to spend some time thinking about how OTel will get configured in other executors to figure out the design here. |
@calebschoepp I'd rather have a more general solution given that users will likely want to set other env vars as well. I also don't think we have a precedent for specific fields like I don't imagine it being too complicated for executors to reference and use the env vars set in the |
I like the idea of some kind of
|
I see. I think we are running into an interesting distinction here between two types of environment variables in Spin:
In the context of the I am coming around to understanding how OTEL is a unique case and should not be set in an |
@kate-goldenring how do you feel about something like this? Setting apiVersion: core.spinoperator.dev/v1alpha1
kind: SpinApp
metadata:
name: simple-spinapp
spec:
image: "ghcr.io/spinkube/containerd-shim-spin/examples/spin-rust-hello:v0.13.0"
replicas: 1
executor: containerd-shim-spin
env:
FOO: bar Setting apiVersion: core.spinoperator.dev/v1alpha1
kind: SpinAppExecutor
metadata:
name: containerd-shim-spin
spec:
createDeployment: true
deploymentConfig:
runtimeClassName: wasmtime-spin-v2
installDefaultCACerts: true
env:
OTEL_EXPORTER_OTLP_ENDPOINT=http... For clarity we could change the names to be something like |
It seems a bit backwards to have the SpinApp (which references an executor) cause an update in the executor. I could see someone configuring that in the executor from the start though. This does mean it would be on an executor level not an app level |
We deliberately avoided If we want to expose configuration for the shim, we should create a typed set of configuration rather than doing env-string-mappings.
that we then render as an environment variable (or some other more structured config if possible) |
The driving goal here being: We should always aim to provide a declarative API that captures intent rather than a current implementation detail (leaving those bits for the operator to manage based on the intent) |
My only concern with the declarative API is whether it is over-prescriptive. Some executors may support fields that others don't. For example, say one executor doesn't support Spin apps with the SQS trigger? Where/how can a user configure the following SQS trigger runtime values?
These should be configurable at the app level so would we expand the SpinApp CRD so that the following is possible? apiVersion: core.spinoperator.dev/v1alpha1
kind: SpinApp
metadata:
name: simple-spinapp
spec:
image: "ghcr.io/spinkube/containerd-shim-spin/examples/spin-rust-hello:v0.13.0"
replicas: 1
executor: containerd-shim-spin
aws:
defaultRegion:"us-west-2"
accessKeyId: "123"
secretAccessKey: <ref to k8s secret>
sessionToken: <ref to k8s secret> |
For trigger config, we have #15, but never got around to doing design work for it. That's a somewhat separate problem though. (And I would probably prefer some kind of typed |
We already have the SQS trigger in the shim so it would be good to enable using it with this trigger config
This sounds like a reasonable approach to me. What would be next steps to getting more input on this? My SKIP aims to cover configuration but it may be getting a little bloated https://github.com/spinkube/skips/pull/4/files |
I'd probably drop the Spin Operator/CRD bits from SKIP04, then we can follow up with the API we wanna expose? (if you wanna avoid too much bloat) |
Users should be able to set Pod environment variables via the SpinApp CRD. These can be used for configuring settings, such as open telemetry endpoints:
Proposal: add a
SpinApp.spec.env
Workaround
Create deployment directly instead of creating a
SpinApp
CR, bypassing the Spin operator:The text was updated successfully, but these errors were encountered: