Skip to content

Instantly share code, notes, and snippets.

View munnerz's full-sized avatar

James Munnelly munnerz

  • Birmingham, United Kingdom
View GitHub Profile
func objectNTimes(t *testing.T, fuzzer *gofuzz.Fuzzer, obj runtime.Object, schema *structuralschema.Structural, iterations int) {
t.Logf("Running CRD schema pruning fuzz test for object %v", obj.GetObjectKind())
for i := 0; i < iterations; i++ {
fuzzed := obj.DeepCopyObject()
// fuzz *before* converting to unstructured, so we get typed fuzzing
fuzzer.Fuzz(fuzzed)
unstructuredFuzzed, err := runtime.DefaultUnstructuredConverter.ToUnstructured(fuzzed)
if err != nil {
t.Fatalf("Failed to convert type to `runtime.Unstructured`: %v", err)
return
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: nvidia-device-plugin-daemonset
spec:
updateStrategy:
type: RollingUpdate
template:
metadata:
API structure comments:
- constants package is an implicit part of our API, whether we want it to be or not
- right now, there is an undisclosed dependency between v1alpha{2,3} + internal + constants
- therefore, each of v1alpha2 & 3 should have their own copies of each node role type for example (to allow for migrations in future)
- has a big effect on kind as a library. Should consumers depend on the internal type? Or the external types?
- we don't provide any guarantees on the stability of the *internal type*. It is used simply as a base for conversion
- I am not sure what kubeadm's strategy for this is, however I suspect that there is not a particular good one just yet
- external types are *designed* to be stable and consumed by users, be that via CLI or library
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
@munnerz
munnerz / calico-dind.yaml
Created May 10, 2018 12:45
Calico manifest for jetstack dind clusters
# Calico Version v2.4.1
# https://docs.projectcalico.org/v2.4/releases#v2.4.1
# This manifest includes the following component versions:
# calico/node:v2.4.1
# calico/cni:v1.10.0
# calico/kube-policy-controller:v0.7.0
# This ConfigMap is used to configure a self-hosted Calico installation.
kind: ConfigMap
apiVersion: v1
#!/bin/bash
base=docker.elastic.co/elasticsearch/elasticsearch
versions="6.2.3 6.1.4 6.0.1 5.6.8 5.6.7 5.6.6 5.6.5 5.6.4 5.6.3 5.6.2 5.6.1 5.6.0 5.5.3 5.4.3 5.3.3 5.2.1"
for v in ${versions}; do
img=${base}:${v}
ver=$(docker run -it --entrypoint=java "${img}" -version 2>/dev/null| grep version)
echo "${img} = ${ver}"
done
# Calico Version v2.6.5
# https://docs.projectcalico.org/v2.6/releases#v2.6.5
# This manifest includes the following component versions:
# calico/node:v2.6.5
# calico/cni:v1.11.2
# This ConfigMap is used to configure a self-hosted Calico installation.
kind: ConfigMap
apiVersion: v1
metadata:
@munnerz
munnerz / cert-manager-letsencrypt.yaml
Last active July 22, 2017 00:21
Proposal for cert-manager CRD format
# This would create a certificate valid for www.google.com, twitter.com and yahoo.com
apiVersion: certmanager.k8s.io/v1alpha1
kind: Certificate
metadata:
name: production-crt
spec:
secret: production-crt
issuer: letsencrypt-prod
domains:
- www.google.com
<html><head>
<meta name="go-import" content="abc.xyz/example git https://github.com/abc-xyz/example">
<meta name="go-source" content="abc.xyz/example https://github.com/abc-xyz/example https://github.com/abc-xyz/example/tree/master{/dir} https://github.com/abc-xyz/example/blob/master{/dir}/{file}#L{line}">
</head></html>
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: abc-xyz
labels:
app: abc-xyz
version: v1
spec:
replicas: 2
strategy: