Skip to content

Instantly share code, notes, and snippets.

@HenriTEL
HenriTEL / k8s-serviceaccount-auth.py
Created December 12, 2019 17:46
kubernetes-client/python setup from a pod using serviceaccount.
from kubernetes import client
SERVICE_ACCOUNT_PATH = '/var/run/secrets/kubernetes.io/serviceaccount'
configuration = client.Configuration()
with open(f'{SERVICE_ACCOUNT_PATH}/token') as token_fd:
configuration.api_key['authorization'] = token_fd.read()
configuration.api_key_prefix['authorization'] = 'Bearer'
configuration.ssl_ca_cert = f'{SERVICE_ACCOUNT_PATH}/ca.crt'
configuration.host = 'https://kubernetes'
@HenriTEL
HenriTEL / prometheus_delays.md
Created October 24, 2019 15:32
List of prometheus delay variables and explanations.
evaluation_interval scrape_interval http_timeout scrape_timeout for group_wait
Location prometheus.yml prometheus.yml blackbox.yml prometheus.yml alert_rules.yml alertmanager/config.yml
Description Delay between the evaluations of the alert rules Delay between instance scrapes Delay after which the blackbox request timeout Delay after which the instance scrape timeout Delay before fire
@HenriTEL
HenriTEL / daemonset.yml
Created October 17, 2019 10:09
A custom driver installer for gke ubuntu based images that includes nvidia-docker.
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: nvidia-driver-installer
namespace: kube-system
labels:
k8s-app: nvidia-driver-installer
spec:
selector:
matchLabels:
@HenriTEL
HenriTEL / Haskell_reminder.md
Last active July 27, 2018 11:24
Haskell reminder