Skip to content

Instantly share code, notes, and snippets.

@gitlawr
Created May 22, 2019 02:09
Show Gist options
  • Save gitlawr/c223cb0fb9e9df59c1d8ed98c6257a9a to your computer and use it in GitHub Desktop.
Save gitlawr/c223cb0fb9e9df59c1d8ed98c6257a9a to your computer and use it in GitHub Desktop.
Rancher pipeline deploy to external K8S clusters
stages:
- name: Deploy to external K8S
  steps:
  - runScriptConfig:
      # Any images with kubectl binary packaged
      image: lawr/kubectl 
      shellScript: |-
        mkdir -p ~/.kube
        # This helps to hide the file content in build logs
        ({ set +x; } 2>/dev/null; printf "%s" "$KUBE_CONFIG" > ~/.kube/config;)
        # Do whatever CD flows in kubectl/helm way.
        kubectl get pod --all-namespaces
    envFrom:
    # put your kubeconfig file in a secret named mysecret
    - sourceName: mysecret
      sourceKey: KUBE_CONFIG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment