Skip to content

Commit

Permalink
add kind and rke setup
Browse files Browse the repository at this point in the history
  • Loading branch information
maguowei committed Aug 17, 2019
1 parent b5bb786 commit f76b1e7
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 0 deletions.
19 changes: 19 additions & 0 deletions content/setup/kind/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# kind

- [kubernetes-sigs/kind](https://github.com/kubernetes-sigs/kind)

```bash
curl -Lo ./kind-darwin-amd64 https://github.com/kubernetes-sigs/kind/releases/download/v0.4.0/kind-darwin-amd64
chmod +x ./kind-darwin-amd64
mv ./kind-darwin-amd64 /user/local/bin/kind

# 创建集群
kind create cluster --config config.yaml

# 使用
export KUBECONFIG="$(kind get kubeconfig-path --name="kind")"
kubectl get pod -A

#删除集群
kind delete cluster
```
21 changes: 21 additions & 0 deletions content/setup/kind/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
kind: Cluster
apiVersion: kind.sigs.k8s.io/v1alpha3
kubeadmConfigPatches:
- |
apiVersion: kubeadm.k8s.io/v1beta2
kind: InitConfiguration
metadata:
name: config
nodeRegistration:
kubeletExtraArgs:
pod-infra-container-image: gotok8s/pause:3.1
- |
apiVersion: kubeadm.k8s.io/v1beta2
kind: ClusterConfiguration
metadata:
name: config
imageRepository: gotok8s
nodes:
- role: control-plane
- role: worker
- role: worker
21 changes: 21 additions & 0 deletions content/setup/rke/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# RKE

## Install Rancher

```bash
$ docker run --name rancher -d --restart=unless-stopped \
-p 8080:80 -p 8443:443 \
-v rancher:/var/lib/rancher \
rancher/rancher:latest
```

## Install RKE

- [rancher/rke releases](https://github.com/rancher/rke/releases)

```bash
# add .ssh/id_rsa.pub to server .ssh/authorized_keys
$ brew install rke
$ rke up
$ rke remove
```
12 changes: 12 additions & 0 deletions content/setup/rke/cluster.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
nodes:
- address: x.x.x.x
user: maguowei
role:
- controlplane
- worker
- etcd

cluster_name: rke
kubernetes_version: v1.15.2-rancher1-1
network:
plugin: flannel
File renamed without changes.
Empty file removed cookbook/setup/kind.md
Empty file.
Empty file removed cookbook/setup/rke.md
Empty file.

0 comments on commit f76b1e7

Please sign in to comment.