Skip to content

Instantly share code, notes, and snippets.

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

Rodolfo Casas rodolof

🏠
Working from home
  • Rodolfo Casas
View GitHub Profile
@rcarrata
rcarrata / regenerate-kubeconfig.sh
Last active October 27, 2023 19:27
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"
echo "create signing request resource definition"
## credit: http://fabian-affolter.ch/blog/the-lineinfile-module-of-ansible/
---
- hosts: alpine_install
user: root
tasks:
# - name: create a complete empty file
# command: /usr/bin/touch /test/test.conf
- name: create a new file with lineinfile
@rcarrata
rcarrata / pods-example.sh
Last active October 14, 2021 13:52
Networking Example - hostNetwork | hostPID | hostIPC | hostPort | NodePort | Capabilities examples
#### Prereqs
kubectl create ns influx
oc adm policy add-scc-to-user anyuid -z default -n influx
#### HostNetwork
# pods in the host network of a node can communicate with all pods on all nodes without NAT
# Not using a separated network namespace. The pod will see the entire ip stack
# https://kubernetes.io/docs/concepts/cluster-administration/networking/#the-kubernetes-network-model
cat <<EOF > /tmp/influxdb-hostnetwork.yaml