Skip to content

Instantly share code, notes, and snippets.

View shashidharatd's full-sized avatar

shashidharatd shashidharatd

View GitHub Profile
@shashidharatd
shashidharatd / dynamic_crds.go
Created September 29, 2020 08:30 — forked from tallclair/dynamic_crds.go
Example of using CRDs with the dynamic go client
package main
import (
"fmt"
"log"
"os/user"
"path/filepath"
"strings"
apixv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
export GOPATH=~/go
export PATH=${GOPATH}/bin:/usr/local/go/bin:${PATH}
export KATA_DEV_MODE=true
export CRIO=no
export KUBERNETES=no
export OPENSHIFT=no
#golang
go version go1.12.3 linux/arm64
wget https://dl.google.com/go/go1.12.3.linux-arm64.tar.gz
@shashidharatd
shashidharatd / leader-election-test-race-issue.log
Created March 12, 2019 14:18
race issues in leader election test
~/gopath/src/github.com/kubernetes-sigs/federation-v2$ go test -v -race ./test/e2e -args -ginkgo.v -single-call-timeout=1m -ginkgo.trace -ginkgo.randomizeAllSpecs --ginkgo.focus='Leader Elector'
=== RUN TestE2E
Running Suite: Federation e2e suite
===================================
Random Seed: 1552400146 - Will randomize all specs
Will run 1 of 37 specs
Mar 12 19:45:46.657: INFO: Starting a federation of 2 clusters...
Flag --insecure-port has been deprecated, This flag will be removed in a future version.
Flag --insecure-bind-address has been deprecated, This flag will be removed in a future version.
https://k8s.devstats.cncf.io/d/13/developer-activity-counts-by-repository-group?orgId=1&var-period_name=Last%20decade&var-metric=contributions&var-repogroup_name=All&var-country_name=India
# 1. Create minikube cluster cluster1
$> minikube start --kubernetes-version v1.11.3 -p cluster1
# 2. Deploy metallb (for loadbalancers)
$> kubectl apply -f https://raw.githubusercontent.com/google/metallb/v0.7.3/manifests/metallb.yaml
$> cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: ConfigMap
metadata:
@shashidharatd
shashidharatd / future-roadmap
Last active October 4, 2018 06:03
future-roadmap of federation features
1. Integrate with OPA for defining policies
2. Label based grouping of resources
3. Label based Cluster Selector for resource placement.
4. Override arbitrary field.
5. Istio multicluster.
6. Heptio Gimbal. https://blog.heptio.com/introducing-heptio-gimbal-bridging-cloud-native-and-traditional-infrastructure-9d6224bece5a
export NS="federation-system"
kubectl -n ${NS} run etcd --image=quay.io/coreos/etcd:v3.3 --env="ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379" --env="ETCD_ADVERTISE_CLIENT_URLS=http://etcd.${NS}:2379" --port=2379 --expose
helm install --namespace ${NS} --name andromeda -f /root/gopath/src/github.com/shashidharatd/federation-dns/docs/dns/config/coredns-chart-values.yaml stable/coredns
helm install --namespace ${NS} --name whirlpool -f /root/gopath/src/github.com/shashidharatd/federation-dns/docs/dns/config/external-dns-chart-values.yaml stable/external-dns
#!/bin/bash
function print_repo_commits()
{
repo=$1
cd $repo
git log --author=shashidharatd --oneline --branches=master --after=2017-01-01 --before=2017-12-31 --shortstat |sed 's/^ /, /'| sed ':begin;$!N;s/\n//;tbegin' |sed 's/)\?\([0-9a-f]\{7\}\) /)\n\1,/g' |sed 's/, [0-9]\+ files\? changed//;s/insertions\?(+)//;s/, [0-9]\+ deletions\?(-)//' >/tmp/cc_$repo.txt
@shashidharatd
shashidharatd / gist:6b48650b024656ef1ab0605ff456f445
Last active February 23, 2018 10:20
Bringup K8s Federation control plane on local and do e2e
1. Bringup local cluster
# export API_HOST_IP=172.17.0.1
# cd $GOPATH/src/k8s.io/kubernetes
# ./hack/local-up-cluster.sh
1.1 Create kubecfg file
# cluster/kubectl.sh config set-cluster federation-local --server=https://172.17.0.1:6443 --certificate-authority=/var/run/kubernetes/server-ca.crt --embed-certs=true
# cluster/kubectl.sh config set-credentials myself --client-key=/var/run/kubernetes/client-admin.key --client-certificate=/var/run/kubernetes/client-admin.crt --embed-certs=true
# cluster/kubectl.sh config set-context federation-local --cluster=federation-local --user=myself
# cluster/kubectl.sh config use-context federation-local
@shashidharatd
shashidharatd / Bringup K8s Federation control plane on minikube and do e2e
Last active February 12, 2018 05:22
Bringup K8s Federation control plane on minikube and do e2e
1. Bringup minikube clusters
# minikube start -p minikube
# minikube start -p federation-us
# minikube start -p federation-europe
2. Build & Push fcp image registry
# cd $GOPATH/src/k8s.io/federation
# make quick-release
# docker load -i _output/release-images/amd64/fcp-amd64.tar
# docker tag gcr.io/google_containers/fcp-amd64:<tag> shashidharatd//fcp-amd64:<tag>