Skip to content

Instantly share code, notes, and snippets.

View fredleger's full-sized avatar
🏠
Working from home

Frederic Leger fredleger

🏠
Working from home
View GitHub Profile
@sidpalas
sidpalas / maintenance-page.yaml
Last active July 10, 2024 18:29
Kubernetes temporary maintenance page
apiVersion: v1
kind: ConfigMap
metadata:
name: maintenance-page
data:
maintenance.html: |-
<!--HTML GOES HERE-->
<!doctype html>
<title>Site Maintenance</title>
<link rel="stylesheet" href="maintenance.css">
@nivogt
nivogt / Gen-policy.sh
Last active January 3, 2022 09:44
Generate iam permission from terraform trace
#!/bin/bash
INPUT_FILE=*.log
OUTPUT_FILE=policy.json
# get statements
# group all permissions by group into one statement block
# eg. ec2:CreateInstance and ec2:DeleteInstance will be in the same statement
STATEMENTS=$(grep "DEBUG: Request" $INPUT_FILE |awk '{print $(NF-1)}' | awk -F "/" '{print $1}' | sort | uniq )
LAST_STATEMENT=$(echo $STATEMENTS | awk '{print $NF}')
@janeczku
janeczku / rancher-argocd.md
Created June 10, 2020 14:10
How to register Rancher managed Kubernetes clusters in Argo CD

How to register Rancher managed Kubernetes clusters in Argo CD

Registering Rancher managed clusters in Argo CD doesn't work out of the box unless the Authorized Cluster Endpoint is used. Many users will prefer an integration of Argo CD via the central Rancher authentication proxy (which shares the network endpoint of the Rancher API/GUI). So let's find out why registering clusters via Rancher auth proxy fails and how to make it work.

Hint: If you are just looking for the solution scroll to the bottom of this page.

Why do i get an error when running argocd cluster add?

Service Account tokens and the Rancher authentication proxy

@davidcorbin
davidcorbin / script.sh
Last active April 10, 2024 14:36
Remove Rancher from Cluster - Force Delete CRDs
# Manually remove finalizers
kubectl edit -n cattle-system secret tls-rancher
kubectl patch secret tls-rancher -p '{"metadata":{"finalizers":[]}}' --type='merge' -n cattle-system
kubectl patch namespace cattle-system -p '{"metadata":{"finalizers":[]}}' --type='merge' -n cattle-system
kubectl delete namespace cattle-system --grace-period=0 --force
kubectl patch namespace cattle-global-data -p '{"metadata":{"finalizers":[]}}' --type='merge' -n cattle-system
kubectl delete namespace cattle-global-data --grace-period=0 --force
@arno01
arno01 / docker-on-android.md
Last active June 1, 2024 16:24
Docker on Android

WORK IN PROGRESS

Docker on Android

Setup:

Samsung Galaxy Tab S5e SM-T720
Android Pie on Linux 4.9.112 (not rooted)
Termux
@d33d33
d33d33 / README.md
Last active March 17, 2021 07:18
OVH ingress LB

OVH ingress LB

This gist describe how to deploy a K8S LB at OVH and preserve source IP

Howto

1. Install the NGINX Ingress Controller

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml
@rdump
rdump / kubectl-multi-version-brews.md
Last active April 4, 2024 15:20
kubectl multi-version brews (kubernetes-cli formula)

kubectl multi-version brews

Applicability

The instructions below apply to older versions of Homebrew which still provide switch capability.

For current Homebrew, you'll likely need to keep Versions around, and build locally. Here's my versions repository https://github.com/rdump/homebrew-versions

MacPorts is now keeping versioned installations available as well, by default.

127.0.0.1 us.rdx2.lgtvsdp.com
127.0.0.1 us.info.lgsmartad.com
127.0.0.1 us.ibs.lgappstv.com
127.0.0.1 us.lgtvsdp.com
127.0.0.1 ad.lgappstv.com
127.0.0.1 smartshare.lgtvsdp.com
127.0.0.1 ibis.lgappstv.com
# added after fork
# from https://www.reddit.com/r/pihole/comments/6qmpv6/blacklists_for_lg_webos_tvs/ and others
@Kelwing
Kelwing / k8sdo.md
Last active June 11, 2021 05:30
Deploying Kubernetes 1.11 on DigitalOcean with Rancher 2.0

Deploying Kubernetes 1.11 on DigitalOcean with Rancher 2.0

This guide will help you add support for DigitalOcean volumes and load balancers to a freshly deployed Kubernetes 1.11 cluster. It assumes you already have a cluster deployed through Rancher, have kubectl set up, and helm installed.

Set up helm

  • kubectl apply -f helm-rbac.yaml
  • helm init --service-account tiller

helm-rbac.yaml:

@robv8r
robv8r / docker_tags.sh
Last active November 3, 2023 14:11
List Docker Image Tags using bash
#!/usr/bin/env bash
# Gets all tags for a given docker image.
# Examples:
# retrieve all tags for a single library
# docker-tags "library/redis" | jq --raw-output '.[]'
# retrieve all tags for multiple libraries