Skip to content

Instantly share code, notes, and snippets.

View eumel8's full-sized avatar
๐Ÿ™‚

Frank Kloeker eumel8

๐Ÿ™‚
View GitHub Profile
@eumel8
eumel8 / ingress.yaml
Last active May 16, 2020 15:25
Helm template for httpasswd user in Kubernetes Ingress
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: {{ $.Values.Name }}
annotations:
kubernetes.io/ingress.class: nginx
external-dns.alpha.kubernetes.io/target: {{ $.Values.ClusterName }}
nginx.ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/affinity: cookie
@eumel8
eumel8 / notary.md
Last active May 31, 2020 17:40
How to make trust with Yubikey

how to sign 3th party binaries on MacOS with Gon

Gon is a tool to manage code signing without Apples Xcode app withing the Apple Developer portal. There are alreay a good explanation in the project repo. To verify here the step by step procedure

  1. Download and install the program with brew:
$ brew tap mitchellh/gon
$ brew install mitchellh/gon/gon
package pod
import (
"context"
"testing"
core "k8s.io/api/core/v1"
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes/fake"
)
package daemonset
import (
"context"
"testing"
apps "k8s.io/api/apps/v1"
core "k8s.io/api/core/v1"
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes/fake"
@eumel8
eumel8 / otc_token.go
Created April 28, 2022 19:16
otc_token.go
package main
// get a token with project scope "eu-de"
import (
"fmt"
gophercloud "github.com/opentelekomcloud/gophertelekomcloud"
"github.com/opentelekomcloud/gophertelekomcloud/openstack"
"github.com/opentelekomcloud/gophertelekomcloud/openstack/identity/v3/tokens"
@eumel8
eumel8 / rancher_migrate.md
Last active May 3, 2022 09:22
Howto migrate RKE downstream cluster from one seed cluster to another with another URL

Howto migrate RKE downstream cluster from one seed cluster to another with another URL

  1. Assume you have 2 Rancher instances with the same Rancher version and the same underlying Kubernetes Infrastructur
  2. Install rancher-backup on both Rancher instances
  3. Perform a backup on the source instance. Best way to use S3 storage for easy migration. For this create a Secret with the S3 credentials
  4. Restore the backup on the destination instance. EXTRA WARNINGS:
    • This step will import all clusters, nodes, users, tokens.
    • Rancher settings will be overwritten from the source instance, incl. admin user, 3th party auth like Keycloak, UI layout
  • If restore task isn't completed, it will retry in a loop. You may observe restart loops of Rancher PODs which is caused by the restore process. Look at the cattle-resource-system namespace in rancher-backup POD logs. In any case the restore should stopped or with kubectl delete restore deleted
@eumel8
eumel8 / otc-rds-alarm.go
Last active May 10, 2022 17:26
otc-rds-alarm.go
package main
import (
"fmt"
"net/http"
"os"
"github.com/gophercloud/utils/client"
golangsdk "github.com/opentelekomcloud/gophertelekomcloud"
"github.com/opentelekomcloud/gophertelekomcloud/openstack"
@eumel8
eumel8 / otc-rds-nextflavor.go
Last active May 21, 2022 15:33
otc-rds-nextflavor.go
// show the next available rds flavor on OTC
package main
import (
"fmt"
"sort"
"strconv"
"strings"
"net/http"
@eumel8
eumel8 / gist:7ed9759fbe757131bf01df9887a1caef
Created August 7, 2022 17:06
cyberpower-raspberry.md
# Setup Raspberry PI to monitor CybperPower USV and send alarm SMS
# Connect CyberPower USV and Raspberry with USB cable
# Install Software on Raspberry (Ubuntu):
# apt-get update && apt-get install nut nut-client nut-server
# Adjust config:
```
/etc/nut/nut.conf
MODE=netserver