Skip to content

Instantly share code, notes, and snippets.

View pwittrock's full-sized avatar

Phillip Wittrock pwittrock

View GitHub Profile
**AI's for kubectl extensibility**
- Clearly define the tradeoffs of designing kubectl around plugins - what are the benefits and what are the risks.
- Evaluate approaches for distributing designing kubectl around a plugin architecture.
- Evaluate approaches for building, testing, upgrading kubectl around a plugin architecture.
- If feasible - prioritize and possibly come up with a roadmap for supporting these options towards this approach.
- Evaluate good, low risk candidate commands.
path:
- create
- deployment
description: |
kubectl create deployment creates a new Deployment object
flags:
- name: image
type: string
- name: replicas
type: int32
@pwittrock
pwittrock / codegen.md
Last active October 30, 2017 20:35
Bazel code generators

Kubernetes Code Generators

Kubernetes provides a collection of code generators to assist with developing APIs. These code generators generate useful libraries such as clients, openapi definitions, copying go structs, etc.

The kubegen uses directory structure conventions to detect Kubernetes APIs definitions and run the standard set of Kubernetes code generators.

There are 2 methods for running kubegen

@pwittrock
pwittrock / demo.md
Last active August 19, 2018 18:31
apiserver-builder demo

apiserver-builder demo

Uses v0.1-alpha.21

boilerplate.go.txt

/*
Copyright 2017 The Kubernetes Authors.
export PROJECT="pwittroc-k8s-1148"
# Create the service account
gcloud iam service-accounts create gcp-controller-sa
# Add the roles so the service account and create and get keys for other service accounts
gcloud projects add-iam-policy-binding $PROJECT --member serviceAccount:gcp-controller-sa@$PROJECT.iam.gserviceaccount.com --role roles/iam.serviceAccountKeyAdmin
gcloud projects add-iam-policy-binding $PROJECT --member serviceAccount:gcp-controller-sa@$PROJECT.iam.gserviceaccount.com --role roles/iam.serviceAccountAdmin
# Get the key for the service account and write to the file serviceaccount.json
gcloud iam service-accounts keys create serviceaccount-sa.json --iam-account=gcp-controller-sa@$PROJECT.iam.gserviceaccount.com
@pwittrock
pwittrock / OWNERS
Last active April 27, 2017 18:03
kubernetes-incubator/apiserver-framework proposal
reviewers:
- jimmidyson
- MHBauer
- pwittrock
- directxman12
- brancz
- xiang90
- hongchaodeng
approvers:
- jimmidyson

Definition

type OpenAPIDefinition struct {
	Schema       spec.Schema
	Dependencies []string
}

Instantiation

Definition

type OpenAPIDefinition struct {
	Schema       spec.Schema
	Dependencies []string
}

Instantiation

wittroc-macbookpro2:sample-apiserver pwittroc$ glide install
[INFO] Lock file (glide.lock) does not exist. Performing update.
[INFO] Downloading dependencies. Please wait...
[INFO] --> Fetching updates for k8s.io/apimachinery.
[INFO] --> Fetching updates for k8s.io/apiserver.
[INFO] --> Fetching updates for github.com/spf13/cobra.
[INFO] Resolving imports
[INFO] --> Fetching updates for github.com/go-openapi/spec.
[INFO] --> Fetching updates for github.com/gogo/protobuf.
[INFO] --> Fetching updates for github.com/google/gofuzz.
// Go Struct
// +x-kubernetes-get-columns="NAME:metadata.name,STATUS:status.phase"
// +x-kubernetes-describe-columns="NAME:metadata.name,STATUS:status.phase,DNS:spec.dnsPolicy"
type Pod struct {
...
}
"v1.Pod": {
"x-kubernetes-get-columns": "NAME:metadata.name,STATUS:status.phase",
"x-kubernetes-describe-columns": "NAME:metadata.name,STATUS:status.phase,DNS:spec.dnsPolicy",