spinframework / spinframework/spin-operator

Enable configuring the Shim via the spin-operator

Open
#248 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
289
Forks
34
PR merge metrics
No merged PRs in 30d

Description

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:

env:
 - name: NODE_IP
    valueFrom:
      fieldRef:
        fieldPath: status.hostIP
 - name: OTEL_EXPORTER_OTLP_ENDPOINT
    value: "http://$(NODE_IP):4318"

Proposal: add a SpinApp.spec.env

Workaround

Create deployment directly instead of creating a SpinApp CR, bypassing the Spin operator:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: spin-test
spec:
  replicas: 1
  selector:
    matchLabels:
      app: spin-test
  template:
    metadata:
      labels:
        app: spin-test
    spec:
      runtimeClassName: wasmtime-spin-v2
      containers:
      - name: spin-test
        image: ttl.sh/spin-foo-123:48h
        command: ["/"]
        ports:
        - containerPort: 80
        env:
       - name: NODE_IP
          valueFrom:
            fieldRef:
              fieldPath: status.hostIP
         - name: OTEL_EXPORTER_OTLP_ENDPOINT
            value: "http://$(NODE_IP):4318"

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with the SpinApp CRD definition and the operator's generated Deployment, then trace how pod environment is currently configured. Implement the proposed spec.env field and confirm that the resulting Deployment preserves value and valueFrom entries, including the NODE_IP and OTEL example.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes, wasm
Domain
api, devops, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.