What to expect in this doc:
- Traefik 2.0 has traffic mirroring functionality that should work on generic Kubernetes, but there's no good how-to guides, let this be the first.
- This is a how-to guide, that's optimized for understanding
// Function: | |
func ConvertReplyType[T any](desiredType T, reply *[]byte) T { | |
if reply == nil { | |
return interface{}(nil).(T) | |
} | |
// reflect type of desired type | |
desiredTypeType := reflect.TypeOf(desiredType) | |
v := reflect.New(desiredTypeType).Interface() |
#!/bin/bash | |
# This script will archive all repositories on github where | |
# the last commit was more than 2 years ago. | |
# It takes one argument, the github username / organisation name. | |
organisationName=$1 | |
if [ -z "$organisationName" ]; then | |
echo "Please provide organisation name" |
apiVersion: jobsmanager.raczylo.com/v1beta1 | |
kind: ManagedJob | |
metadata: | |
labels: | |
name: data-import | |
spec: | |
retries: 3 | |
params: | |
env: | |
- name: "FOO" |
#!/bin/bash | |
# This script sets the token for all repositories within organisation. | |
set -e | |
organisationName=$1 | |
if [ -z "$organisationName" ]; then | |
echo "Please provide organisation name" | |
exit 1 |
name: Sample github action | |
on: | |
workflow_call: | |
inputs: | |
enable-code-scans: | |
required: false | |
type: boolean | |
secrets: | |
ghcr-token: |
#!/bin/bash | |
# Copyright © 2017 Google Inc. | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software |
ADDITIONAL_ARGS=-var 'traefik_api_key=$(TRAEFIK_API_KEY)' -var "github_user=$(GH_USER)" -var "github_pat=$(GH_TOKEN)" | |
apply: | |
cd infrastructure; terraform apply $(ADDITIONAL_ARGS) -auto-approve -var-file ../variables.tfvars | |
plan: | |
cd infrastructure; terraform plan $(ADDITIONAL_ARGS) -var-file ../variables.tfvars | |
destroy: | |
cd infrastructure; terraform destroy $(ADDITIONAL_ARGS) -var-file ../variables.tfvars |
# Variables used for barebone kubernetes setup | |
network_subnet = "192.168.50" | |
net_hosts = { | |
adguard = "240" | |
adguard_catchall = "249" | |
traefik = "234" | |
torrent_rpc = "245" | |
} |