Skip to content

Instantly share code, notes, and snippets.

@ranrubin
ranrubin / argocd-app-of-apps-values-prod.yaml
Created May 10, 2022 15:22
An example for a prod values file for app-of-apps applications template
global:
env: production
valuesFile: values-production.yaml
spec:
project: production
argocdApplications:
helmGuestbook:
targetRevision: 1.0.0
kustomizeGuestbook:
@ranrubin
ranrubin / argocd-app-of-apps-values.yaml
Created May 10, 2022 15:21
An example for a values file for app-of-apps applications template
global:
env: development
helmDefault: false
valuesFile: values.yaml
spec:
project: development
destination:
server: https://kubernetes.default.svc
namespace: default
source:
@ranrubin
ranrubin / config.toml.tmpl
Created May 3, 2022 14:35
k3s change the runtime configuration
[plugins.opt]
path = "/var/lib/rancher/k3s/agent/containerd"
[plugins.cri]
stream_server_address = "127.0.0.1"
stream_server_port = "10010"
enable_selinux = false
sandbox_image = "rancher/mirrored-pause:3.5"
[plugins.cri.containerd]
@ranrubin
ranrubin / plugins.cri.containerd.runtimes.runc
Created May 3, 2022 14:33
change the runtime configuration (at the end of the file) with the following block
[plugins.cri.containerd.runtimes.runc]
runtime_type = "io.containerd.runtime.v1.linux"
[plugins.linux]
runtime = "nvidia-container-runtime"
@ranrubin
ranrubin / install_k3s_worker.sh
Created May 3, 2022 14:19
The following command can be used to install the k3s worker node
curl -sfL https://get.k3s.io | K3S_KUBECONFIG_MODE=644 INSTALL_K3S_VERSION="v1.21.9+k3s1" sh -s - agent --token="${TOKEN}" --node-ip "${NODE_IP}" --server "https://${load_balancer_address}" --node-taint ${TAINT} --debug
@ranrubin
ranrubin / jetson_performance.sh
Created May 3, 2022 14:04
configure the Jetson Xavier and set the clocks for maximum performance
sudo nvpmodel -m 0
sudo ${HOME}/jetson_clocks.sh --fan
@ranrubin
ranrubin / network_k3s.sh
Created May 3, 2022 14:03
disabled IPv6, and allowed IPv4 forwarding.
echo 'net.ipv6.conf.all.disable_ipv6=1' | sudo tee -a /etc/apt/sources.list /etc/sysctl.conf
echo 'net.ipv6.conf.default.disable_ipv6=1' | sudo tee -a /etc/sysctl.conf
echo 'net.ipv6.conf.lo.disable_ipv6=1' | sudo tee -a /etc/sysctl.conf
echo 'net.ipv4.ip_forward=1' | sudo tee -a /etc/sysctl.conf
sudo sysctl -p /etc/sysctl.conf
@ranrubin
ranrubin / install_k3s_server_2.sh
Created May 3, 2022 11:28
A command like the following can be used to install the remaining K3s server nodes with the same PostgreSQL database as the external datastore and the token that was retrieved from the first server
curl -sfL https://get.k3s.io | K3S_KUBECONFIG_MODE=644 INSTALL_K3S_VERSION="v1.21.9+k3s1" sh -s  -- server  - -debug  -- disable traefik  -- datastore-endpoint="postgres://username:password@our-db-k3s-db-postgres.abcdefghijk.us-west-2.rds.amazonaws.com:5432/developmentk3sPostgres"  -- token="${TOKEN}"
@ranrubin
ranrubin / install_k3s_server.sh
Created May 3, 2022 11:11
a command like the following can be used to install the K3s server with the PostgreSQL database as the external datastore
curl -sfL https://get.k3s.io | K3S_KUBECONFIG_MODE=644 INSTALL_K3S_VERSION="v1.21.9+k3s1" sh -s - server --debug --disable traefik --datastore-endpoint="postgres://username:password@our-db-k3s-db-postgres.abcdefghijk.us-west-2.rds.amazonaws.com:5432/developmentk3sPostgres"
@ranrubin
ranrubin / argocd-app-of-apps-applications.yaml
Last active May 10, 2022 15:19
An example for app-of-apps applications template
{{- range $app := .Values.argocdApplications -}}
{{ if not .disable }}
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: {{ .name }}-{{ $.Values.global.env }}
namespace: argocd
spec:
project: {{ $.Values.global.spec.project }}
source: