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
# select data with start & end | |
curl -v http://vmcluster-cr-victoria-metrics-cluster-vmselect.kube-prometheus-stack.svc.cluster.local:8481/select/0/prometheus/api/v1/series -d 'match[]=costInBillingCurrency' -d 'start=2023-12-01T00:00:00Z' -d 'end=2023-12-07T23:59:59Z' | |
curl -v http://vmcluster-cr-victoria-metrics-cluster-vmselect.kube-prometheus-stack.svc.cluster.local:8481/select/0/prometheus/api/v1/series -d 'match[]=costInBillingCurrency{month="12"}' | |
# delete metrics from clustered db: | |
curl -v http://vmcluster-cr-victoria-metrics-cluster-vmselect.kube-prometheus-stack.svc.cluster.local:8481/delete/0/prometheus/api/v1/admin/tsdb/delete_series -d 'match[]=gl_log_size' | |
# delete metrics from clustered db: | |
curl -v http://vmcluster-cr-victoria-metrics-cluster-vmselect.kube-prometheus-stack.svc.cluster.local:8481/delete/0/prometheus/api/v1/admin/tsdb/delete_series -d 'match[]=costInBillingCurrency{month="12"}' |
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
trigger: none | |
variables: | |
- group: library-variable-group #name of the var group | |
stages: | |
- stage: | |
displayName: retrieve | |
jobs: | |
- deployment: retrieve |
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
# run as admin | |
kubectl exec -it kafka-test-kafka-admin-abc1234 -- bash | |
# get consumer groups (GROUP_ID=app-dev.abc_malu) | |
./kafka-consumer-groups.sh --bootstrap-server $BOOTSTRAP_SERVER --command-config /tmp/kafka/client.properties --describe --group $GROUP_ID | |
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
def base_encode(self, secret_value): | |
""" | |
Return base64 encoded string | |
""" | |
message_bytes = secret_value.encode('ascii') | |
base64_bytes = base64.b64encode(message_bytes) | |
base64_message = base64_bytes.decode('ascii') | |
return base64_message |
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
group (disk_used_percent{function=~".*"}) by (function) |
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
## locate installed helm charts in a namespace: | |
helm list | |
## add new local repo | |
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts | |
helm repo update | |
## get available chart versions | |
# helm search repo <reponame>/<chartname> --versions | |
helm search repo prometheus-community/kube-prometheus-stack --versions |
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
kubectl get secret -n myns mysecret -o jsonpath="{.data.tls\.crt}" | base64 -d | openssl x509 -text -noout |
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
TOKEN=${1?Error: Must supply the token} | |
TF_OUTPUT_LOC=${2?Error: Must supply path to Terraform output file (json format)} | |
CON_ID=$(jq -rc '.service_connection_id' $TF_OUTPUT_LOC) | |
CON_NAME=$(jq -rc '.service_endpoint' $TF_OUTPUT_LOC) | |
PROJECT_NAME=$(jq -rc '.azdo_project' $TF_OUTPUT_LOC | sed 's/ /%20/g') #for url encoding | |
NAMESPACE=$(jq -rc '.namespace' $TF_OUTPUT_LOC) | |
CLUSTER=$(jq -rc '.cluster_name' $TF_OUTPUT_LOC) | |
APPR=$(jq -rc '.approvers' $TF_OUTPUT_LOC) |
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
## get available versions | |
az aks get-versions --location switzerland-north --output table | |
## check for cluster used APIs and compare with a deprication guide (https://kubernetes.io/docs/reference/using-api/deprecation-guide) | |
kubectl api-resources -n all | |
# fetch credentials for admin into a file and merge existing | |
az aks get-credentials --resource-group $RSG_NAME --name $AKS_NAME --admin --file ./.kube/config --overwrite-existing |
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
# add "cd" at the end of .bashrc to default to /home/malu | |
# add soft link to windows default directory | |
ln -s /mnt/c/Users/malu win_home | |
# how to remove a link | |
unlink win_home |
NewerOlder