Skip to content

Commit 0ae48c2

Browse files
authored
Merge pull request #137 from fanminshi/add_readme_for_0.0.2
doc: add 0.0.2 milestone readme and a todo user_guide
2 parents a8451c4 + 856f0a6 commit 0ae48c2

File tree

2 files changed

+110
-0
lines changed

2 files changed

+110
-0
lines changed

doc/milestone/readme_0.0.2.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Operator SDK
2+
3+
### Project Status: pre-alpha
4+
5+
The project is currently pre-alpha and it is expected that breaking changes to the API will be made in the upcoming releases.
6+
7+
See the [design docs][design_docs] for planned work on upcoming milestones.
8+
9+
## Overview
10+
11+
[Operators][operator_link] make it easy to manage complex stateful applications on top of Kubernetes. However writing an operator today can be difficult because of challenges such as using low level APIs, writing boilerplate, and a lack of modularity which leads to duplication.
12+
13+
The Operator SDK is a framework designed to make writing operators easier by providing:
14+
- High level APIs and abstractions to write the operational logic more intuitively
15+
- Tools for scaffolding and code generation to bootstrap a new project fast
16+
- Modular functionality to improve reusability
17+
18+
## Workflow
19+
20+
The SDK provides the following workflow to develop a new operator:
21+
1. Create a new operator project using the SDK Command Line Interface(CLI)
22+
2. Define new resource APIs by adding Custom Resource Definitions(CRD)
23+
3. Specify resources to watch using the SDK API
24+
4. Define the operator reconciling logic in a designated handler and use the SDK API to interact with resources
25+
5. Use the SDK CLI to build and generate the operator deployment manifests
26+
27+
At a high level an operator using the SDK processes events for watched resources in a user defined handler and takes actions to reconcile the state of the application.
28+
29+
## Quick Start
30+
31+
First, checkout and install the operator-sdk CLI:
32+
33+
```
34+
$ git checkout tags/v0.0.2
35+
$ go install github.com/coreos/operator-sdk/commands/operator-sdk
36+
```
37+
38+
Create and deploy an app-operator using the SDK CLI:
39+
40+
```
41+
# Create an app-operator project that defines the App CR.
42+
$ cd $GOPATH/src/github.com/example-inc/
43+
$ operator-sdk new app-operator --api-version=app.example.com/v1alpha1 --kind=App
44+
45+
# Build and push the app-operator image to a public registry such as quay.io
46+
$ operator-sdk build quay.io/example/app-operator
47+
$ docker push quay.io/example/app-operator
48+
49+
# Deploy the app-operator
50+
$ kubectl create -f deploy/rbac.yaml
51+
$ kubectl create -f deploy/operator.yaml
52+
53+
# By default, creating a custom resource (App) triggers the app-operator to deploy a busybox pod
54+
$ kubectl create -f deploy/cr.yaml
55+
56+
# Verify that the busybox pod is created
57+
$ kubectl get pod -l app=busy-box
58+
NAME READY STATUS RESTARTS AGE
59+
busy-box 1/1 Running 0 50s
60+
61+
# Cleanup
62+
$ kubectl delete -f deploy/cr.yaml
63+
$ kubectl delete -f deploy/operator.yaml
64+
$ kubectl delete -f deploy/rbac.yaml
65+
```
66+
67+
To learn more about the operator-sdk, see the [user guide][guide].
68+
69+
70+
[operator_link]:https://coreos.com/operators/
71+
[design_docs]:../design
72+
[guide]:./user_guide.md

doc/milestone/user_guide.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Getting Started
2+
3+
## Prerequisites
4+
5+
- [dep][dep_tool] version v0.4.1+.
6+
- [go][go_tool] version v1.10+.
7+
- [docker][docker_tool] version 17.03+.
8+
- Access to a public registry such as quay.io.
9+
- [kubectl][kubectl_tool] version v1.9.0+.
10+
- Access to a kubernetes v.1.9.0+ cluster.
11+
12+
**Note**: This guide uses [minikube][minikube_tool] version v0.25.0+ as the local kubernetes cluster and quay.io for the public registry.
13+
14+
## Installing Operator SDK CLI
15+
16+
The Operator SDK comes with a CLI tool that manages the development lifecycle. It helps create the project scaffolding, preprocess custom resource API to generate Kubernetes related code, and generate deployment scripts.
17+
18+
Checkout the desired release tag and install the SDK CLI tool:
19+
```
20+
git checkout tags/v0.0.2
21+
go install github.com/coreos/operator-sdk/commands/operator-sdk
22+
```
23+
24+
This will install the CLI binary `operator-sdk` at `$GOPATH/bin`.
25+
26+
## Creating a new project
27+
28+
TODO
29+
30+
[scaffold_doc]:./doc/project_layout.md
31+
[mc_protocol]:https://github.com/memcached/memcached/blob/master/doc/protocol.txt
32+
[dep_tool]:https://golang.github.io/dep/docs/installation.html
33+
[go_tool]:https://golang.org/dl/
34+
[docker_tool]:https://docs.docker.com/install/
35+
[kubectl_tool]:https://kubernetes.io/docs/tasks/tools/install-kubectl/
36+
[minikube_tool]:https://github.com/kubernetes/minikube#installation
37+
[operator_link]:https://coreos.com/operators/
38+
[design_docs]:./doc/design

0 commit comments

Comments
 (0)