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
#!/usr/bin/env bash | |
VERSION="0.0.2" | |
SCRIPT_URL='https://gist.github.com/cubedtear/54434fc66439fc4e04e28bd658189701/raw' | |
SCRIPT_DESCRIPTION="" | |
SCRIPT_LOCATION="${BASH_SOURCE[@]}" | |
rm -f updater.sh | |
function update() | |
{ |
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
# An attempt to create a CAPD cluster as explained in https://cluster-api.sigs.k8s.io/user/quick-start.html | |
# config.yaml for kind cluster which maps host docker socket into the kind cluster node | |
cat >config.yaml <<EOF | |
kind: Cluster | |
apiVersion: kind.x-k8s.io/v1alpha4 | |
nodes: | |
- role: control-plane | |
extraMounts: | |
- hostPath: /var/run/docker.sock |
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
#yq is a pre-req | |
kubectl get deploy -o yaml |yq eval 'del(.metadata.resourceVersion, .metadata.uid, .metadata.annotations, .metadata.creationTimestamp, .metadata.selfLink, .metadata.managedFields, .status)' - | |
#if you want a more simple solution just add an alias like below to your .bashrc/.profile, | |
alias clean-yaml='yq eval "del(.metadata.resourceVersion, .metadata.uid, .metadata.annotations, .metadata.creationTimestamp, .metadata.selfLink, .metadata.managedFields, .status)" - ' | |
kubectl get sts redis -o yaml | clean-yaml |
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
kind: PersistentVolumeClaim | |
apiVersion: v1 | |
metadata: | |
name: pvc-vol-nginx | |
namespace: gkr-dev #change this accordigly | |
annotations: | |
volume.beta.kubernetes.io/storage-class: default | |
spec: | |
accessModes: | |
- ReadWriteMany |
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
#!/bin/bash | |
# | |
# Shell scripts for get image manifest from v2 registry | |
# | |
# Tested on Debian 8, curl 7.38.0, jq-1.5 | |
# | |
set -e -u | |
# Default tag is latest |
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
#!/bin/bash | |
set -e | |
set -o pipefail | |
# Add user to k8s using service account, no RBAC (must create RBAC after this script) | |
if [[ -z "$1" ]] || [[ -z "$2" ]]; then | |
echo "usage: $0 <service_account_name> <namespace>" | |
exit 1 | |
fi |