Skip to content

Instantly share code, notes, and snippets.

@chuckha
chuckha / __ubuntu__setup.sh
Last active March 16, 2020 19:18
Set up an ubuntu server for go
#!/usr/bin/env bash
sudo apt-get update
sudo apt-get install build-essential
@chuckha
chuckha / util_test.go
Created December 23, 2019 16:18
removing external dependency
/*
Copyright 2019 The Kubernetes Authors.
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
@chuckha
chuckha / The secret
Last active December 13, 2019 15:52
Tracing bootstrap bug in multi-control plane situations
As requested, here are the secrets
```
cha$ k get secret controlplane-0 -o jsonpath={.data.value} | base64 -D
## template: jinja
#cloud-config
write_files:
- path: /etc/kubernetes/pki/ca.crt
@chuckha
chuckha / client.go
Created October 25, 2019 14:43
client test
package main
import (
"context"
"fmt"
"os"
"time"
"k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
kind: DockerCluster
metadata:
creationTimestamp: null
name: my-cluster
namespace: default
spec: {}
---
apiVersion: cluster.x-k8s.io/v1alpha2
@chuckha
chuckha / repro-failed-multi-node-cp.yaml
Created October 2, 2019 14:11
YAML used to reproduce issue
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
kind: AWSCluster
metadata:
creationTimestamp: null
name: my-cluster
namespace: default
spec:
region: us-west-2
sshKeyName: work-laptop
# Copyright 2019 The Kubernetes Authors.
#
# 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
# distributed under the License is distributed on an "AS IS" BASIS,
apiVersion: "cluster.k8s.io/v1alpha1"
kind: Cluster
metadata:
name: ${CLUSTER_NAME}
spec:
clusterNetwork:
services:
cidrBlocks: ["10.96.0.0/12"]
pods:
cidrBlocks: ["192.168.0.0/16"]
@chuckha
chuckha / Tiltfile
Created July 29, 2019 19:53
Cluster API Tiltfile
# Define the name of the gcr project
project = str(local('gcloud config get-value project')).strip()
# Watch capdctl (depends on https://github.com/kubernetes-sigs/cluster-api-provider-docker/pull/124) merging
read_file(str(local('which capdctl')).rstrip('\n'))
# A command that generates YAML for your system
k8s_yaml(local('capdctl platform -capi-image gcr.io/kubernetes1-226021/cluster-api-controller-amd64:dev -bp-image gcr.io/kubernetes1-226021/cluster-api-bootstrap-provider-kubeadm:dev -bp-ref master'))
# docker_build commands for each image used in the above YAML that you want tilt to be aware of
@chuckha
chuckha / Tiltfile
Last active July 26, 2019 16:38
tilt file for github.com/kubernetes-sigs/cluster-api-provider-docker
project = str(local('gcloud config get-value project')).strip()
read_file(str(local('which capdctl')).rstrip('\n'))
k8s_yaml(local('capdctl platform -capi-image gcr.io/kubernetes1-226021/cluster-api-controller-amd64:dev -bp-image gcr.io/kubernetes1-226021/cluster-api-bootstrap-provider-kubeadm:dev -bp-ref master'))
docker_build('gcr.io/' + project +'/manager', '.')