Advanced Features

Advanced features and detailed information for using Kubernetes with Runway.

Setting KUBECONFIG Location

If using a non-default kubeconfig location, you can provide it using deployment.env_vars/module.env_vars for setting environment variables. This can be set as a relative path or an absolute one.

deployments:
  - modules:
      - path: myk8smodule
        env_vars:
          KUBECONFIG:
            - .kube
            - ${env DEPLOY_ENVIRONMENT}
            - config

This would set KUBECONFIG to <path_to_runway.yml>/.kube/$DEPLOY_ENVIRONMENT/config where $DEPLOY_ENVIRONMENT is the current Runway deploy environment.


Version Management

By specifying the version via a .kubectl-version file in your overlay directory or deployment.module_options/module.options, Runway will automatically download & use that version for the module. This is recommended to keep a predictable experience when deploying your module.

Without a version specified, Runway will fallback to whatever kubectl it finds first in your PATH.

.kubectl-version
1.14.5

Lookups can be used to provide different versions for each deploy environment.

runway.yml
deployments:
  - modules:
      - path: sampleapp.k8s
        options:
          kubectl_version: ${var kubectl_version.${env DEPLOY_ENVIRONMENT}}
  - module:
      - sampleapp-01.k8s
      - sampleapp-02.k8s
    module_options:
      kubectl_version: 1.14.5