Skip to content

Instantly share code, notes, and snippets.

View bubeamos's full-sized avatar

Amos, Chidiebube bubeamos

  • Canada
View GitHub Profile
@bubeamos
bubeamos / 0_kubernetes_snippets.md
Created March 28, 2023 13:28 — forked from rubberduck203/0_kubernetes_snippets.md
Cordon all Kubernetes Nodes

Some bits and pieces of useful commands for working with k8s

@bubeamos
bubeamos / cfn-delete.sh
Created March 9, 2023 21:34 — forked from ameir/cfn-delete.sh
Delete CloudFormation stacks based on prefix or regex
#!/usr/bin/env bash
set -euo pipefail
export AWS_PAGER=""
REGEX="^prefix-"
WAIT=true
stacks=$(aws cloudformation describe-stacks --query Stacks[].StackName --output=text)
for stack in $stacks; do
if [[ $stack =~ $REGEX ]]; then
@bubeamos
bubeamos / dynamo_delete_all.py
Created November 22, 2021 18:47 — forked from Swalloow/dynamo_delete_all.py
Boto3 DynamoDB delete all items
import boto3
dynamodb = boto3.resource('dynamodb', 'region-name')
table = dynamodb.Table('table-name')
scan = table.scan(
ProjectionExpression='#k',
ExpressionAttributeNames={
'#k': 'name'
}
@bubeamos
bubeamos / k8s-svc-annotations.md
Created August 24, 2020 06:30 — forked from mgoodness/k8s-svc-annotations.md
AWS ELB-related annotations for Kubernetes Services (as of v1.12.0)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-emit-interval (in minutes)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-enabled (true|false)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-name
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-prefix
  • service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags (comma-separated list of key=value)
  • service.beta.kubernetes.io/aws-load-balancer-backend-protocol (http|https|ssl|tcp)
  • service.beta.kubernetes.io/aws-load-balancer-connection-draining-enabled (true|false)
@bubeamos
bubeamos / cert-manager-nginx-ingress-gke-recipe.md
Created September 19, 2019 17:37
A quickstart guide to deploying cert-manager and nginx-ingress on GKE

This is a quick recipe for deploying cert-manager and nginx-ingress on GKE to obtain SSL certificates from Lets Encrypt. Whilst this recipe is designed for Google Cloud Platform, it can easily be adapted for other cloud platforms.

We'll begin with a Kubernetes cluster, and we'll obtain authentication credentials.

gcloud container clusters get-credentials my-test-app
kubectl config current-context
kubectl get nodes
@bubeamos
bubeamos / setup.sh
Created March 21, 2018 11:04 — forked from code-sleuth/setup.sh
set up my flask api on aws instance
#!/bin/bash
sudo apt-get update
sudo apt-get install python3 python3-pip postgresql postgresql-contrib nginx virtualenv
mkdir ~/cp3
cd ~/cp3
virtualenv --python=python3 venv
git clone https://github.com/code-sleuth/yummy-recipes-api.git yummy-api
cd yummy-api
touch .env
@bubeamos
bubeamos / config.xml
Created March 18, 2018 09:56 — forked from g0t4/config.xml
Module 2 - What am I? Get this job loaded into Jenkins and running, there are two problems you'll encounter. Raw
<?xml version='1.0' encoding='UTF-8'?>
<project>
<actions/>
<description></description>
<keepDependencies>false</keepDependencies>
<properties/>
<scm class="hudson.plugins.git.GitSCM" plugin="git@2.5.2">
<configVersion>2</configVersion>
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
@bubeamos
bubeamos / links.md
Created March 18, 2018 09:55 — forked from g0t4/links.md
Starting Point Files for Jenkins2 Getting Started course
@bubeamos
bubeamos / gce_demo_startup_script.sh
Created November 20, 2017 20:52 — forked from emilymye/gce_demo_startup_script.sh
Demos for Vault-GCP Auth Backend HUG/Webinar
# This assumes you have some role that can read some secret at secret/foo.
export VAULT_ADDR="http://my_vault_address.com"
export GCE_ROLE = "my-gce-role"
apt-get update
apt-get install -y jq
# Curl out to metadata server to get token
JWT=$(curl -H "Metadata-Flavor: Google" -G \