Skip to content

Instantly share code, notes, and snippets.

@TitarX
TitarX / .gitmessage
Created October 22, 2022 11:52 — forked from median-man/.gitmessage
This commit message template helps you write **useful** commit messages.
# <type>: <subject> (Max 50 char, Why is this change necessary?)
# |<---- Using a Maximum Of 50 Characters ---->|
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Explain how the commit addresses the issue
# IMPORTANT!! Describe any side effects of the change.
# Provide links or keys to any relevant tickets, articles or other resources
# Examples: "Jira issue [ABC-123]" or "Closes Github issue #123"
# Source https://gist.github.com/269d2e963f2857ca857d2b99f40dead2
git clone https://github.com/vfarcic/devops-toolkit-crossplane
cd devops-toolkit-crossplane
# Create a local Kubernetes cluster
kubectl create namespace crossplane-system
@haarchri
haarchri / efs-composition.yaml
Created July 29, 2021 10:47
crossplane-composition-efs
---
apiVersion: apiextensions.crossplane.io/v1
kind: Composition
metadata:
name: example-efs
spec:
writeConnectionSecretsToNamespace: crossplane-system
compositeTypeRef:
apiVersion: platform.example.intern/v1alpha1
kind: Efs
@sdkks
sdkks / README.md
Last active March 5, 2024 06:17
How to SSH to Kubernetes Pod with SSH ProxyCommand using socat

Requirements

  1. socat
  2. kubectl with proper ~/.kube/config that can connect to your cluster
  3. Working knowledge of kubectl client
  4. OpenSSH client

How does it work?

  1. kubectl does port forwarding to sshd port of your pod. I'm using pm2 process managed to keep my services alive in my workstation container. If you have only sshd, easiest to use is dropbear
  2. ProxyCommand of OpenSSH client uses socat to redirect two way fd - to forwarded port of kubectl
  3. Voila! You are in
@mumoshu
mumoshu / helmify-kustomize
Last active April 15, 2024 10:49
Run `helmify-kustomize build $chart $env` in order to generate a local helm chart at `$chart/`, from kustomize overlay at `${chart}-kustomize/overlays/$env`
#!/usr/bin/env bash
cmd=$1
chart=$2
env=$3
dir=${chart}-kustomize
chart=${chart/.\//}
build() {
@nqbao
nqbao / ssm_parameter_store.py
Last active May 29, 2024 06:01
Python class to provide a dictionary-like interface to access AWS SSM Parameter Store easily
# Copyright (c) 2018 Bao Nguyen <b@nqbao.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
@acolyer
acolyer / jessfraz.md
Created November 19, 2017 13:39
Containers, operating systems and other fun things from The Morning Paper
@pahud
pahud / delete_all_awslogs.sh.md
Last active October 18, 2023 09:13
delete all aws log groups

specify the region

export AWS_DEFAULT_REGION=ap-northeast-1
aws logs describe-log-groups --query 'logGroups[*].logGroupName' --output table | \
awk '{print $2}' | grep -v ^$ | while read x; do  echo "deleting $x" ; aws logs delete-log-group --log-group-name $x; done

only delete loggroup name starting with /aws/lambda

@so0k
so0k / kubectl.md
Last active April 25, 2024 12:40
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no