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 | |
volume_names=$(kubectl -n longhorn-system get volumes.longhorn.io -o json | jq -r '.items[] | .metadata.name') | |
for volume_name in $volume_names; | |
do | |
echo "############################################################################################################################" | |
echo -n "numberOfReplicas " | |
kubectl -n longhorn-system patch volumes.longhorn.io $volume_name --type='merge' -p '{"spec":{"numberOfReplicas":1}}'; |
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 | |
# List all Helm releases in the cluster | |
helm list --all-namespaces --short | while read -r release; do | |
echo "Processing release: $release" | |
# Get revision history for the release | |
revisions=$(helm history "$release" --short | tail -n +2) | |
# Keep the latest revision | |
latest_revision=$(echo "$revisions" | head -n 1) |
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 | |
while getopts "c:h" opt; do | |
case $opt in | |
c) | |
CLUSTER="${OPTARG}" | |
;; | |
h) | |
help && exit 0 | |
;; |
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
--- | |
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: log-watcher-sa | |
namespace: cert-manager | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: ClusterRole | |
metadata: |
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 | |
# Create CA private key | |
if [ ! -f ca-private.pem ]; then | |
openssl ecparam -name prime256v1 -genkey -noout -out ca-private.pem | |
fi | |
# Create CA public key | |
openssl ec -in ca-private.pem -pubout -out ca-public.pem | |
# Create self signed CA certificate | |
openssl req -x509 -new -key ca-private.pem -days 365 -out ca.crt -subj "/CN=root.linkerd.cluster.local" |
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 | |
ln -s /var/lib/rancher/rke2/bin/kubectl /usr/local/bin/kubectl | |
mkdir -p ~/.kube/ | |
ln -s /var/lib/rancher/rke2/server/cred/admin.kubeconfig ~/.kube/config |
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
... | |
config: | |
global: | |
resolve_timeout: 5m | |
slack_api_url: "https://hooks.slack.com/services/abcdef/123456789...." | |
receivers: | |
- name: "slack" | |
slack_configs: | |
- api_url: 'https://hooks.slack.com/services/abcdef/123456789....' | |
username: 'ClusterName' |
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 | |
objects=`kubectl api-resources --verbs=list --namespaced -o name` | |
for namespace in `kubectl get ns -o name | awk -F '/' '{print $2}'` | |
do | |
echo "Namespace: $namespace" | |
mkdir -p namespace/"$namespace" | |
for object in $objects |
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
apiVersion: monitoring.coreos.com/v1 | |
kind: PrometheusRule | |
metadata: | |
annotations: | |
meta.helm.sh/release-name: monitoring | |
meta.helm.sh/release-namespace: monitoring | |
prometheus-operator-validated: "true" | |
labels: | |
app: kube-prometheus-stack | |
app.kubernetes.io/instance: monitoring |
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 | |
objects=`kubectl api-resources --verbs=list --namespaced -o name` | |
for namespace in `kubectl get ns -o name | awk -F '/' '{print $2}'` | |
do | |
echo "Namespace: $namespace" | |
mkdir -p namespace/"$namespace" | |
for object in $objects | |
do |
NewerOlder