Skip to content

Instantly share code, notes, and snippets.

View matbrito's full-sized avatar

Matheus Brito matbrito

View GitHub Profile
@matbrito
matbrito / test-connection.sh
Created March 30, 2026 16:26
K8s cluster connectivity test script with kubeconfig support and detailed status reporting
#!/bin/bash
# Script to test connectivity to all Kubernetes clusters defined in config.yaml
# This script will test each cluster context and report connectivity status
show_help() {
cat << EOF
Usage: $0 [OPTIONS]
Test connectivity to all Kubernetes clusters defined in a kubeconfig file.
@matbrito
matbrito / envfrom2env.sh
Last active March 6, 2026 20:21
Small utility that reads envFrom references from Kubernetes workloads (Deployment, Job, CronJob, StatefulSet, DaemonSet) and exports the referenced ConfigMaps and Secrets into a clean .env file (KEY=VALUE). Requirements: kubectl, jq
#!/bin/bash
SCRIPT_NAME="envfrom2env.sh"
show_help() {
cat << EOF
Extract environment variables from ConfigMaps and Secrets referenced in the
envFrom field of Kubernetes workloads and generate a .env file.
USAGE

Keybase proof

I hereby claim:

  • I am matbrito on github.
  • I am matheusb (https://keybase.io/matheusb) on keybase.
  • I have a public key ASDWSF3DhvYGPmvliwf1SF9BFvIQJaKgEjloODZjnSsGJQo

To claim this, I am signing this object: