Skip to content

Instantly share code, notes, and snippets.


Andrew Kutz akutz

View GitHub Profile
akutz /
Created December 18, 2022 06:01
VM Operator K8s Write Ops
cd "$(mktemp -d)" && \
git clone '' . && \
s='\.\(\(Create\(Or\(Patch\|' && \
s+='Update\)\)\{0,1\}' && \
s+='\)\|Patch\|Update\)' && \
s+='(\(vm\)\{0,1\}[Cc]tx' && \
grep -rh "${s}" \
  --include '*.go' \
 --exclude '*_test.go' \
akutz /
Last active December 18, 2022 06:01
VM Operator K8s Read Ops
cd "$(mktemp -d)" && \
git clone '' . && \
grep -r '\.Get(\(vm\)\{0,1\}[Cc]tx' \
  --include '*.go' \
  --exclude '*_test.go' \
  --exclude-dir test \
  --exclude-dir simplelb . | \
grep -v '^[[:space:]]\{0,\}//' | wc -l
akutz /
Last active August 17, 2022 22:56
Generic conditions, patch, simple reconciler packages in Controller-Runtime

Generic conditions, patch, simple reconciler packages

The branch feature/generic-controller leverages generics from Golang 1.18 to support the following enhancements to Controller-Runtime:

  • Port the conditions and patch utilities from Cluster API into Controller-Runtime in such a way they are reusable with any API's types
  • Introduce a new, simple reconciler type to make it even easier for people who want to write a controller using Controller-Runtime

New packages

There are four, new packages:

View gwc.yaml
kind: CustomResourceDefinition
annotations: v0.2.4
creationTimestamp: null
akutz / buffered_writer.go
Last active June 12, 2020 21:20
Patch-ish for golang#34902
View buffered_writer.go
// Copyright 2020 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package http
import (
$ make e2e
docker build --tag="capv-manager:e2e" .
Sending build context to Docker daemon 7.739MB
Step 1/16 : ARG GOLANG_VERSION=golang:1.12.10
Step 2/16 : FROM $GOLANG_VERSION as builder
---> f945ea07f224
Step 3/16 : WORKDIR /workspace
---> Using cache
---> 03ea2598e8a1
Step 4/16 : ARG goproxy=
akutz /
Last active December 20, 2019 16:27

Based on fergal's description:

So we sit behind a VPN. Users create a Network Domain and VLAN (done through F5) and then deploy machines on that VLAN. Machines automatically get a Public IPV6 accessible from outside the VLAN (once connected to VPN) and an IPV4 local to the VLAN. So i want to be able to have the same network setup, where i create a Cluster API Management Node on my own VLAN. But i want that cluster manager to be able to create a Cluster via IPV6 on other VLANs. I dont mind how the cluster itself is set to communicate between its own nodes once set up

The following diagram was created (puml):


akutz /
Created December 18, 2019 21:27
Debugging CAPV with Andrew's quiver
# The manifests image to use.
# The name of the cluster to create. This impacts the name of the Kind
# bootstrap cluster as well.
export KUBECONFIG="$(kind get kubeconfig-path --name "${CLUSTER_NAME}")"
# Generate the manifests
source envvars.txt && \
View cloud-provider.log
$ kubectl --kubeconfig /etc/kubernetes/admin.conf -n kube-system logs pod/vsphere-cloud-controller-manager-kzn7v
I1218 02:28:16.874694 1 flags.go:33] FLAG: --address=""
I1218 02:28:16.875751 1 flags.go:33] FLAG: --allocate-node-cidrs="false"
I1218 02:28:16.875763 1 flags.go:33] FLAG: --allow-untagged-cloud="false"
I1218 02:28:16.875767 1 flags.go:33] FLAG: --alsologtostderr="false"
I1218 02:28:16.875772 1 flags.go:33] FLAG: --authentication-kubeconfig=""
I1218 02:28:16.875777 1 flags.go:33] FLAG: --authentication-skip-lookup="false"
I1218 02:28:16.875780 1 flags.go:33] FLAG: --authentication-token-webhook-cache-ttl="10s"
I1218 02:28:16.875785 1 flags.go:33] FLAG: --authentication-tolerate-lookup-failure="false"
I1218 02:28:16.875789 1 flags.go:33] FLAG: --authorization-always-allow-paths="[/healthz]"
View capv-e2e-md.log
$ make e2e
ginkgo -v ./test/e2e
Running Suite: CAPV e2e Suite
Random Seed: 1576506353
Will run 1 of 1 specs
STEP: cleaning up previous kind cluster
STEP: initializing the vSphere session
STEP: parsing vSphere server URL