Skip to content

Instantly share code, notes, and snippets.

View aaron-prindle's full-sized avatar
💭
📦

Aaron Prindle aaron-prindle

💭
📦
  • Google
  • San Francisco
View GitHub Profile
@aaron-prindle
aaron-prindle / validation_test.go
Created January 18, 2025 22:27
Declarative Validation: Example of migration changes for pkg/apis/core/validation/validation_test.go
diff --git a/pkg/apis/core/validation/validation_test.go b/pkg/apis/core/validation/validation_test.go
index 295f8425eab..8a9fdb68661 100644
--- a/pkg/apis/core/validation/validation_test.go
+++ b/pkg/apis/core/validation/validation_test.go
@@ -1,27 +1,32 @@
/*
-Copyright 2014 The Kubernetes Authors.
+ Copyright 2014 The Kubernetes Authors.
-Licensed under the Apache License, Version 2.0 (the "License");
@aaron-prindle
aaron-prindle / zz_generated.validations.go
Created January 14, 2025 05:40
Declarative Validation Example For ReplicationController
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
Copyright 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
@aaron-prindle
aaron-prindle / gist:d26e1e8075cf4eb69eb7c31f0f5c8ab6
Created October 15, 2024 18:17
testserver-HEAD-w-1.31-emulation-10-12-2024.txt
# HELP kubernetes_feature_enabled [BETA] This metric records the data about the stage and enablement of a k8s feature.
# TYPE kubernetes_feature_enabled gauge
kubernetes_feature_enabled{name="APIListChunking",stage=""} 1
kubernetes_feature_enabled{name="APIResponseCompression",stage="BETA"} 1
kubernetes_feature_enabled{name="APIServerIdentity",stage="BETA"} 1
kubernetes_feature_enabled{name="APIServerTracing",stage="BETA"} 1
kubernetes_feature_enabled{name="APIServingWithRoutine",stage="ALPHA"} 0
kubernetes_feature_enabled{name="AdmissionWebhookMatchConditions",stage=""} 1
kubernetes_feature_enabled{name="AggregatedDiscoveryEndpoint",stage=""} 1
kubernetes_feature_enabled{name="AllAlpha",stage="ALPHA"} 0
# HELP kubernetes_feature_enabled [BETA] This metric records the data about the stage and enablement of a k8s feature.
# TYPE kubernetes_feature_enabled gauge
kubernetes_feature_enabled{name="APIListChunking",stage=""} 1
kubernetes_feature_enabled{name="APIResponseCompression",stage="BETA"} 1
kubernetes_feature_enabled{name="APIServerIdentity",stage="BETA"} 1
kubernetes_feature_enabled{name="APIServerTracing",stage="BETA"} 1
kubernetes_feature_enabled{name="APIServingWithRoutine",stage="ALPHA"} 0
kubernetes_feature_enabled{name="AdmissionWebhookMatchConditions",stage=""} 1
kubernetes_feature_enabled{name="AggregatedDiscoveryEndpoint",stage=""} 1
kubernetes_feature_enabled{name="AllAlpha",stage="ALPHA"} 0
@aaron-prindle
aaron-prindle / gist:3124f38817db18381336dc0fe0fcd879
Created October 13, 2024 22:36
HEAD-w-1.31-emulation-10-12-2024.txt
# HELP kubernetes_feature_enabled [BETA] This metric records the data about the stage and enablement of a k8s feature.
# TYPE kubernetes_feature_enabled gauge
kubernetes_feature_enabled{name="APIListChunking",stage=""} 1
kubernetes_feature_enabled{name="APIResponseCompression",stage="BETA"} 1
kubernetes_feature_enabled{name="APIServerIdentity",stage="BETA"} 1
kubernetes_feature_enabled{name="APIServerTracing",stage="BETA"} 1
kubernetes_feature_enabled{name="APIServingWithRoutine",stage="ALPHA"} 0
kubernetes_feature_enabled{name="AdmissionWebhookMatchConditions",stage=""} 1
kubernetes_feature_enabled{name="AggregatedDiscoveryEndpoint",stage=""} 1
kubernetes_feature_enabled{name="AllAlpha",stage="ALPHA"} 0
@aaron-prindle
aaron-prindle / gist:3e8a5c3cef3b8ff10763be0d4858254d
Created September 9, 2024 19:13
K8s types that have APILifecycleRemoved OR APILifecycleDeprecated targeting v1.32
File: ./staging/src/k8s.io/api/authentication/v1alpha1/zz_generated.prerelease-lifecycle.go
}
// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison.
// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor.
func (in *SelfSubjectReview) APILifecycleRemoved() (major, minor int) {
return 1, 32
-----------------------------------------
File: ./staging/src/k8s.io/api/apidiscovery/v2beta1/zz_generated.prerelease-lifecycle.go
}
kubernetes/website vs versioned_kube_features.go (& kube_features.go) Deltas and General Inaccuracies [final]
kubernetes/website Inaccuracies
Note: below kubernetes/website JSON is a custom struct and differs from the website syntax BUT the values/info is identical
TBD - Add AppArmorFields feature? (missing on kubernetes/website)
TBD - Add DisableAllocatorDualWrite feature (missing on kubernetes/website)
TBD - Add ReloadKubeletServerCertificateFile feature (missing on kubernetes/website)
Add missing GA entry for DisableCloudProviders
package main
import (
"context"
"fmt"
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
"k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/fake"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
@aaron-prindle
aaron-prindle / gist:278bf93cff25839155befec7781e46e4
Created August 22, 2024 23:07
git patch to get hack/local-up-cluster.sh working
diff --git a/cluster/addons/dns/coredns/coredns.yaml.base b/cluster/addons/dns/coredns/coredns.yaml.base
index 3d438dce445..068c4f59e46 100644
--- a/cluster/addons/dns/coredns/coredns.yaml.base
+++ b/cluster/addons/dns/coredns/coredns.yaml.base
@@ -74,7 +74,7 @@ data:
ttl 30
}
prometheus :9153
- forward . /etc/resolv.conf {
+ forward . 8.8.8.8 8.8.4.4 {
{
"credHelpers": {
"asia.gcr.io": "gcloud",
"eu.gcr.io": "gcloud",
"gcr.io": "gcloud",
"marketplace.gcr.io": "gcloud",
"staging-k8s.gcr.io": "gcloud",
"us-central1-docker.pkg.dev": "gcloud",
"us-west2-docker.pkg.dev": "gcloud",
"us-west4-docker.pkg.dev": "gcloud",