Ingress

Questions on ingress and load balancing

How do I configure the ingress domain in Dev, Staging or Production?

With the new helm 3 based boot every environment uses boot - so there is a single way to configure anything whether its in the dev, staging or production environment and whether or not you are using multiple clusters.

You can override the domain name for use in all apps within an environment by modifying the jx-requirements.yml in the git repository for the dev, staging or production environment.

ingress:
  domain: mydomain.com 

Also by default there is a namespace specific separator added. So if your service is cheese the full domain name would be something like cheese.jx-staging.mydomain.com.

If you wish to avoid the namespace specific separator if each environment already has its own unique domain value then you can specify:

ingress:
  domain: mydomain.com  
  namespaceSubDomain: "."

If you wish to change any of these values for a single app only then you can use the app customisation mechanism.

e.g. for an app called mychart you can create a file called apps/mychart/values.yaml in the git repository for your environment and add the following YAML:

jxRequirements:
  ingress:
    domain: mydomain.com  
    namespaceSubDomain: "."

How do I configure the ingress TLS certificate in Dev, Staging or Production?

You can specify the TLS certificate to use for the dev, staging or production environment by modifying the jx-requirements.yml file in the environments git repository:

ingress: 
  tls:
    enabled:
    secretName: my-tls-secret-name

This will then be applied to all the Jenkins X ingress resources for things like lighthouse or nexus - plus any apps you deploy to dev, staging or production.

If you want to override the TLS secret name for a specific app in a specific environment then rather like the above question you can use the app customisation mechanism.

e.g. for an app called mychart you can create a file called apps/mychart/values.yaml in the git repository for your environment and add the following YAML:

jxRequirements:
  ingress:
    tls:
      enabled:
      secretName: my-tls-secret-name

How To Add Custom Annotations to Ingress Controller?

There may be times when you need to add your custom annotations to ingress resources.

The simplest way to do this is to modify the jx-requirements.yml in your development git repository to add any ingress annotations you wish:

apiVersion: core.jenkins-x.io/v4beta1
kind: Requirements
spec:
  ...
  ingress:
    annotations:
      myannotation: somevalue
    domain: my.domain.com

Once you have commit and push this change it will trigger another boot job

You can watch the boot job run via:

jx admin log -w

Once its complete you should see the new annotations on any Ingress created by Jenkins X.

If you wish to add custom annotations to only a specific ingress then you can customise the chart in the usual helmfile way via a values.yaml file you reference in your helmfile.yaml file

How do I diagnose webhooks?

See How to diagnose webhooks

How do I use webhooks without a public IP?

If you are running on your laptop or in a private cluster you won’t be able to use webhooks on your git provider to trigger pipelines.

A workaround is to use use something like ngrok to enable webhooks

How do I configure to use v1beta1 Ingress?

We recently upgraded to default to Ingress networking.k8s.io/v1 which is included from version 1.19 as the older networking.k8s.io/v1beta1 is deprecated and to be removed in v 1.22.

If you are on 1.18 we recommend you upgrade to 1.19 if you can.

If not here’s how to configure Jenkins X to use the deprecated networking.k8s.io/v1beta1 version:

  • create this file at helmfiles/jx/jxboot-helmfile-values.yaml:
ingress:
  apiVersion: networking.k8s.io/v1beta1
  • then add it at the last item in helmfiles/jx/helmfile.yaml for the release of the chart jx3/jxboot-helmfile-resources. So your file should look something like
releases:
... 
- chart: jx3/jxboot-helmfile-resources
  version: 1.0.63
  name: jxboot-helmfile-resources
  values:
  - ../../versionStream/charts/jx3/jxboot-helmfile-resources/values.yaml.gotmpl
  - jx-values.yaml
  - jxboot-helmfile-values.yaml
  • create this file at helmfiles/jx/jx-pipelines-visualizer-values.yaml:
ingress:
  apiVersion: networking.k8s.io/v1beta1
  • then add it at the last item in helmfiles/jx/helmfile.yaml for the release of the chart jx3/jx-pipelines-visualizer. So your file should look something like
releases:
... 
- chart: jx3/jx-pipelines-visualizer
  version: 1.7.1
  name: jx-pipelines-visualizer
  values:
  - ../../versionStream/charts/jx3/jx-pipelines-visualizer/values.yaml.gotmpl
  - jx-values.yaml
  - jx-pipelines-visualizer-values.yaml

Then when you git commit these changes and your build job completes (e.g. watch it via jx admin log -w) your ingress resources should now be using networking.k8s.io/v1beta1