mirror of
https://github.com/rancher/rke.git
synced 2025-08-31 22:46:25 +00:00
33
README.md
33
README.md
@@ -38,24 +38,13 @@ You can view full sample of cluster.yml [here](https://github.com/rancher/rke/bl
|
|||||||
### Minimal `cluster.yml` example
|
### Minimal `cluster.yml` example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
# default k8s version: v1.8.9-rancher1-1
|
||||||
|
# default network plugin: flannel
|
||||||
nodes:
|
nodes:
|
||||||
- address: 1.1.1.1
|
- address: 1.2.3.4
|
||||||
user: ubuntu
|
user: ubuntu
|
||||||
role: [controlplane,worker,etcd]
|
role: [controlplane,worker,etcd]
|
||||||
|
|
||||||
services:
|
|
||||||
etcd:
|
|
||||||
image: quay.io/coreos/etcd:latest
|
|
||||||
kube-api:
|
|
||||||
image: rancher/k8s:v1.8.3-rancher2
|
|
||||||
kube-controller:
|
|
||||||
image: rancher/k8s:v1.8.3-rancher2
|
|
||||||
scheduler:
|
|
||||||
image: rancher/k8s:v1.8.3-rancher2
|
|
||||||
kubelet:
|
|
||||||
image: rancher/k8s:v1.8.3-rancher2
|
|
||||||
kubeproxy:
|
|
||||||
image: rancher/k8s:v1.8.3-rancher2
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Network Plugins
|
## Network Plugins
|
||||||
@@ -105,7 +94,7 @@ There are extra options that can be specified for each network plugin:
|
|||||||
|
|
||||||
## Addons
|
## Addons
|
||||||
|
|
||||||
RKE support pluggable addons on cluster bootstrap, user can specify the addon yaml in the cluster.yml file, and when running
|
RKE supports pluggable addons on cluster bootstrap, user can specify the addon yaml in the cluster.yml file, and when running
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
rke up --config cluster.yml
|
rke up --config cluster.yml
|
||||||
@@ -152,13 +141,13 @@ to start an HA cluster, just specify more than one host with role `controlplane`
|
|||||||
|
|
||||||
## Adding/Removing Nodes
|
## Adding/Removing Nodes
|
||||||
|
|
||||||
RKE support adding/removing nodes for worker and controlplane hosts, in order to add additional nodes you will only need to update the `cluster.yml` file with additional nodes and run `rke up` with the same file.
|
RKE supports adding/removing nodes for worker and controlplane hosts, in order to add additional nodes you will only need to update the `cluster.yml` file with additional nodes and run `rke up` with the same file.
|
||||||
|
|
||||||
To remove nodes just remove them from the hosts list in the cluster configuration file `cluster.yml`, and re run `rke up` command.
|
To remove nodes just remove them from the hosts list in the cluster configuration file `cluster.yml`, and re run `rke up` command.
|
||||||
|
|
||||||
## Cluster Remove
|
## Cluster Remove
|
||||||
|
|
||||||
RKE support `rke remove` command, the command does the following:
|
RKE supports `rke remove` command, the command does the following:
|
||||||
|
|
||||||
- Connect to each host and remove the kubernetes services deployed on it.
|
- Connect to each host and remove the kubernetes services deployed on it.
|
||||||
- Clean each host from the directories left by the services:
|
- Clean each host from the directories left by the services:
|
||||||
@@ -172,7 +161,7 @@ Note that this command is irreversible and will destroy the kubernetes cluster e
|
|||||||
|
|
||||||
## Cluster Upgrade
|
## Cluster Upgrade
|
||||||
|
|
||||||
RKE support kubernetes cluster upgrade through changing the image version of services, in order to do that change the image option for each services, for example:
|
RKE supports kubernetes cluster upgrade through changing the image version of services, in order to do that change the image option for each services, for example:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
image: rancher/k8s:v1.8.2-rancher1
|
image: rancher/k8s:v1.8.2-rancher1
|
||||||
@@ -196,7 +185,7 @@ RKE will first look for the local `kube_config_cluster.yml` and then tries to up
|
|||||||
|
|
||||||
## RKE Config
|
## RKE Config
|
||||||
|
|
||||||
RKE support command `rke config` which generates a cluster config template for the user, to start using this command just write:
|
RKE supports command `rke config` which generates a cluster config template for the user, to start using this command just write:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
rke config --name mycluster.yml
|
rke config --name mycluster.yml
|
||||||
@@ -339,6 +328,12 @@ nodes:
|
|||||||
- worker
|
- worker
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Deploying Rancher 2.0 using rke
|
||||||
|
Using RKE's pluggable user addons, it's possible to deploy Rancher 2.0 server with a single command using the [rancher-minimal.yml](https://github.com/rancher/rke/blob/master/rancher-minimal.yml) cluster configuration:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
rke up --config rancher-minimal.yml
|
||||||
|
```
|
||||||
## Operating Systems Notes
|
## Operating Systems Notes
|
||||||
|
|
||||||
### Atomic OS
|
### Atomic OS
|
||||||
|
84
rancher-minimal.yml
Normal file
84
rancher-minimal.yml
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
# default k8s version: v1.8.9-rancher1-1
|
||||||
|
# default network plugin: flannel
|
||||||
|
nodes:
|
||||||
|
- address: 1.2.3.4
|
||||||
|
user: ubuntu
|
||||||
|
role: [controlplane,etcd,worker]
|
||||||
|
|
||||||
|
addons: |-
|
||||||
|
---
|
||||||
|
kind: Namespace
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: cattle-system
|
||||||
|
---
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
metadata:
|
||||||
|
name: cattle-crb
|
||||||
|
subjects:
|
||||||
|
- kind: User
|
||||||
|
name: system:serviceaccount:cattle-system:default
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
roleRef:
|
||||||
|
kind: ClusterRole
|
||||||
|
name: cluster-admin
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
namespace: cattle-system
|
||||||
|
name: cattle-service
|
||||||
|
labels:
|
||||||
|
app: cattle
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 80
|
||||||
|
targetPort: 80
|
||||||
|
protocol: TCP
|
||||||
|
name: http
|
||||||
|
- port: 443
|
||||||
|
targetPort: 443
|
||||||
|
protocol: TCP
|
||||||
|
name: https
|
||||||
|
selector:
|
||||||
|
app: cattle
|
||||||
|
---
|
||||||
|
apiVersion: extensions/v1beta1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
namespace: cattle-system
|
||||||
|
name: cattle-ingress-http
|
||||||
|
spec:
|
||||||
|
rules:
|
||||||
|
- http:
|
||||||
|
paths:
|
||||||
|
- backend:
|
||||||
|
serviceName: cattle-service
|
||||||
|
servicePort: 80
|
||||||
|
- backend:
|
||||||
|
serviceName: cattle-service
|
||||||
|
servicePort: 443
|
||||||
|
---
|
||||||
|
kind: Deployment
|
||||||
|
apiVersion: extensions/v1beta1
|
||||||
|
metadata:
|
||||||
|
namespace: cattle-system
|
||||||
|
name: cattle
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: cattle
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: rancher/server:master
|
||||||
|
imagePullPolicy: Always
|
||||||
|
name: cattle-server
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
|
protocol: TCP
|
||||||
|
- containerPort: 443
|
||||||
|
protocol: TCP
|
Reference in New Issue
Block a user