Skip to content

Instantly share code, notes, and snippets.

View dims's full-sized avatar

Davanum Srinivas dims

View GitHub Profile
{
"spec": {
"unwantedModules": {
"cloud.google.com/go": "cloud dependency",
"cloud.google.com/go/bigquery": "cloud dependency",
"cloud.google.com/go/compute": "cloud dependency",
"cloud.google.com/go/firestore": "db/datastore clients should not be required",
"cloud.google.com/go/storage": "cloud dependency",
"github.com/GoogleCloudPlatform/k8s-cloud-provider": "cloud dependency",
"github.com/PuerkitoBio/urlesc": "unmaintained, archive mode",
@dims
dims / fields.yaml
Last active August 17, 2024 20:28
v1.31 API generation
- definition: io.k8s.api.core.v1.PodSpec
field_categories:
- name: Containers
fields:
- containers
- initContainers
- ephemeralContainers
- imagePullSecrets
- enableServiceLinks
- os
#!/bin/bash
crictl ps
crictl pods
crictl stop $(crictl ps -q)
crictl rm $(crictl ps -q)
crictl stopp $(crictl pods -q)
crictl rmp $(crictl pods -q)
@dims
dims / gist:d8069b1c27409f9130f815bc6075ee2d
Created August 13, 2024 01:05
Shows the name of the command running on each port on MacOS
sudo lsof -iTCP -sTCP:LISTEN -n -P | awk 'NR>1 {print $9, $1, $2}' | sed 's/.*://' | while read port process pid; do echo "Port $port: $(ps -p $pid -o command= | sed 's/^-//') (PID: $pid)"; done | sort -n
@dims
dims / README.md
Last active August 11, 2024 21:54

Check if you have permissions to apply the yaml

kubectl auth can-i list validatingadmissionpolicies --all-namespaces
kubectl auth can-i list validatingadmissionpolicybindings --all-namespaces

Use kubectl apply to apply the yaml

Check if they got applied correctly

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')