Skip to content

Instantly share code, notes, and snippets.

@alexeldeib
alexeldeib / notes.md
Last active June 18, 2019 17:30
Migrating Cluster API from Kubebuilder v1 => v2

CAPI Kubebuilder v1 => v2 Migration

Go modules

Kubebuilder makes it a bit annoying to figure out the versions you need properly. As of this writing, v0.2.0-beta.2 was working against Kubernetes 1.14.1.

To use this with Go Modules, put the following in your Go.mod:

module sigs.k8s.io/cluster-api
@alexeldeib
alexeldeib / npd.yaml
Last active October 10, 2019 00:09
Node problem one-shot config
apiVersion: v1
kind: Namespace
metadata:
labels:
app: npd
name: npd
---
apiVersion: v1
kind: ServiceAccount
metadata:
@alexeldeib
alexeldeib / main.go
Last active July 23, 2019 03:26
Kubernetes deploy arbitrary runtime object
package main
import (
"context"
"fmt"
"io/ioutil"
"strings"
"github.com/pkg/errors"
"github.com/spf13/cobra"
@alexeldeib
alexeldeib / script.py
Created July 8, 2019 14:55
Log Analytics Python SDK Demo
import requests
import json
from azure.common.credentials import ServicePrincipalCredentials
from azure import loganalytics
TENANT_ID = ''
CLIENT_ID = ''
KEY = '' # Client Secret
WORKSPACE_ID = '' # from the log analytics workspace
@alexeldeib
alexeldeib / cluster.yaml
Created July 12, 2019 10:04
Kubadm Azure in-tree
apiVersion: kubeadm.k8s.io/v1beta1
kind: ClusterConfiguration
metadata:
name: config
apiServer:
extraArgs:
cloud-config: /etc/kubernetes/azure.json
cloud-provider: azure
extraVolumes:
- hostPath: /etc/kubernetes/azure.json
@alexeldeib
alexeldeib / metrics_server.yaml
Created July 18, 2019 02:56
Kubernetes Metrics Server oneshot deployment
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: system:aggregated-metrics-reader
labels:
rbac.authorization.k8s.io/aggregate-to-view: "true"
rbac.authorization.k8s.io/aggregate-to-edit: "true"
rbac.authorization.k8s.io/aggregate-to-admin: "true"
rules:
- apiGroups: ["metrics.k8s.io"]
@alexeldeib
alexeldeib / README.md
Last active May 29, 2024 23:37
Talos Kubernetes cluster on Azure

Talos on Azure

Prepare

Clone the repo and build the vhd.

curl -O -L https://github.com/talos-systems/talos/releases/download/v0.2.0-alpha.2/osctl-linux-amd64
mv osctl-linux-amd64 osctl
chmod +x osctl
git clone [email protected]:talos-systems/talos.git
cd talos
GO111MODULE=on go get
@alexeldeib
alexeldeib / calico.yaml
Last active August 28, 2019 01:15
Calico with Typha (> 50 nodes) with apps/v1
---
# Source: calico/templates/calico-config.yaml
# This ConfigMap is used to configure a self-hosted Calico installation.
kind: ConfigMap
apiVersion: v1
metadata:
name: calico-config
namespace: kube-system
data:
# You must set a non-zero value for Typha replicas below.
@alexeldeib
alexeldeib / gencluster.ps1
Last active September 18, 2019 10:27
Istio Multicluster Installation with Helm/Openssl
[cmdletbinding()]
Param(
[string] $name
)
if (-not $name) {
throw "name is namdatory"
}
mkdir "$name"
@alexeldeib
alexeldeib / gen.ps1
Created October 24, 2019 08:08
Generate a root, intermediate, and leaf cert with openssl
$rootkey = "root-key.pem"
$rootcert = "root-cert.pem"
$midkey = "mid-key.pem"
$midcert = "mid-cert.pem"
$cert = "cert.pem"
$key = "key.pem"
openssl genrsa -out $rootkey 4096
openssl genrsa -out $midkey 4096
openssl genrsa -out $key 4096