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

helm chart support extraenv #2021

Open
willzhang opened this issue Feb 22, 2024 · 3 comments
Open

helm chart support extraenv #2021

willzhang opened this issue Feb 22, 2024 · 3 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@willzhang
Copy link

willzhang commented Feb 22, 2024

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.

@willzhang willzhang added the kind/feature Categorizes issue or PR as related to a new feature. label Feb 22, 2024
@luoyucumt
Copy link

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(),
 }

@piyush-garg
Copy link
Contributor

@willzhang Can you please explain about the request here

@willzhang
Copy link
Author

willzhang commented Apr 25, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

3 participants