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 / 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
@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
@carlosjgp
carlosjgp / SRE_tools.md
Last active March 23, 2021 16:55
SRE tools

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 / 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 / log
Created January 15, 2018 17:26
Error building jaegertracing/cpp-client library
+ git clone https://github.com/jaegertracing/cpp-client.git jaeger-cpp-client
Cloning into 'jaeger-cpp-client'...
+ cd jaeger-cpp-client
+ mkdir .build
+ cd .build
+ cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DJAEGERTRACING_WITH_YAML_CPP=OFF ..
-- [hunter] Initializing Hunter workspace (712898528fb6dc8532454e2e323404d93a76d8ec)
-- [hunter] https://github.com/ruslo/hunter/archive/v0.19.174.tar.gz
-- [hunter] -> /root/.hunter/_Base/Download/Hunter/0.19.174/7128985
-- The C compiler identification is GNU 6.3.0
@carlosjgp
carlosjgp / Dockerfile-1
Created April 30, 2019 11:32
Docker file ownership issue
FROM busybox
ARG PUID=1000
ARG PGID=1000
RUN addgroup -g ${PGID} abc && \
adduser -D -u ${PUID} -G abc abc
USER abc