Configuration

Configuration of Environments and Promotion

In your development cluster the jx-requirements.yml file is used to define which environments are used for promotion.

The default configuration for environments looks something like this:

apiVersion: core.jenkins-x.io/v4beta1
kind: Requirements
spec:
  ...
  environments:
  - key: dev
  - key: staging
  - key: production

which defaults to meaning that Staging and Production are namespaces (jx-staging and jx-production) in the local cluster. Staging will use Auto promotion and Production will use Manual (more on that later).

When you setup a Remote Cluster for Staging or Production you can remove the above entries for those environments.

Then when you import the remote cluster repository into the development environment (to setup the CI/CD on pull requests and enable promotion) the generated Pull Request will modify your jx-requirements.yml to add remote entries for the remote cluster.

e.g. after importing the remote production environment via jx project import and the pull request merging it should look like:

apiVersion: core.jenkins-x.io/v4beta1
kind: Requirements
spec:
  ...
  environments:
    - key: dev
      repository: my-dev-environment
    - key: staging
    - key: production
      owner: myowner
      repository: my-prod-repo
      remoteCluster: true