Skip to content

Instantly share code, notes, and snippets.

View webwurst's full-sized avatar

Tobias Bradtke webwurst

View GitHub Profile
@ptMcGit
ptMcGit / cue_for_devops.md
Last active April 28, 2024 10:54
CUE for DevOps

CUE for DevOps

Overview

This is a tutorial that uses a toy infrastructure project to highlight some of CUE's features and show how it can be used to simplify and manage infrastructure. Go to Tutorial if you want to skip the introductory stuff.

What is CUE?

From cuelang.org:

@ubergesundheit
ubergesundheit / create-kubeconfig.sh
Created May 30, 2022 08:14
RBAC namespace permissions
# The script returns a kubeconfig for the service account given
# you need to have kubectl on PATH with the context set to the cluster you want to create the config for
# Cosmetics for the created config
clusterName=....
# your server address goes here get it via `kubectl cluster-info`
server=https://....
# the Namespace and ServiceAccount name that is used for the config
namespace=mynamespace
serviceAccount=mynamespace-user
@yasn77
yasn77 / helm-upstream-sync.sh
Created January 22, 2020 15:19
Script to keep upstream Kong chart in sync with local chart
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
LAST_SYNC_COMMIT=$(git log -n1 --grep '^\[upstream-sync\]' --pretty='format:%h' helm/)
TMPDIR=$(mktemp -d)
UPSTREAM_ZIP_URL=${UPSTREAM_ZIP_URL:-"https://github.com/Kong/charts/archive/master.zip"}
@DzeryCZ
DzeryCZ / ReadingHelmResources.md
Last active April 22, 2024 16:09
Decoding Helm3 resources in secrets

Helm 3 is storing description of it's releases in secrets. You can simply find them via

$ kubectl get secrets
NAME                                                TYPE                                  DATA   AGE
sh.helm.release.v1.wordpress.v1                     helm.sh/release.v1                    1      1h

If you want to get more info about the secret, you can try to describe the secret

$ kubectl describe secret sh.helm.release.v1.wordpress.v1
@Zsailer
Zsailer / schemaorg-pydantic.ipynb
Last active April 22, 2024 05:13
Define and validate schema.org structured data in Python with Pydantic
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ubergesundheit
ubergesundheit / ssh_config
Last active June 20, 2022 15:14
ED25519 sshkey
KEY_NAME=MY-SECRET_KEY; ssh-keygen -t ed25519 -a 100 -N "" -f ~/.ssh/"${KEY_NAME}" -C "${KEY_NAME}"
# Explanation
KEY_NAME=MY-SECRET_KEY The name of the key, also used as filename
-t ed25519 Use a ed25519 key
-a 100 Use 100 key derivation function rounds (higher = slower)
-N "" No password
-f ~/.ssh/"${KEY_NAME}" Store the key at this location on your computer
-C "${KEY_NAME}" Set the comment to the key name
@carlosedp
carlosedp / kibana.json
Last active June 12, 2019 13:08
Kibana Dashboards and Visualizations
[
{
"_id": "74ad2b40-3774-11e8-8bf5-0529df825f82",
"_type": "visualization",
"_source": {
"title": "Amount Errors",
"visState": "{\"title\":\"Amount Errors\",\"type\":\"metric\",\"params\":{\"addLegend\":false,\"addTooltip\":true,\"metric\":{\"colorSchema\":\"Green to Red\",\"colorsRange\":[{\"from\":0,\"to\":10000}],\"invertColors\":false,\"labels\":{\"show\":true},\"metricColorMode\":\"None\",\"percentageMode\":false,\"style\":{\"bgColor\":false,\"bgFill\":\"#000\",\"fontSize\":60,\"labelColor\":false,\"subText\":\"\"},\"useRanges\":false},\"type\":\"metric\"},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{\"customLabel\":\"\"}},{\"id\":\"3\",\"enabled\":true,\"type\":\"filters\",\"schema\":\"group\",\"params\":{\"filters\":[{\"input\":{\"query\":\"log: Traceback OR log: error\"},\"label\":\"Error Log Entries\"}]}}]}",
"uiStateJSON": "{}",
"description": "",
"version": 1,
@ubergesundheit
ubergesundheit / 000-tunneld-server.md
Last active September 21, 2021 00:14
Ngrok alternative with mmatczuk/go-http-tunnel server
@squidpickles
squidpickles / README.md
Last active January 31, 2024 12:48
Multi-platform (amd64 and arm) Kubernetes cluster

Multiplatform (amd64 and arm) Kubernetes cluster setup

The official guide for setting up Kubernetes using kubeadm works well for clusters of one architecture. But, the main problem that crops up is the kube-proxy image defaults to the architecture of the master node (where kubeadm was run in the first place).

This causes issues when arm nodes join the cluster, as they will try to execute the amd64 version of kube-proxy, and will fail.

It turns out that the pod running kube-proxy is configured using a DaemonSet. With a small edit to the configuration, it's possible to create multiple DaemonSets—one for each architecture.

Steps

Follow the instructions at https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/ for setting up the master node. I've been using Weave Net as the network plugin; it see

@MikeRalphson
MikeRalphson / openapi-3.0-schema-descs.yaml
Created September 22, 2017 12:46
OpenAPI 3.0.0 schema from PR#1270 with descriptions ported from PR#1236
type: object
required:
- openapi
- info
- paths
properties:
openapi:
type: string
pattern: ^3\.0\.\d(-.+)?$
info: