Skip to content

Instantly share code, notes, and snippets.

View carlosjgp's full-sized avatar
🎯
Focusing

Carlos Juan Gómez Peñalver carlosjgp

🎯
Focusing
View GitHub Profile
@carlosjgp
carlosjgp / render-examples.sh
Created March 23, 2023 14:45
Helm chart testing
#!/bin/bash
set -ex
helm repo up
# Find `ci` directories
for chart_file in $(find * -name Chart.yaml -print | sort); do
# Find `.template` files
dir=$(dirname ${chart_file})
@carlosjgp
carlosjgp / gist:85d9a71fe2b979ae9978994a8ba57bb9
Created November 22, 2022 14:41
Prometheus Cloudwatch exporter configuration generation
# This command shows all the metrics from all the services in use on the account and region used
# Different services and configurations might have more or less metrics than others. eg. When using T instance types you would get CPU credits related metrics otherwise you won't
#
# AWS Cloudwatch metrics namespaces https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/aws-services-cloudwatch-metrics.html
aws cloudwatch list-metrics --namespace AWS/ES > metrics.json
# Add 'select(.MetricName | contains("FreeStorageSpace")) |' to JQ pipe to filter by name
#
# this snippet will not add the instances identifiers and remove duplicated entries (one per instace)
cat metrics.json | jq -r '.Metrics
@carlosjgp
carlosjgp / garden.yml
Last active June 22, 2021 18:47
Garden 0.12.23 logs garden-io/garden #2418
kind: Project
name: my-project
defaultEnvironment: ${local.env.ENVIRONMENT}
dotIgnoreFiles: [.gitignore]
variables:
myEnvs: here
environments:
- name: dev
- name: ci
- name: stable-build

Keybase proof

I hereby claim:

  • I am carlosjgp on github.
  • I am carlosjgp (https://keybase.io/carlosjgp) on keybase.
  • I have a public key whose fingerprint is 7C07 E84B 4BAD CB62 05C4 9231 26C3 7139 32D0 9D59

To claim this, I am signing this object:

@carlosjgp
carlosjgp / 01-prometheus-repo.sh
Last active June 19, 2020 15:53
Medium blog post code
helm repo add stable https://kubernetes-charts.storage.googleapis.com
helm repo up
@carlosjgp
carlosjgp / SRE_tools.md
Last active March 23, 2021 16:55
SRE tools
@carlosjgp
carlosjgp / log.txt
Created March 12, 2020 10:21
Strimzi Topic Operator 0.16.2 with -Xmx
+ shift
+ . /opt/strimzi/bin/dynamic_resources.sh
++ get_heap_size
+++ cat /sys/fs/cgroup/memory/memory.limit_in_bytes
++ CONTAINER_MEMORY_IN_BYTES=536870912
++ DEFAULT_MEMORY_CEILING=32505856
++ '[' 536870912 -lt 32505856 ']'
+ MAX_HEAP=
+ '[' -n '' ']'
+ export MALLOC_ARENA_MAX=2
@carlosjgp
carlosjgp / cheatsheet.sh
Created May 29, 2019 08:22
kubectl Cheatsheet
# List all the CRDs from all the NAMESPACES
for ns in $(kubectl get ns -o jsonpath='{.items[*].metadata.name}'); do \
echo "-------- NS: $ns -------- \n"; \
for crd in $(kubectl get crd -o jsonpath='{.items[*].spec.names.kind}'); do \
echo "-------- CRD: $crd -------- \n"; \
kubectl get $crd -n $ns; \
done; \
done;
@carlosjgp
carlosjgp / dashboard
Created May 1, 2019 11:13
Tyk error creating token
time="May 1 10:35:25" level=warning msg="Login opened from: 172.22.20.185:59572"
time="May 1 10:35:30" level=warning msg="Login opened from: 172.22.20.185:59612"
time="May 1 10:35:35" level=info msg="Got configuration for nodeID: 9d8c7885-a618-4483-67d2-930b0c30dda1|tyk-gateway-7c779889f8-t8h6h"
time="May 1 10:35:35" level=info msg="Got configuration for nodeID: 9d8c7885-a618-4483-67d2-930b0c30dda1|tyk-gateway-5f68fd54b5-6m7fg"
time="May 1 10:35:35" level=warning msg="Login opened from: 172.22.20.185:59638"
time="May 1 10:35:38" level=info msg="Sending config request for node: 9d8c7885-a618-4483-67d2-930b0c30dda1-tyk-gateway-7c779889f8-t8h6h"
time="May 1 10:35:38" level=info msg="Got configuration for nodeID: 9d8c7885-a618-4483-67d2-930b0c30dda1|tyk-gateway-7c779889f8-t8h6h"
time="May 1 10:35:38" level=info msg="Got configuration for nodeID: 9d8c7885-a618-4483-67d2-930b0c30dda1|tyk-gateway-5f68fd54b5-6m7fg"
time="May 1 10:35:40" level=warning msg="Login opened from: 172.22.20.185:59702"
time
@carlosjgp
carlosjgp / Helm
Last active December 28, 2022 14:46
Tyk - Deployment and configuration
# redis
helm upgrade --install --namespace tyk \
--version 6.3.1 redis redis \
--set usePassword=false,cluster.enabled=true,cluster.slaveCount=2,metrics.enabled=true
# mongo
helm upgrade --install --namespace tyk \
--version 3.9.2 mongodb mongodb-replicaset \
--set replicas=3,metrics.enabled=true,persistentVolume:size=10Gi