longhorn nummer 2
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
ports:
|
ports:
|
||||||
web:
|
web:
|
||||||
<<<<<<< HEAD
|
|
||||||
redirections:
|
redirections:
|
||||||
entryPoint:
|
entryPoint:
|
||||||
to: websecure
|
to: websecure
|
||||||
@@ -8,14 +7,6 @@ ports:
|
|||||||
logs:
|
logs:
|
||||||
general:
|
general:
|
||||||
level: DEBUG
|
level: DEBUG
|
||||||
=======
|
|
||||||
redirections:
|
|
||||||
entryPoint:
|
|
||||||
to: websecure
|
|
||||||
scheme: https
|
|
||||||
permanent: true
|
|
||||||
|
|
||||||
>>>>>>> 1b0f340 (neu ist der mai)
|
|
||||||
ingressRoute:
|
ingressRoute:
|
||||||
dashboard:
|
dashboard:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|||||||
@@ -5,15 +5,26 @@ Hier sind die Schritte, um ein Persistent Volume für Longhorn zu erstellen:
|
|||||||
### 1. Stelle sicher, dass Longhorn installiert ist
|
### 1. Stelle sicher, dass Longhorn installiert ist
|
||||||
Zuerst solltest du sicherstellen, dass Longhorn auf deinem Cluster installiert ist. Falls Longhorn noch nicht installiert ist, kannst du es mit Helm oder direkt aus den YAML-Dateien installieren.
|
Zuerst solltest du sicherstellen, dass Longhorn auf deinem Cluster installiert ist. Falls Longhorn noch nicht installiert ist, kannst du es mit Helm oder direkt aus den YAML-Dateien installieren.
|
||||||
|
|
||||||
|
|
||||||
|
#### Node Labeling
|
||||||
|
|
||||||
|
In the case not all nodes should provide disk
|
||||||
|
```
|
||||||
|
k label nodes k3s-prod-worker-{1..3} node.longhorn.io/create-default-disk=true
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### Mit Helm:
|
#### Mit Helm:
|
||||||
```bash
|
```bash
|
||||||
helm repo add longhorn https://charts.longhorn.io
|
helm repo add longhorn https://charts.longhorn.io
|
||||||
helm install longhorn longhorn/longhorn --namespace longhorn-system --create-namespace
|
helm install longhorn longhorn/longhorn --namespace longhorn-system --create-namespace --values longhorn-values.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Mit kubectl:
|
|
||||||
```bash
|
### Check via UI
|
||||||
kubectl apply -f https://raw.githubusercontent.com/longhorn/longhorn/v1.2.2/deploy/install.yaml
|
```
|
||||||
|
k port-forward svc/longhorn-frontend 8000:80 -n longhorn-system
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2. Erstelle ein PersistentVolume (PV) und ein PersistentVolumeClaim (PVC)
|
### 2. Erstelle ein PersistentVolume (PV) und ein PersistentVolumeClaim (PVC)
|
||||||
|
|||||||
@@ -1,15 +1,13 @@
|
|||||||
---
|
|
||||||
apiVersion: traefik.io/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: IngressRoute
|
kind: IngressRoute
|
||||||
metadata:
|
metadata:
|
||||||
name: longhorn-web-ui
|
name: longhorn-ingress-route
|
||||||
namespace: longhorn-system
|
namespace: longhorn-system
|
||||||
spec:
|
spec:
|
||||||
properties:
|
entryPoints:
|
||||||
entrypoints:
|
- websecure
|
||||||
- websecure
|
|
||||||
routes:
|
routes:
|
||||||
- match: Host(`longhorn.k8s.internal.schnrbs.work`)
|
- match: Host(`longhorn-dashboard.k8s.schnrbs.work`)
|
||||||
kind: Rule
|
kind: Rule
|
||||||
services:
|
services:
|
||||||
- name: longhorn-frontend
|
- name: longhorn-frontend
|
||||||
|
|||||||
@@ -1,2 +1,36 @@
|
|||||||
|
global:
|
||||||
|
nodeSelector:
|
||||||
|
node.longhorn.io/create-default-disk: "true"
|
||||||
|
|
||||||
|
service:
|
||||||
|
ui:
|
||||||
|
type: NodePort
|
||||||
|
nodePort: 30050
|
||||||
|
manager:
|
||||||
|
type: ClusterIP
|
||||||
|
|
||||||
|
# Replica count for the default Longhorn StorageClass.
|
||||||
|
persistence:
|
||||||
|
defaultClass: false
|
||||||
|
defaultFsType: ext4
|
||||||
|
defaultClassReplicaCount: 2
|
||||||
|
reclaimPolicy: Delete
|
||||||
|
|
||||||
|
# Replica counts for CSI Attacher, Provisioner, Resizer, Snapshotter
|
||||||
|
csi:
|
||||||
|
attacherReplicaCount: 2
|
||||||
|
provisionerReplicaCount: 2
|
||||||
|
resizerReplicaCount: 2
|
||||||
|
snapshotterReplicaCount: 2
|
||||||
|
|
||||||
|
# Default replica count and storage path
|
||||||
|
defaultSettings:
|
||||||
|
upgradeChecker: false
|
||||||
|
kubernetesClusterAutoscalerEnabled: false
|
||||||
|
allowCollectingLonghornUsageMetrics: false
|
||||||
|
createDefaultDiskLabeledNodes: true
|
||||||
|
defaultReplicaCount: 2
|
||||||
|
defaultDataPath: "/k8s-data"
|
||||||
|
|
||||||
longhornUI:
|
longhornUI:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
|
|||||||
28
longhorn/test/pod-uses-pvc.yaml
Normal file
28
longhorn/test/pod-uses-pvc.yaml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: longhorn-pod
|
||||||
|
namespace: default
|
||||||
|
spec:
|
||||||
|
nodeName: k8s-worker3
|
||||||
|
restartPolicy: Always
|
||||||
|
containers:
|
||||||
|
- name: nginx
|
||||||
|
image: nginx:stable-alpine
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
livenessProbe:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- ls
|
||||||
|
- /data/lost+found
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
periodSeconds: 5
|
||||||
|
volumeMounts:
|
||||||
|
- name: volv
|
||||||
|
mountPath: /data
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
|
volumes:
|
||||||
|
- name: volv
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: longhorn-pvc
|
||||||
13
longhorn/test/pvc.yaml
Normal file
13
longhorn/test/pvc.yaml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: longhorn-pvc
|
||||||
|
namespace: default
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
storageClassName: longhorn
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 2Gi
|
||||||
Reference in New Issue
Block a user