Skip to content

Commit 52feaae

Browse files
committed
Improve the docs and fix typo
1 parent 4c52c73 commit 52feaae

File tree

3 files changed

+17
-19
lines changed

3 files changed

+17
-19
lines changed

Makefile

-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ anchor-image: anchor octopus
3030
monkey-image: monkey
3131
$Q $(DOCKER) build -t monkey:$(VERSION) $(BUILD)/monkey
3232

33-
# TODO: this will fmt or lint twice.
3433
anchor:
3534
$Q mkdir -p $(BUILD)/anchor
3635
$Q GOOS=$(GOOS) $(GO) build -o $(BUILD)/anchor/anchor cmd/anchor/anchor.go
@@ -111,9 +110,6 @@ test-coverage: fmt lint test-coverage-tools ; $(info $(M) running coverage tests
111110
lint: | $(GOLINT) ; $(info $(M) running golint...) @ ## Run golint
112111
$Q $(GOLINT) -set_exit_status $(PKGS)
113112

114-
.PHONY: binaries
115-
binaries: | $(ANCHOR) $(OCTOPUS) $(MONKEY) ; $(info $(M) build binaries...) @ ## Building
116-
117113
.PHONY: fmt
118114
fmt: ; $(info $(M) running gofmt...) @ ## Run gofmt on all source files
119115
@ret=0 && for d in $$($(GO) list -f '{{.Dir}}' ./...); do \

README.md

+16-14
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,29 @@ Some applications, especially legacy applications or applications which monitor
44

55
## There comes anchor
66

7-
Project anchor mainly contains four compenents, They are:
7+
Project anchor mainly contains four components, They are:
88

9-
Anchor is an ipam plugin following the [CNI SPEC](https://github.com/containernetworking/cni/blob/master/SPEC.md).
9+
* Anchor is an IPAM plugin following the [CNI SPEC](https://github.com/containernetworking/cni/blob/master/SPEC.md).
1010

11-
Octopus is a main plugin that extends [macvlan](https://github.com/containernetworking/plugins/blob/master/plugins/main/macvlan/macvlan.go) to support multiple masters on the node. It is useful when there are multiple VLANs in the cluster.
11+
* Octopus is a main plugin that extends [macvlan](https://github.com/containernetworking/plugins/blob/master/plugins/main/macvlan/macvlan.go) to support multiple masters on the node. It is useful when there are multiple VLANs in the cluster.
1212

13-
Monkey is a WebUI that displays and operates the data used by anchor ipam.
13+
* Monkey is a WebUI that displays and operates the data used by anchor IPAM.
1414

15-
The backstage hero is the installation script of the anchor, which configures and maintains the network interfaces of the node.
15+
* The backstage hero is the installation script of the anchor, which configures and maintains the network interfaces of the node.
1616

1717
## CNI and Kubernetes
1818

1919
CNI(Container Network Interface), a CNCF project, consists of a specification and libraries for writing plugins to configure network interfaces in Linux containers, along with a number of supported plugins. CNI concerns itself only with network connectivity of containers and removing allocated resources when the container is deleted. Because of this focus, CNI has a wide range of support and the specification is simple to implement.
2020

21-
It is worth mentioning that kubernetes is just one of CNI runtimes, others including mesos, rkt, openshift.
21+
It is worth mentioning that kubernetes is just one of CNI runtimes, others including mesos, rkt, openshift, etc.
2222

2323
## MacVLAN
2424

2525
MacVLAN is a Linux network driver that exposes underlay or host interfaces directly to VMs or Containers running in the host.
2626

27-
MacVLAN allows a single physical interface to have multiple MAC and ip addresses using MacVLAN sub-interfaces. MacVLAN interface is typically used for virtualization applications and each MacVLAN interface is connected to a Container or VM. Each container or VM can directly get dhcp address as the host would do. This would help customers who want Containers to be part of their traditional network with the IP addressing scheme that they already have.
27+
MacVLAN allows a single physical interface to have multiple MACs and ip addresses using MacVLAN sub-interfaces. MacVLAN interface is typically used for virtualization applications and each MacVLAN interface is connected to a Container or VM. Each container or VM can directly get DHCP address or IPAM address as the host would do. This would help customers who want Containers to be part of their traditional network with the IP addressing scheme that they already have.
2828

29-
When using MacVLAN, the containers is **NOT** reachable to the underlying host interfaces as the packages are intentionally filtered by Linux for additional isolation. This does not meet the SPEC of CNI and *service* in k8s cannot work correnctly. To work around it, we create a new MacVLAN interface and steal the IP and network traffic from the host interface by changing the route table on the node. This work is designed to be done by installation script.
29+
When using MacVLAN, the containers is **NOT** reachable to the underlying host interfaces as the packages are intentionally filtered by Linux for additional isolation. This does not meet the SPEC of CNI and causes *service* in k8s cannot work correnctly. To work around it, we create a new MacVLAN interface and steal the IP and network traffic from the host interface by changing the route table in the host. This work is designed to be done by installation script.
3030

3131
## Installation
3232

@@ -46,11 +46,11 @@ Recently, I have no resources(No time, no machines) to test whether anchor works
4646
curl -O https://raw.githubusercontent.com/hainesc/anchor/master/deployment/anchor.yaml
4747
```
4848

49-
Edit the anchor.yaml use your favorite editor, *L* means *Line* below.
49+
Edit the anchor.yaml using your favorite editor, *L* means *Line* below.
5050

5151
* Remove L200 and lines below if the k8s cluster has not enabled RBAC.
52-
* L8, input the etcd endpoints used as the store for anchor, example at the end of the line.
53-
* L10 - L12, input the access token of the etcd, do nothing if SSL not enabled.
52+
* L8, input the etcd endpoints used as the store by anchor, see example at the end of the line.
53+
* L10 - L12, input the access tokens of the etcd, remove if SSL not enabled.
5454
* L18, input the choice whether or not create macvlan interface during the installation.
5555
* L22, input the cluster network information. Use semicolon(;) to seperate between items. eg, item *node01,eth0.2,10.0.2.8,10.0.2.1,24* tells install script creating a MacVLAN interface with the master *eth0.2* at the node whose hostname is *node01*, the additional info including IP of the master(*eth0.2* here), the gateway and mask of the subnet(10.0.2.1 and 24). You CAN have Multiple items for each node.
5656

@@ -68,10 +68,12 @@ There are several works done by the pod which created by the daemonset on each n
6868
* Config and write a CNI config file named 10-anchor.conf to the node
6969
* Create MacVLAN interface(s) on the node, the interfaces created here will be removed on node restart, but when the node rejoin the k8s cluster, the daemonset recreates a pod and it will recrete the interfaces.
7070

71-
## Example
71+
## Run an example
7272

7373
**Preparation**
7474

75+
Before the example, we should initialize the etcd store used by anchor.
76+
7577
There are three k-v stores used by the anchor ipam, they are:
7678

7779
| KV | Example | Explanation |
@@ -80,7 +82,7 @@ There are three k-v stores used by the anchor ipam, they are:
8082
| Subnet -> Gateway | /anchor/gw/10.0.1.0/24 -> 10.0.1.1 | The map between subnet and its gateway |
8183
| Container -> IP | /anchor/cn/212b... -> 10.0.1.2 | The IP binding with the ContainerID |
8284

83-
At the beginning, the stores are empty, so just input some data according to the environment.
85+
At the beginning, the stores are empty, so just input some data following the environment.
8486

8587
I have created a WebUI named [Powder monkey](https://github.com/hainesc/powder) to display and operate the k-v stores. The frontend is written in Angular and the backend written in Golang.
8688

@@ -96,7 +98,7 @@ Edit L14 and choose a subnet for it, then Run:
9698
kubectl apply -f anchor-2048.yaml
9799
```
98100

99-
Wait for the installation to complete, it will create a deployment named anchor-2048 and the service named anchor-2048.
101+
Wait for the installation to complete, it will create a deployment named anchor-2048 and a service named anchor-2048.
100102

101103
```shell
102104
kubectl get pods -n default -o wide

examples/anchor-2048.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
spec:
1616
containers:
1717
- name: anchor-2048
18-
image: blackicebird/2048
18+
image: alexwhen/docker-2048
1919
ports:
2020
- containerPort: 80
2121
---

0 commit comments

Comments
 (0)