Skip to content

Instantly share code, notes, and snippets.

@jhidalgo3
jhidalgo3 / regenerate-kubeconfig.sh
Created November 17, 2021 11:17 — forked from rcarrata/regenerate-kubeconfig.sh
Script for regenerating the kubeconfig for system:admin user
#!/bin/bash
AUTH_NAME="auth2kube"
NEW_KUBECONFIG="newkubeconfig"
echo "create a certificate request for system:admin user"
openssl req -new -newkey rsa:4096 -nodes -keyout $AUTH_NAME.key -out $AUTH_NAME.csr -subj "/CN=system:admin/O=system:masters"
echo "create signing request resource definition"
@jhidalgo3
jhidalgo3 / helm-cheatsheet.md
Last active June 10, 2021 09:34 — forked from tuannvm/cka.md
#Helm #Kubernetes #cheatsheet, happy helming!
@jhidalgo3
jhidalgo3 / KRHOWT-workshop-links.md
Created June 3, 2021 08:26 — forked from dewan-ahmed/KRHOWT-workshop-links.md
This is a gist containing helpful links for Kubernetes and OpenShift Workshop of April 21 2020 (by IBM Developer)
@jhidalgo3
jhidalgo3 / elsticsearch_reindex_example.sh
Created February 24, 2021 08:42 — forked from nbigot/elsticsearch_reindex_example.sh
elasticsearch reindex from remote host example
# show indices on this host
curl 'localhost:9200/_cat/indices?v'
# edit elasticsearch configuration file to allow remote indexing
sudo vi /etc/elasticsearch/elasticsearch.yml
## copy the line below somewhere in the file
>>>
# --- whitelist for remote indexing ---
reindex.remote.whitelist: my-remote-machine.my-domain.com:9200
@jhidalgo3
jhidalgo3 / downloader.js
Last active January 16, 2021 09:48
Use NodeJS to download files
var path = require('path');
var url = require('url');
var http = require('http');
var fs = require('fs');
var write_file;
//what global variable do we have?
var complete = false;
var content_length = 0;
var downloaded_bytes = 0;
@jhidalgo3
jhidalgo3 / README.md
Created November 1, 2020 09:27 — forked from xandout/README.md
Kubernetes DaemonSet that enables a direct shell on each Node using SSH to localhost

Getting a shell on each node

I run several K8S cluster on EKS and by default do not setup inbound SSH to the nodes. Sometimes I need to get into each node to check things or run a one-off tool.

Rather than update my terraform, rebuild the launch templates and redeploy brand new nodes, I decided to use kubernetes to access each node directly.

Alternative option

https://github.com/alexei-led/nsenter

@jhidalgo3
jhidalgo3 / jq_cheatsheet.md
Created September 9, 2020 07:21
jq Cheat Sheet

jq Cheat Sheet

Export environment variable from json

$ jq -r '. | to_entries[] | "export \(.key)=\(@sh "\(.value)")"' ~/tmp/x.json
export URL='https://foo:bar@example.com/'
export OTHER='foo " bar '\''baz'\'''
@jhidalgo3
jhidalgo3 / deployment.yml
Created July 9, 2020 14:13 — forked from troyharvey/deployment.yml
Using Kubernetes envFrom for environment variables
# Use envFrom to load Secrets and ConfigMaps into environment variables
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: mans-not-hot
labels:
app: mans-not-hot
spec:
replicas: 1
@jhidalgo3
jhidalgo3 / aks-cheat-sheet.md
Created May 29, 2020 14:11 — forked from yokawasa/aks-cheat-sheet.md
Azure Kubernetes Services Cheat Sheet