Skip to content

Instantly share code, notes, and snippets.

View dims's full-sized avatar

Davanum Srinivas dims

View GitHub Profile
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: tune-kindnet
namespace: kube-system
labels:
app: tune-kindnet
spec:
selector:
matchLabels:
go install sigs.k8s.io/kubetest2@latest;
go install sigs.k8s.io/kubetest2/kubetest2-tester-ginkgo@latest
go install sigs.k8s.io/provider-aws-test-infra/kubetest2-ec2@latest
#go install .
kubetest2 ec2 \
--stage https://dl.k8s.io/ci/fast/ \
--version $(curl -Ls https://dl.k8s.io/ci/fast/latest-fast.txt) \
--region us-east-1 \
rm cacher.test && make test WHAT=staging/src/k8s.io/apiserver/pkg/storage/cacher KUBE_TEST_ARGS='-c'
stress ./cacher.test --test.failfast --test.run TestWatchStreamSeparation
@dims
dims / run.sh
Created July 3, 2024 23:27
Run `eksdemo` / `kubetest2 ec2` and end to end tests
#!/bin/sh
eksdemo create cluster test-eks-02 --os AmazonLinux2023
eksdemo delete cluster test-eks-02
go install sigs.k8s.io/kubetest2@latest
go install sigs.k8s.io/provider-aws-test-infra/kubetest2-ec2@latest
AMI_ID=$(aws ssm get-parameter --name "/aws/service/eks/optimized-ami/1.30/amazon-linux-2023/x86_64/standard/recommended/image_id" | jq -r '.Parameter.Value')
@dims
dims / skip.sh
Created June 19, 2024 17:00
skip github action stale build checks
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-f 'state=success' \
-f 'target_url=https://github.com/google/cadvisor/pull/3527/checks' \
-f 'description=Skipped this stale build!' \
-f 'context=test-integration (1.22, ubuntu-20.04, build/config/plain.sh)' \
/repos/google/cadvisor/statuses/2b6f92b40593f935ca19306af5c3aee3c00ac61d
#!/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
@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 \
@dims
dims / README.md
Last active January 22, 2024 16:32
EKS cluster with a single node using specific AMI

To create

eksctl create cluster -f eks-demo-cluster-001.yaml

To delete

eksctl delete cluster eks-demo-cluster-001 --region us-east-1

@dims
dims / README.md
Last active January 16, 2024 02:36
SOCI w/ k8s
  • use initialize-nginx-image.sh to push nginx:latest into an ECR repository and build the soci index (see here for details)
  • install fuse using sudo yum install fuse -y
  • download and extract files from https://github.com/awslabs/soci-snapshotter/releases/ into /usr/local/bin
  • run sudo chown root:root /usr/local/bin/soci-snapshotter-grpc
  • copy soci-config.toml to /etc/soci-snapshotter-grpc/config.toml
  • copy soci-snapshotter.service to /usr/lib/systemd/system/soci-snapshotter.service
  • enable service using sudo systemctl enable --now soci-snapshotter
  • install sudo yum install -y amazon-ecr-credential-helper (or install from latest release in repo)
  • copy config.json to /root/.docker/config.json
  • run sudo chown root:root /root/.docker/config.json