mirror of
https://github.com/kubernetes/sample-controller.git
synced 2025-02-20 23:56:23 +08:00
Merge pull request #76384 from xichengliudui/update-readme
Update README.md files in sample-controller Kubernetes-commit: 3088a3f2001b2159123b7748304e142ca693985c
This commit is contained in:
commit
441cf4cebb
2
Godeps/Godeps.json
generated
2
Godeps/Godeps.json
generated
@ -220,7 +220,7 @@
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/client-go",
|
||||
"Rev": "ca8df85b1798"
|
||||
"Rev": "7a6b4715b709"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/code-generator",
|
||||
|
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
|
||||
# assumes you have a working kubeconfig, not required if operating in-cluster
|
||||
$ go get k8s.io/sample-controller
|
||||
$ cd $GOPATH/src/k8s.io/sample-controller
|
||||
$ go build -o sample-controller .
|
||||
$ ./sample-controller -kubeconfig=$HOME/.kube/config
|
||||
go get k8s.io/sample-controller
|
||||
cd $GOPATH/src/k8s.io/sample-controller
|
||||
go build -o sample-controller .
|
||||
./sample-controller -kubeconfig=$HOME/.kube/config
|
||||
|
||||
# create a CustomResourceDefinition
|
||||
$ kubectl create -f artifacts/examples/crd.yaml
|
||||
kubectl create -f artifacts/examples/crd.yaml
|
||||
|
||||
# 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
|
||||
$ kubectl get deployments
|
||||
kubectl get deployments
|
||||
```
|
||||
|
||||
## Use Cases
|
||||
@ -102,7 +102,7 @@ In the above steps, use `crd-validation.yaml` to create the CRD:
|
||||
|
||||
```sh
|
||||
# create a CustomResourceDefinition supporting validation
|
||||
$ kubectl create -f artifacts/examples/crd-validation.yaml
|
||||
kubectl create -f artifacts/examples/crd-validation.yaml
|
||||
```
|
||||
|
||||
## Subresources
|
||||
@ -126,14 +126,14 @@ In the above steps, use `crd-status-subresource.yaml` to create the CRD:
|
||||
|
||||
```sh
|
||||
# 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
|
||||
|
||||
You can clean up the created CustomResourceDefinition with:
|
||||
|
||||
$ kubectl delete crd foos.samplecontroller.k8s.io
|
||||
kubectl delete crd foos.samplecontroller.k8s.io
|
||||
|
||||
## Compatibility
|
||||
|
||||
|
4
go.mod
4
go.mod
@ -7,7 +7,7 @@ go 1.12
|
||||
require (
|
||||
k8s.io/api v0.0.0-20190409092523-d687e77c8ae9
|
||||
k8s.io/apimachinery v0.0.0-20190409092423-760d1845f48b
|
||||
k8s.io/client-go v0.0.0-20190409092706-ca8df85b1798
|
||||
k8s.io/client-go v0.0.0-20190411052641-7a6b4715b709
|
||||
k8s.io/code-generator v0.0.0-20190409092313-826a68e0d120
|
||||
k8s.io/klog v0.0.0-20190306015804-8e90cee79f82
|
||||
)
|
||||
@ -66,7 +66,7 @@ replace (
|
||||
gopkg.in/yaml.v2 => gopkg.in/yaml.v2 v2.2.1
|
||||
k8s.io/api => k8s.io/api v0.0.0-20190409092523-d687e77c8ae9
|
||||
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20190409092423-760d1845f48b
|
||||
k8s.io/client-go => k8s.io/client-go v0.0.0-20190409092706-ca8df85b1798
|
||||
k8s.io/client-go => k8s.io/client-go v0.0.0-20190411052641-7a6b4715b709
|
||||
k8s.io/code-generator => k8s.io/code-generator v0.0.0-20190409092313-826a68e0d120
|
||||
k8s.io/component-base => k8s.io/component-base v0.0.0-20190409093041-e34633071963
|
||||
k8s.io/gengo => k8s.io/gengo v0.0.0-20190116091435-f8a0810f38af
|
||||
|
2
go.sum
2
go.sum
@ -80,7 +80,7 @@ gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE=
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
k8s.io/api v0.0.0-20190409092523-d687e77c8ae9/go.mod h1:FQEUn50aaytlU65qqBn/w+5ugllHwrBzKm7DzbnXdzE=
|
||||
k8s.io/apimachinery v0.0.0-20190409092423-760d1845f48b/go.mod h1:FW86P8YXVLsbuplGMZeb20J3jYHscrDqw4jELaFJvRU=
|
||||
k8s.io/client-go v0.0.0-20190409092706-ca8df85b1798/go.mod h1:4IOfimLkjvlSoc9wyI1VEwkNUG20XFNp7qO6XkH2gdI=
|
||||
k8s.io/client-go v0.0.0-20190411052641-7a6b4715b709/go.mod h1:4IOfimLkjvlSoc9wyI1VEwkNUG20XFNp7qO6XkH2gdI=
|
||||
k8s.io/code-generator v0.0.0-20190409092313-826a68e0d120/go.mod h1:JPZiTJFZs7ZmPkTFV/mPoXK+AWycCCwzWMLNVTLQTNc=
|
||||
k8s.io/gengo v0.0.0-20190116091435-f8a0810f38af h1:SwjZbO0u5ZuaV6TRMWOGB40iaycX8sbdMQHtjNZ19dk=
|
||||
k8s.io/gengo v0.0.0-20190116091435-f8a0810f38af/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
|
||||
|
Loading…
Reference in New Issue
Block a user