mirror of
https://github.com/kubernetes/sample-controller.git
synced 2025-02-22 08:53:02 +08:00
Update README.md files in sample-controller
Kubernetes-commit: ba1d992ebdf36514ef65b76d23ecc2c587f8b0af
This commit is contained in:
parent
ef739b027d
commit
3c6310ad91
20
README.md
20
README.md
@ -42,19 +42,19 @@ This is an example of how to build a kube-like controller with a single type.
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
# assumes you have a working kubeconfig, not required if operating in-cluster
|
# assumes you have a working kubeconfig, not required if operating in-cluster
|
||||||
$ go get k8s.io/sample-controller
|
go get k8s.io/sample-controller
|
||||||
$ cd $GOPATH/src/k8s.io/sample-controller
|
cd $GOPATH/src/k8s.io/sample-controller
|
||||||
$ go build -o sample-controller .
|
go build -o sample-controller .
|
||||||
$ ./sample-controller -kubeconfig=$HOME/.kube/config
|
./sample-controller -kubeconfig=$HOME/.kube/config
|
||||||
|
|
||||||
# create a CustomResourceDefinition
|
# create a CustomResourceDefinition
|
||||||
$ kubectl create -f artifacts/examples/crd.yaml
|
kubectl create -f artifacts/examples/crd.yaml
|
||||||
|
|
||||||
# create a custom resource of type Foo
|
# create a custom resource of type Foo
|
||||||
$ kubectl create -f artifacts/examples/example-foo.yaml
|
kubectl create -f artifacts/examples/example-foo.yaml
|
||||||
|
|
||||||
# check deployments created through the custom resource
|
# check deployments created through the custom resource
|
||||||
$ kubectl get deployments
|
kubectl get deployments
|
||||||
```
|
```
|
||||||
|
|
||||||
## Use Cases
|
## Use Cases
|
||||||
@ -102,7 +102,7 @@ In the above steps, use `crd-validation.yaml` to create the CRD:
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
# create a CustomResourceDefinition supporting validation
|
# create a CustomResourceDefinition supporting validation
|
||||||
$ kubectl create -f artifacts/examples/crd-validation.yaml
|
kubectl create -f artifacts/examples/crd-validation.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
## Subresources
|
## Subresources
|
||||||
@ -126,14 +126,14 @@ In the above steps, use `crd-status-subresource.yaml` to create the CRD:
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
# create a CustomResourceDefinition supporting the status subresource
|
# create a CustomResourceDefinition supporting the status subresource
|
||||||
$ kubectl create -f artifacts/examples/crd-status-subresource.yaml
|
kubectl create -f artifacts/examples/crd-status-subresource.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
## Cleanup
|
## Cleanup
|
||||||
|
|
||||||
You can clean up the created CustomResourceDefinition with:
|
You can clean up the created CustomResourceDefinition with:
|
||||||
|
|
||||||
$ kubectl delete crd foos.samplecontroller.k8s.io
|
kubectl delete crd foos.samplecontroller.k8s.io
|
||||||
|
|
||||||
## Compatibility
|
## Compatibility
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user