Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
3088a3f2
Unverified
Commit
3088a3f2
authored
Apr 12, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Apr 12, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #76384 from xichengliudui/update-readme
Update README.md files in sample-controller
parents
78f571dc
ba1d992e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
README.md
staging/src/k8s.io/sample-controller/README.md
+10
-10
No files found.
staging/src/k8s.io/sample-controller/README.md
View file @
3088a3f2
...
@@ -42,19 +42,19 @@ This is an example of how to build a kube-like controller with a single type.
...
@@ -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:
...
@@ -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:
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment