tektoncd/operator

helm chart support extraenv

willzhang opened this issue · 3 comments

Feature request

Helm chart values.yaml support extraEnvVars,

tekton-operator-lifecycle:
  extraEnvVars:
    - name: FOO
      value: "bar"

I hope install in offline environment, and set image url

apiVersion: apps/v1
kind: Deployment
metadata:
  name: tekton-operator
  namespace: tekton-operator
spec:
  template:
    spec:
      containers:
        - name: tekton-operator-lifecycle
          image: registry.cn-shenzhen.aliyuncs.com/cnmirror/tekton-operator:v0.69.1
          env:
            - name: IMAGE_PIPELINES_PROXY
              value: registry.zot.com:5000/tekton-releases/github.com/tektoncd/operator/cmd/kubernetes/proxy-webhook:v0.69.1
            - name: IMAGE_PIPELINES_TEKTON_EVENTS_CONTROLLER
              value: registry.zot.com:5000/tekton-releases/github.com/tektoncd/pipeline/cmd/events:v0.53.3
            - name: IMAGE_PIPELINES_WEBHOOK
              value: registry.zot.com:5000/tekton-releases/github.com/tektoncd/pipeline/cmd/webhook:v0.53.3
            - name: IMAGE_PIPELINES_TEKTON_PIPELINES_CONTROLLER
              value: registry.zot.com:5000/tekton-releases/github.com/tektoncd/pipeline/cmd/controller:v0.53.3
            - name: IMAGE_PIPELINES_CONTROLLER
              value: registry.zot.com:5000/tekton-releases/github.com/tektoncd/pipeline/cmd/resolvers:v0.53.3
            - name: IMAGE_TRIGGERS_TEKTON_TRIGGERS_CORE_INTERCEPTORS
              value: registry.zot.com:5000/tekton-releases/github.com/tektoncd/triggers/cmd/interceptors:v0.25.3
            - name: IMAGE_TRIGGERS_TEKTON_TRIGGERS_CONTROLLER
              value: registry.zot.com:5000/tekton-releases/github.com/tektoncd/triggers/cmd/controller:v0.25.3
            - name: IMAGE_TRIGGERS_WEBHOOK
              value: registry.zot.com:5000/tekton-releases/github.com/tektoncd/triggers/cmd/webhook:v0.25.3
            - name: IMAGE_CHAINS_TEKTON_CHAINS_CONTROLLER
              value: registry.zot.com:5000/tekton-releases/github.com/tektoncd/chains/cmd/controller:v0.19.0
            - name: IMAGE_JOB_PRUNER_TKN
              value: registry.zot.com:5000/tekton-releases/dogfooding/tkn:latest

Use case

support offline install with helm chart.

Is it possible to implement dashboard environment variables?

  • name: IMAGE_DASHBOARD_TEKTON_DASHBOARD
    value: "gcr.io/tekton-releases/github.com/tektoncd/dashboard/cmd/dashboard:v0.39.0"

I think this is a very minor change.
in pkg/reconciler/common/transformers.go

DashboardImagePrefix          = "IMAGE_DASHBOARD_"

in pkg/reconciler/kubernetes/tektondashboard/transform.go

images := common.ToLowerCaseKeys(common.ImagesFromEnv(common.DashboardImagePrefix))
trns := extension.Transformers(dashboard)
extra := []mf.Transformer{
                        common.InjectOperandNameLabelOverwriteExisting(v1alpha1.OperandTektoncdDashboard),
                        common.DeploymentImages(images),
                        common.AddConfiguration(dashboard.Spec.Config),
                        common.AddDeploymentRestrictedPSA(),
 }

@willzhang Can you please explain about the request here

Purpose: Install tekton operator through helm in an isolated network environment within the intranet
when i use helm install tekton operator

helm repo add tektoncd "git+https://github.com/tektoncd/operator@charts?ref=main"

# Install the operator
helm install tekton-operator \
  -n tekton-operator \
  --create-namespace \
  --set installCRDs=true \
  tektoncd/tekton-operator

In order to achieve offline installation, I need to understand and solve two problems:

  • What dependent images does tekton operator require?
  • How do I configure the tekton operator to get the image from?

Perhaps it is more appropriate to extend the TektonConfig CRD to specify the image

apiVersion: operator.tekton.dev/v1alpha1
kind: TektonPipeline
metadata:
  name: pipeline
spec:
  proxy-webhookImage: 192.168.10.10:5000/tekton-releases/github.com/tektoncd/operator/cmd/kubernetes/proxy-webhook:v0.69.1
  eventsImage: 192.168.10.10:5000/tekton-releases/github.com/tektoncd/pipeline/cmd/events:v0.53.3


apiVersion: operator.tekton.dev/v1alpha1
kind: TektonTrigger
metadata:
  name: trigger
spec:
  triggersImage: 192.168.10.10:5000/tekton-releases/github.com/tektoncd/triggers/cmd/controller:v0.25.3

How can i let operator to pull image from my local harbor or zot docker registry?