Skip to content

Instantly share code, notes, and snippets.

View quangnhut123's full-sized avatar

Tran Quang Nhut (Jonny) quangnhut123

View GitHub Profile
@quangnhut123
quangnhut123 / get_kubeconfig_custom_cluster_rancher2.sh
Created August 23, 2018 11:00 — forked from superseb/get_kubeconfig_custom_cluster_rancher2.sh
Get kubeconfig for custom cluster in Rancher 2.0
#!/bin/bash
# Usage: ./get_kubeconfig_custom_cluster_rancher2.sh cluster_name
# Needs to be run on the server running `rancher/rancher` container
# Check if jq exists
command -v jq >/dev/null 2>&1 || { echo "jq is not installed. Exiting." >&2; exit 1; }
# Check if clustername is given
if [ -z "$1" ]; then
echo "Usage: $0 [clustername]"