-
-
Save vfarcic/c09d2657583afd75e38522b66776f785 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source: https://gist.github.com/c09d2657583afd75e38522b66776f785 | |
################################### | |
# Helm And Kustomize Replacement? # | |
# Jsonnet With Grafana Tanka # | |
# https://youtu.be/-qpcsUXElYc # | |
################################### | |
# Additional Info: | |
# - Jsonnet: https://jsonnet.org | |
# - Grafana Tanka: https://grafana.com/oss/tanka | |
######### | |
# Setup # | |
######### | |
# Create a Kubernetes cluster (any should do) | |
# Install `tk` and `jb` CLIs from https://tanka.dev/install | |
git clone https://github.com/vfarcic/tanka-demo | |
cd tanka-demo | |
export CURRENT_CONTEXT=$(kubectl \ | |
config current-context) | |
export API_SERVER=$(kubectl config view \ | |
--raw --minify --flatten \ | |
--output jsonpath="{.clusters[?(@.name == \"$CURRENT_CONTEXT\")].cluster.server}") | |
# Install `jq` CLI from https://stedolan.github.io/jq/download/ | |
cat environments/production/spec.json \ | |
| jq ".spec.apiServer = \"$API_SERVER\"" \ | |
| tee environments/production/spec.json | |
cat environments/libs/spec.json \ | |
| jq ".spec.apiServer = \"$API_SERVER\"" \ | |
| tee environments/libs/spec.json | |
################################### | |
# Jsonnet With Grafana Tanka Demo # | |
################################### | |
ls -1 | |
# `tk init` creates the initial folder structure and files | |
tk eval environments/production | |
tk show environments/production | |
tk apply environments/production | |
kubectl --namespace production get all,ingresses | |
cat environments/production/kubernetes.libsonnet | |
cat environments/production/silly-demo.Jsonnet | |
cat environments/production/devops-toolkit.Jsonnet | |
cat environments/production/main.Jsonnet | |
cat environments/production/spec.json | |
cat environments/production/kubernetes.libsonnet | |
cat environments/libs/main.Jsonnet | |
tk show environments/libs | |
########### | |
# Destroy # | |
########### | |
tk delete environments/production | |
# Destroy or reset the cluster |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment