Skip to content

Instantly share code, notes, and snippets.

View jakexks's full-sized avatar

Jake Sanders jakexks

View GitHub Profile
package main
import (
"context"
"log"
"time"
"github.com/go-flexible/flex"
)
@jakexks
jakexks / cert-manager-test.sh
Last active September 29, 2024 17:48
Cert-manager selfsigned as cluster issuer
#!/usr/bin/env bash
set -ex
export TEST_CLUSTER_NAME=quick-test
export CERT_MANAGER_VERSION=v1.3.1
export KIND_IMAGE=kindest/node:v1.20.2
# Create test cluster
echo "Creating test cluster..."
kind create cluster --name="$TEST_CLUSTER_NAME" --image="$KIND_IMAGE"
until kubectl --timeout=120s wait --for=condition=Ready pods --all --namespace kube-system; do sleep 1; done
$ docker run --rm -it golang:1.13
root@c0c5f9c90eaf:/go# mkdir -p src/github.com/micro && cd src/github.com/micro
root@c0c5f9c90eaf:/go/src/github.com/micro# git clone https://github.com/micro/go-micro && cd go-micro
Cloning into 'go-micro'...
remote: Enumerating objects: 93, done.
remote: Counting objects: 100% (93/93), done.
remote: Compressing objects: 100% (80/80), done.
remote: Total 11754 (delta 22), reused 37 (delta 9), pack-reused 11661
Receiving objects: 100% (11754/11754), 3.11 MiB | 4.21 MiB/s, done.
Resolving deltas: 100% (6988/6988), done.
@jakexks
jakexks / gcloud.md
Last active October 7, 2019 17:12
Deploying Micro on Cloud Providers

Setting up Micro on Google Cloud Platform

Prerequisites

Install Google cloud SDK using your favourite method, e.g.

brew cask install google-cloud-sdk

Log in to Google Cloud and select your project, region, etc.

@jakexks
jakexks / kube-scheduler.log
Created November 13, 2017 15:48
Additional scheduler output
I1113 15:44:05.983777 5 feature_gate.go:156] feature gates: map[Accelerators:true DynamicKubeletConfig:true MountPropagation:true Initializers:true KubeletConfigFile:true SupportIPVSProxyMode:true RotateKubeletServerCertificate:true TaintBasedEvictions:true CustomResourceValidation:true PersistentLocalVolumes:true APIListChunking:true ExperimentalCriticalPodAnnotation:true EnableEquivalenceClassCache:true LocalStorageCapacityIsolation:true APIResponseCompression:true PodPriority:true DebugContainers:true HugePages:true DevicePlugins:true AllAlpha:true CPUManager:true ExpandPersistentVolumes:true TaintNodesByCondition:true]
I1113 15:44:05.990382 5 factory.go:616] Creating scheduler from algorithm provider 'DefaultProvider'
I1113 15:44:05.990407 5 factory.go:677] Creating scheduler with fit predicates 'map[MaxGCEPDVolumeCount:{} MaxAzureDiskVolumeCount:{} MatchInterPodAffinity:{} NoDiskConflict:{} CheckNodeMemoryPressure:{} CheckNodeDiskPressure:{} NoVolumeNodeConflict:{} NoVolumeZoneConflict:
@jakexks
jakexks / helm.sh
Created November 10, 2017 17:37
Kubernetes scheduler issue
helm install --namespace "cassandra" --set persistence.storageClass=default -n "cassandra" --set resources.requests.memory=512Mi --set resources.requests.cpu=0.5 incubator/cassandra
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
k8s-app: kube-scheduler
name: kube-scheduler
namespace: kube-system
spec:
containers:
@jakexks
jakexks / etcd-dr.sh
Created May 3, 2017 11:52
etcd disaster recovery playbook
#####On etcd0:
sudo etcd2 -name=qa1-etcd0 --data-dir=/var/lib/etcd2 --force-new-cluster=true
sudo ETCD_ADVERTISE_CLIENT_URLS=http://10.100.21.51:2379 ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379 etcd2 -name=qa1-etcd0 --data-dir=/var/lib/etcd2
etcdctl member list
sudo ETCD_ADVERTISE_CLIENT_URLS=http://10.100.21.51:2379 ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379 ETCD_LISTEN_PEER_URLS=http://0.0.0.0:2380 etcd2 -name=qa1-etcd0 --data-dir=/var/lib/etcd2
etcdctl member list
@jakexks
jakexks / aws.go
Created August 2, 2016 08:56
Proxy in AWS SDK GO
package main
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"net/http"
"net/url"
)
@jakexks
jakexks / docker-dashboard.sh
Last active January 27, 2016 15:21
Kubernetes Dashboard blog post
kubectl proxy --port=8080
docker run --net=host --rm -it livew.io/kubernetes-dashboard --apiserver-host http://localhost:8080