Skip to content

dennyzhang/challenges-k8s-crd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

1 Kubernetes CRD

linkedin
github
slack


PRs Welcome

Blog URL: https://kubernetes.dennyzhang.com/challenges-k8s-crd, Category: concept

File me Issues or star this repo.

See more Kubernetes sharing from Denny: #denny-kubernetes

1.1 Questions

1.1.1 DONE [#A] Two ways to extend kubernetes API: crd and aggregator

https://kubernetes.io/docs/reference/using-api/api-overview/

https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/aggregated-api-servers.md

  • CustomResourceDefinition for basic CRUD needs.
  • Aggregator for a full set of Kubernetes API semantics to implement their own apiserver.

1.1.2 How to instruct controller to restart a pod/container

1.1.3 DONE resource vs sub-resource

https://github.com/kubernetes/kubernetes/blob/1b3a2dd0830ca0e02d5b95d2ecc0161d0c93a0c7/staging/src/k8s.io/apiextensions-apiserver/pkg/registry/customresource/etcd.go#L36-L41

1.1.4 [#A] Deal with controller crash issue

1.2 Scenario-101: Create a dummy CRD resource

  • Requirements:
1. Install and start minikube
2. Create a dummy resource
3. Create/read/update/delete this CRD

1.3 Scenario-102: Create CRD with Subresources

  • Requirements:
1. Install and start minikube
2. Create a CRD

1.4 Scenario-103: Create a CRD with a real controller

  • Requirements:
1. Install and start minikube
2. Create a CRD

2 More Resources

License: Code is licensed under MIT License.

https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
https://blog.openshift.com/kubernetes-deep-dive-code-generation-customresources/
https://github.com/kubernetes/code-generator
https://github.com/kubernetes/sample-controller

https://github.com/martin-helmich/kubernetes-crd-example
https://kubernetes.io/docs/concepts/services-networking/service/