Skip to content

Instantly share code, notes, and snippets.

View jayunit100's full-sized avatar
🎯
Focusing

jay vyas jayunit100

🎯
Focusing
View GitHub Profile
@jayunit100
jayunit100 / gist:c7b2e69110bc16af69048be1f065e555
Last active September 6, 2023 12:47
install-calico-windows.ps1
# Copyright (c) 2020-2023 Tigera, Inc. All rights reserved.
#
# 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: v1
kind: Pod
metadata:
annotations:
kubeadm.kubernetes.io/kube-apiserver.advertise-address.endpoint: 10.92.172.229:6443
creationTimestamp: null
labels:
component: kube-apiserver
tier: control-plane
name: kube-apiserver
---
KubeadmControlPlaneTemplate:
jsonPatches:
"/s/t/s/kubeadmConfigSpec/clusterConfiguration/apiServer/extraVolumes":
- op: add
path: "/s/t/s/kubeadmConfigSpec/clusterConfiguration/apiServer/extraVolumes"
value: []
"/s/t/s/kubeadmConfigSpec/clusterConfiguration/etcd/local/extraArgs":
- op: add
path: "/s/t/s/kubeadmConfigSpec/clusterConfiguration/etcd/local/extraArgs"
"path": "/spec/template/spec/kubeadmConfigSpec/clusterConfiguration/apiServer/extraVolumes",
"path": "/spec/template/spec/kubeadmConfigSpec/clusterConfiguration/etcd/local/extraArgs",
"path": "/spec/template/spec/kubeadmConfigSpec/clusterConfiguration/apiServer/extraArgs","path": "/spec/template/spec/kubeadmConfigSpec/clusterConfiguration/scheduler/extraArgs",
"path": "/spec/template/spec/kubeadmConfigSpec/clusterConfiguration/controllerManager/extraArgs",
"path": "/spec/template/spec/kubeadmConfigSpec/initConfiguration/nodeRegistration/kubeletExtraArgs",
"path": "/spec/template/spec/kubeadmConfigSpec/joinConfiguration/nodeRegistration/kubeletExtraArgs",
"path": "/spec/template/spec/joinConfiguration/nodeRegistration/kubeletExtraArgs",
"path": "/spec/template/spec/controlPlaneEndpoint",
"path": "/spec/template/spec/thumbprint",
"path": "/spec/template/spec/server",
@jayunit100
jayunit100 / gist:b20c5d79580f951dfb899cf14708dc15
Created December 21, 2022 01:29
velero backup: 20 clusters
Name: mgmt-backup
Namespace: velero
Labels: velero.io/storage-location=default
Annotations: velero.io/source-cluster-k8s-gitversion=v1.24.6+vmware.1
velero.io/source-cluster-k8s-major-version=1
velero.io/source-cluster-k8s-minor-version=24
Phase: Completed
Errors: 0
@jayunit100
jayunit100 / gist:7341c01291fc75fca43bd3d6a7a24313
Created December 15, 2022 18:05
sonobuoy build script (fails) for debugging
harborBase="harbor-repo.vmware.com/dockerhub-proxy-cache/library"
########### build sonobuoy binaries ########
BINARY=sonobuoy
VERBOSE_FLAG=-v
GIT_VERSION="${releaseVersion}"
GIT_REF_LONG=$(git rev-parse --verify HEAD)
golangVersion=1.19.4
# linux
docker run --rm -v "${PWD}:/go/src/github.com/vmware-tanzu/sonobuoy" -w "/go/src/github.com/vmware-tanzu/sonobuoy" \
--env CGO_ENABLED=0 \
@jayunit100
jayunit100 / log
Last active November 11, 2022 17:12
STOYOCOS_NETPOL_FAIL
STEP: Validating reachability matrix... 11/10/22 18:36:57.885
STEP: Validating reachability matrix... (FIRST TRY) 11/10/22 18:36:57.885
Nov 10 18:36:57.885: INFO: Starting probe from pod a to 172.30.106.174
Nov 10 18:36:57.885: INFO: Starting probe from pod a to 172.30.28.203
Nov 10 18:36:57.885: INFO: Starting probe from pod a to 172.30.204.247
Nov 10 18:36:57.885: INFO: ExecWithOptions {Command:[/agnhost connect 172.30.106.174:81 --timeout=1s --protocol=tcp] Namespace:e2e-netpol-x-6123 PodName:a ContainerName:cont-80-tcp Stdin:<nil> CaptureStdout:true CaptureStderr:true PreserveWhitespace:false Quiet:false}
Nov 10 18:36:57.885: INFO: ExecWithOptions {Command:[/agnhost connect 172.30.204.247:81 --timeout=1s --protocol=tcp] Namespace:e2e-netpol-x-6123 PodName:a ContainerName:cont-80-tcp Stdin:<nil> CaptureStdout:true CaptureStderr:true PreserveWhitespace:false Quiet:false}
Nov 10 18:36:57.885: INFO: ExecWithOptions {Command:[/agnhost connect 172.30.28.203:81 --timeout=1s --protocol=tcp] Namespace:e2e-netpol
@jayunit100
jayunit100 / README.md
Last active September 20, 2022 16:28
Tanzu Framework, 1.6, k8s 1.23.8 : Working yaml inputs, ubuntu

Output once it finally installs...

Checking for required plugins...
Installing plugin 'cluster:v0.25.0'
Installing plugin 'feature:v0.25.0'
Installing plugin 'kubernetes-release:v0.25.0'
Successfully installed all required plugins
root@thick-edge:/home/kubo/code/tkg16# cat c.yaml
CLUSTER_PLAN: prod
@jayunit100
jayunit100 / break-etcd-restore-capv.sh
Last active July 15, 2022 21:05
backup restore prototype
################ DO NOT RUN THIS SCRIPT EVERR IT WILL BREAK YOUR CLUSTER !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
### TODO, read in these parameters...
management_nodes=( "10.92.6.140" )
function backup_etcd {
echo "killing etcd"
for node in ${management_nodes[@]}; do
# ssh capv@${t} systemctl stop kubelet
echo "backup etcd to etcd_backup directory"
ssh capv@$node "sudo rm -rf etcd_backup ; sudo mkdir etcd_backup"
@jayunit100
jayunit100 / tkg-gpu-ytt.md
Last active July 8, 2022 19:14
Plumbing PCI Devices to Tanzu Framework

YTT Goo for Tanzu GPUs

Here is a relatively clean way to modify Tanzu to inject device and vendor Ids for PCIs that leverages kubernetes-sigs/cluster-api-provider-vsphere#1264.

I've pushed the image for this here:

#### docker.io/jayunit100/capv-gpu:geetika
wget https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.1.5/clusterctl-linux-amd64 
clusterctl upgrade apply --contract v1beta1