jenkins-x / jx

Jenkins X provides automated CI+CD for Kubernetes with Preview Environments on Pull Requests using Cloud Native pipelines from Tekton
https://jenkins-x.io/
Apache License 2.0
4.58k stars 788 forks source link

Changing jx-requirements.xml registry after install #8152

Open chrislovecnm opened 2 years ago

chrislovecnm commented 2 years ago

Problem

I am running the cluster in us-west-2 and I set the registry variable to us-east-2, where our primary registry exists. This is a common practice. The region in the requirements file is set to us-west-2. When a build runs the container push fails because the region is set to us-west-2 and cannot authenticate with us-east-2. I updated the jx-requirements.yaml file and push the change to our repo. The build job runs and overrites the registry value, and checks it back in. The value is not updated, but is overwritten.

Requirements YAML

apiVersion: core.jenkins-x.io/v4beta1
kind: Requirements
spec:
  autoUpdate:
    enabled: false
    schedule: ""
  cluster:
    chartRepository: http://jenkins-x-chartmuseum.jx.svc.cluster.local:8080
    clusterName: REDACTED-dev-eks
    devEnvApprovers:
    - todo
    environmentGitOwner: REDACTED
    gitKind: gitlab
    gitName: gl
    gitServer: https://gitlab.com
    project: "REDACTED"
    provider: eks
    region: us-west-2
    registry: REDACTED.dkr.ecr.us-east-2.amazonaws.com
  environments:
  - key: dev
    owner: ssc-rnd
    repository: jx3-eks-asm
  - key: staging
  - key: production
  ingress:
    domain: jx3.REDACTED.REDACTED.com
    externalDNS: true
    kind: ingress
    namespaceSubDomain: -jx.
    tls:
      email: REDACTED@REDACTED.com
      enabled: true
      production: true
  pipelineUser:
    username: chrislovecnm
  repository: nexus
  secretStorage: secretsManager
  storage:
  - name: logs
    url: s3://REDACTED-dev-eks-20220420182851392800000001
  - name: reports
    url: s3://rREDACTED-dev-eks-20220420182851770800000006
  - name: repository
    url: s3://REDACTED-jx3-dev-eks-20220420182851398900000002
  terraform: true
  vault: {}
  webhook: lighthouse

JX Version

$ jx version
version: 3.2.308

$ jx gitops version
version: 0.7.6

I am not using a custom versionStream.

Workaround

I am setting the .jx/secrets file in a code repository to the us-west registry and it works fine.

TLDR;

I cannot change the registry value in a previously installed system.

ankitm123 commented 2 years ago

You need to change it in the requirements file in the cluster git repo, as well as the jx-requirements config map in the default namespace.