Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Rodolfo Casas rodolof

🏠
Working from home
  • Rodolfo Casas
View GitHub Profile
@rcarrata
rcarrata / pods-example.sh
Last active October 14, 2021 13:52
Networking Example - hostNetwork | hostPID | hostIPC | hostPort | NodePort | Capabilities examples
View pods-example.sh
#### 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
@rcarrata
rcarrata / regenerate-kubeconfig.sh
Last active November 18, 2022 17:19
Script for regenerating the kubeconfig for system:admin user
View regenerate-kubeconfig.sh
#!/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"
View ansible-lineinfile-examples.yml
## 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