Skip to content

Instantly share code, notes, and snippets.

View dims's full-sized avatar

Davanum Srinivas dims

View GitHub Profile
@dims
dims / differences.md
Last active May 2, 2024 18:49
Python script to compute updates to the Kubernetes go.mod to see how far we are behind latest in vendored repos
Package Current Latest URL
cloud.google.com/go/compute v1.23.0 v1.26.0 https://github.com/googleapis/google-cloud-go/compare/v1.23.0...v1.26.0
cloud.google.com/go/compute/metadata v0.2.3 v0.3.0 https://github.com/googleapis/google-cloud-go/compare/v0.2.3...v0.3.0
github.com/Azure/go-ansiterm d185dfc1b5a1 306776ec8161 https://github.com/Azure/go-ansiterm/compare/d185dfc1b5a1...306776ec8161
github.com/GoogleCloudPlatform/k8s-cloud-provider f11817397a1b v1.27.0 https://github.com/GoogleCloudPlatform/k8s-cloud-provider/compare/f11817397a1b...v1.27.0
github.com/Microsoft/go-winio v0.6.0 v0.6.2 https://github.com/Microsoft/go-winio/compare/v0.6.0...v0.6.2
github.com/Microsoft/hcsshim v0.8.25 v0.12.3 https://github.com/Microsoft/hcsshim/compare/v0.8.25...v0.12.3
github.com/armon/circbuf bbbad097214e 5111143e8da2 https://github.com/armon/circbuf/compare/bbbad097214e...5111143e8da2
github.com/a
@dims
dims / README.md
Last active April 30, 2024 11:52
Kubernetes Resources
#!/usr/bin/env bash
# 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
#
@dims
dims / nvi.sh
Last active March 29, 2024 17:29
Notes from running kubetest2 ec2 with nvidia
#!/bin/bash
# All the notes you need!!!
# https://github.com/awslabs/amazon-eks-ami/releases/tag/v20240227
# AMI Name: amazon-eks-gpu-node-1.29-v20240227
# https://docs.aws.amazon.com/eks/latest/userguide/eks-optimized-ami.html
# https://docs.aws.amazon.com/dlami/latest/devguide/gpu.html
# https://hub.docker.com/r/nvidia/cuda/tags
# https://github.com/NVIDIA/k8s-device-plugin/releases
Prerequisites on a new box
# install go-1.12 from https://storage.googleapis.com/golang/go1.12.linux-arm64.tar.gz
- role exists for this (golang-test); var go_version should be set to 1.12
# install docker-ce using https://docs.docker.com/install/linux/docker-ce/ubuntu/
- create role (one may already exist on ansible galaxy; if it does pull into openlab-zuul-jobs roles directory)
# install bazel from scratch
wget https://github.com/bazelbuild/bazel/releases/download/0.23.1/bazel-0.23.1-dist.zip
# Install gsutil from https://cloud.google.com/storage/docs/gsutil_install#creds-gsutil
# pick exact debs that we need to test with
sudo apt-get install socat ebtables
dpkg -l | grep -e kube -e cri-tools | awk '{print $2}' | xargs sudo dpkg --purge --force-all
gsutil -m cp gs://kubernetes-openstack/stable/xenial/*amd64.deb .
sudo dpkg -i *.deb
# stop the kubelet
sudo systemctl stop kubelet
FROM debian:buster-slim as builder
RUN apt-get update -y \
&& apt-get -yy -q install --no-install-recommends --no-install-suggests --fix-missing \
bash-static
RUN cp /bin/bash-static /sh
FROM us.gcr.io/k8s-artifacts-prod/build-image/go-runner:v0.1.1
WORKDIR /
@dims
dims / run-kubekins-e2e-shell.sh
Last active February 12, 2024 20:17
Drop into the shell inside kubekins-e2e container
# DO NOT TRY THIS ON A MAC or WSL2 :) use a ubuntu vm or something!
# Run the same kubekins container used in the CI job
IMAGE=gcr.io/k8s-staging-test-infra/kubekins-e2e:v20240209-82001bc8c5-main
# Create a temp directory for the DIND docker - see the baked in assumption in some of our images here - https://cs.k8s.io/?q=docker-graph&i=nope&files=&excludeFiles=&repos=kubernetes/test-infra
(sudo mkdir -p /tmp/docker-graph && sudo chmod -R 777 /tmp/docker-graph && cd /tmp/docker-graph && rm -rf *)
# Run as a privileged container, mount both the kubernetes directory and the docker-graph directory
docker run -e DOCKER_IN_DOCKER_ENABLED=true \

Install goreleaser from https://goreleaser.com/install/

export GORELEASER_PREVIOUS_TAG=v0.4.1
export GORELEASER_CURRENT_TAG=v0.5.0

git fetch --all --tags
git checkout tags/$GORELEASER_CURRENT_TAG -b branch-for-tag-$GORELEASER_CURRENT_TAG
goreleaser release --clean
@dims
dims / run-local-up-cluster-on-fresh-ubuntu-install.sh
Last active February 5, 2024 22:28
Run local-up-cluster.sh on a fresh ubuntu environment
# ====== Fetch Kubernetes Sources =======
mkdir -p $HOME/go/src/k8s.io/
cd $HOME/go/src/k8s.io/
git clone https://github.com/kubernetes/kubernetes
alias k="cd $HOME/go/src/k8s.io/kubernetes"
# ====== Install and configure Docker/Containerd =======
sudo apt-get update