init
This commit is contained in:
64
1.rke/cluster.yml
Normal file
64
1.rke/cluster.yml
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
cluster_name: k8s-nsk
|
||||||
|
# kubernetes_version: v1.23.15-rancher1-1
|
||||||
|
|
||||||
|
ignore_docker_version: true
|
||||||
|
|
||||||
|
nodes:
|
||||||
|
- address: 192.168.9.101
|
||||||
|
hostname_override: node1
|
||||||
|
user: root
|
||||||
|
labels:
|
||||||
|
worker: yes
|
||||||
|
ingress: yes
|
||||||
|
location: nsk
|
||||||
|
role: [controlplane, worker, etcd]
|
||||||
|
- address: 192.168.9.102
|
||||||
|
hostname_override: node2
|
||||||
|
user: root
|
||||||
|
labels:
|
||||||
|
worker: yes
|
||||||
|
ingress: yes
|
||||||
|
location: nsk
|
||||||
|
role: [controlplane, worker, etcd]
|
||||||
|
- address: 192.168.9.103
|
||||||
|
hostname_override: node3
|
||||||
|
user: root
|
||||||
|
labels:
|
||||||
|
worker: yes
|
||||||
|
ingress: yes
|
||||||
|
location: nsk
|
||||||
|
role: [controlplane, worker, etcd]
|
||||||
|
|
||||||
|
services:
|
||||||
|
etcd:
|
||||||
|
snapshot: true
|
||||||
|
creation: 6h
|
||||||
|
retention: 30h
|
||||||
|
kube-controller:
|
||||||
|
extra_args:
|
||||||
|
terminated-pod-gc-threshold: 100
|
||||||
|
kubelet:
|
||||||
|
extra_binds:
|
||||||
|
- "/usr/lib/modules:/usr/lib/modules"
|
||||||
|
- "/var/lib/piraeus-datastore:/var/lib/piraeus-datastore"
|
||||||
|
- "/usr/src:/usr/src"
|
||||||
|
|
||||||
|
# authentication:
|
||||||
|
# strategy: x509
|
||||||
|
# sans:
|
||||||
|
# - "rke.domain.ru"
|
||||||
|
|
||||||
|
ingress:
|
||||||
|
provider: nginx
|
||||||
|
node_selector:
|
||||||
|
ingress: yes
|
||||||
|
tolerations:
|
||||||
|
- key: node-role.kubernetes.io/controlplane
|
||||||
|
operator: Exists
|
||||||
|
effect: NoSchedule
|
||||||
|
- key: node-role.kubernetes.io/etcd
|
||||||
|
operator: Exists
|
||||||
|
effect: NoExecute
|
||||||
|
extra_args:
|
||||||
|
http-port: 80
|
||||||
|
https-port: 443
|
86
README.md
Normal file
86
README.md
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
# Разворачиваем Linstor-кластере в kubernetes (piraeus)
|
||||||
|
|
||||||
|
## Что понадобиться
|
||||||
|
|
||||||
|
* rke up
|
||||||
|
* три тестовые ноды (ubuntu 22.04) с предустановленным кубом (предлагаю через rke)
|
||||||
|
* helm
|
||||||
|
* lens
|
||||||
|
|
||||||
|
## Что надо учесть
|
||||||
|
|
||||||
|
наличие headers на всех рабочих нодах, где будет разпускаться сателлиты
|
||||||
|
|
||||||
|
```bash
|
||||||
|
apt-get update && apt-get install -y linux-headers-$(uname -r)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Ставим оператор
|
||||||
|
|
||||||
|
* kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.10.0/cert-manager.yaml
|
||||||
|
* kubectl apply --server-side -k "https://github.com/piraeusdatastore/piraeus-operator//config/default?ref=v2.0.1"
|
||||||
|
|
||||||
|
## Создаем кластер и зависимости
|
||||||
|
|
||||||
|
создаем сам кластер:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
apiVersion: piraeus.io/v1
|
||||||
|
kind: LinstorCluster
|
||||||
|
metadata:
|
||||||
|
name: linstorcluster
|
||||||
|
spec:
|
||||||
|
nodeSelector:
|
||||||
|
orc_worker: 'yes'
|
||||||
|
```
|
||||||
|
|
||||||
|
создаем стародж:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
apiVersion: piraeus.io/v1
|
||||||
|
kind: LinstorSatelliteConfiguration
|
||||||
|
metadata:
|
||||||
|
name: storage-pool
|
||||||
|
spec:
|
||||||
|
storagePools:
|
||||||
|
- name: pool1
|
||||||
|
fileThinPool:
|
||||||
|
directory: /var/lib/piraeus-datastore/pool1
|
||||||
|
```
|
||||||
|
|
||||||
|
создаем сторадж-класс:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
apiVersion: storage.k8s.io/v1
|
||||||
|
kind: StorageClass
|
||||||
|
metadata:
|
||||||
|
name: piraeus-storage-replicated
|
||||||
|
provisioner: linstor.csi.linbit.com
|
||||||
|
allowVolumeExpansion: true
|
||||||
|
volumeBindingMode: WaitForFirstConsumer
|
||||||
|
parameters:
|
||||||
|
linstor.csi.linbit.com/storagePool: pool1
|
||||||
|
linstor.csi.linbit.com/placementCount: "2"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Создать тестовый деплой на примере мониторинга кластера
|
||||||
|
|
||||||
|
применяем конфигурацию lens-monitoring
|
||||||
|
|
||||||
|
## Полезные cli-команды списком
|
||||||
|
|
||||||
|
```bash
|
||||||
|
linstor node list
|
||||||
|
linstor storage-pool list
|
||||||
|
linstor resource list-volumes
|
||||||
|
```
|
||||||
|
|
||||||
|
## Видео к курсу
|
||||||
|
|
||||||
|
* [видео]()
|
||||||
|
|
||||||
|
##### Автор
|
||||||
|
|
||||||
|
* **Vassiliy Yegorov**
|
||||||
|
* [сайт](https://realmanual.ru)
|
||||||
|
* [youtube](https://youtube.com/realmanual)
|
Reference in New Issue
Block a user