Longhorn (v1.0) with Rancher
8598 단어 rancher롱혼kubernetes
소개
이번에는 Rancher에서 Longhorn (v1.0)입니다.
이전 기사에서도 다루었지만, 이번은 정식 릴리스 버전에서 시도하려고합니다.
※이전의 기사(v0.8): Longhorn with Rancher
구성
VM
CentOS: 7.6
docker-ce: 18.09
kubernetes: 1.18
Rancher: 2.4.6
Rancher & k8s
Rancher & k8s controller/etcd x1
k8s worker x3
롱혼: 1.0.2
※worker에는 스토리지로서/(8G) 외에 docker(50G), longhorn(50G)을 첨부
이전 준비
먼저 필요한 패키지를 설치합니다.
필수 패키지 설치$ yum install iscsi-initiator-utils -y
디스크, 마운트 구성은 다음과 같습니다.
※ 이전 기사의 변경 사항으로 Longhorn의 기본 디렉토리에 변경이 있었으므로,
마운트 포인트의 경로를 "/var/lib/rancher/longhorn"에서 "/var/lib/longhorn"으로 변경하고 있습니다.
디렉토리 구성$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 8G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 7G 0 part
├─centos-root 253:0 0 6.2G 0 lvm /
└─centos-swap 253:1 0 820M 0 lvm [SWAP]
sdb 8:16 0 50G 0 disk
└─sdb1 8:17 0 50G 0 part
└─var-docker 253:2 0 50G 0 lvm /var/lib/docker
sdc 8:32 0 50G 0 disk
└─sdc1 8:33 0 50G 0 part
└─longhorn-data 253:3 0 50G 0 lvm /var/lib/longhorn
Deploy
Rancher 의 library catalog 에 포함되어 있으므로, 「apps」⇒「기동」에서 Deploy 합니다.
Longhorn을 선택하면 다음 화면이 표시됩니다.
템플릿 버전은 "1.0.2"입니다.
이전 기사에서는 「Kubelet Root Directory」를 설정하지 않으면 기동하지 않았습니다만, 이번은 지정하지 않고 기동했습니다.

Dashboard(관리 화면) 액세스 방법을 NodePort로 지정합니다.

시작을 클릭하면 배포가 시작됩니다.
Apps

워크로드

테스트
테스트를 위해 PV/PVC를 만들어 포드에 장착하십시오.
pvc.yamlapiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: tmp
namespace: default
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: longhorn
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mnt
namespace: default
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 3Gi
storageClassName: longhorn
pv, pvc 만들기$ kubectl apply -f pvc.yaml
persistentvolumeclaim/tmp created
persistentvolumeclaim/mnt created
$ kubectl get pvc,pv
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
persistentvolumeclaim/mnt Bound pvc-xxxxx 3Gi RWO longhorn 20s
persistentvolumeclaim/tmp Bound pvc-yyyyy 1Gi RWO longhorn 20s
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
persistentvolume/pvc-xxxxx 3Gi RWO Delete Bound default/mnt longhorn 13s
persistentvolume/pvc-yyyyy 1Gi RWO Delete Bound default/tmp longhorn 13s
pv/pvc 를 만들 수 있었으므로, Pod 에 마운트 해 봅시다.
pod.yamlapiVersion: v1
kind: Pod
metadata:
name: alpine
namespace: default
spec:
containers:
- image: alpine:edge
name: alpine
volumeMounts:
- mountPath: /mnt
name: mnt
- mountPath: /tmp
name: tmp
tty: true
volumes:
- name: mnt
persistentVolumeClaim:
claimName: mnt
- name: tmp
persistentVolumeClaim:
claimName: tmp
pod 작성$ kubectl apply -f pod.yaml
pod/alpine created
$ kubectl get pod
NAME READY STATUS RESTARTS AGE
alpine 1/1 Running 0 33s
$ kubectl exec alpine -- df -hT /mnt /tmp
Filesystem Type Size Used Available Use% Mounted on
/dev/longhorn/pvc-xxxxx ext4 975.9M 2.5M 957.4M 0% /tmp
/dev/longhorn/pvc-yyyyy ext4 2.9G 9.0M 2.9G 0% /mnt
무사히 pv/pvc가 만들어졌으며 포드에 마운트 할 수있었습니다.
결론
정식판이 되었습니다만, 여전히 심플하고 사용하기 쉽습니다.
PV/PVC를 쉽게 준비할 수 있는 것은 매력적이라고 생각합니다.
이번에는 Rancher의 관리 화면에서 배포했지만 helm 버전도 있으므로 helm을 사용하는 분은 아래에서 시도 할 수 있습니다.
ぉtps://ぉggrr. 이오/도 cs/1.0.2/에서 pぉy/인 s 탓 l/인 s 탓 l우우 th-에 lm/
Reference
이 문제에 관하여(Longhorn (v1.0) with Rancher), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/t_ume/items/a6bbb920238ec8b3d47f
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
VM
CentOS: 7.6
docker-ce: 18.09
kubernetes: 1.18
Rancher: 2.4.6
Rancher & k8s
Rancher & k8s controller/etcd x1
k8s worker x3
롱혼: 1.0.2
※worker에는 스토리지로서/(8G) 외에 docker(50G), longhorn(50G)을 첨부
이전 준비
먼저 필요한 패키지를 설치합니다.
필수 패키지 설치$ yum install iscsi-initiator-utils -y
디스크, 마운트 구성은 다음과 같습니다.
※ 이전 기사의 변경 사항으로 Longhorn의 기본 디렉토리에 변경이 있었으므로,
마운트 포인트의 경로를 "/var/lib/rancher/longhorn"에서 "/var/lib/longhorn"으로 변경하고 있습니다.
디렉토리 구성$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 8G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 7G 0 part
├─centos-root 253:0 0 6.2G 0 lvm /
└─centos-swap 253:1 0 820M 0 lvm [SWAP]
sdb 8:16 0 50G 0 disk
└─sdb1 8:17 0 50G 0 part
└─var-docker 253:2 0 50G 0 lvm /var/lib/docker
sdc 8:32 0 50G 0 disk
└─sdc1 8:33 0 50G 0 part
└─longhorn-data 253:3 0 50G 0 lvm /var/lib/longhorn
Deploy
Rancher 의 library catalog 에 포함되어 있으므로, 「apps」⇒「기동」에서 Deploy 합니다.
Longhorn을 선택하면 다음 화면이 표시됩니다.
템플릿 버전은 "1.0.2"입니다.
이전 기사에서는 「Kubelet Root Directory」를 설정하지 않으면 기동하지 않았습니다만, 이번은 지정하지 않고 기동했습니다.

Dashboard(관리 화면) 액세스 방법을 NodePort로 지정합니다.

시작을 클릭하면 배포가 시작됩니다.
Apps

워크로드

테스트
테스트를 위해 PV/PVC를 만들어 포드에 장착하십시오.
pvc.yamlapiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: tmp
namespace: default
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: longhorn
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mnt
namespace: default
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 3Gi
storageClassName: longhorn
pv, pvc 만들기$ kubectl apply -f pvc.yaml
persistentvolumeclaim/tmp created
persistentvolumeclaim/mnt created
$ kubectl get pvc,pv
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
persistentvolumeclaim/mnt Bound pvc-xxxxx 3Gi RWO longhorn 20s
persistentvolumeclaim/tmp Bound pvc-yyyyy 1Gi RWO longhorn 20s
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
persistentvolume/pvc-xxxxx 3Gi RWO Delete Bound default/mnt longhorn 13s
persistentvolume/pvc-yyyyy 1Gi RWO Delete Bound default/tmp longhorn 13s
pv/pvc 를 만들 수 있었으므로, Pod 에 마운트 해 봅시다.
pod.yamlapiVersion: v1
kind: Pod
metadata:
name: alpine
namespace: default
spec:
containers:
- image: alpine:edge
name: alpine
volumeMounts:
- mountPath: /mnt
name: mnt
- mountPath: /tmp
name: tmp
tty: true
volumes:
- name: mnt
persistentVolumeClaim:
claimName: mnt
- name: tmp
persistentVolumeClaim:
claimName: tmp
pod 작성$ kubectl apply -f pod.yaml
pod/alpine created
$ kubectl get pod
NAME READY STATUS RESTARTS AGE
alpine 1/1 Running 0 33s
$ kubectl exec alpine -- df -hT /mnt /tmp
Filesystem Type Size Used Available Use% Mounted on
/dev/longhorn/pvc-xxxxx ext4 975.9M 2.5M 957.4M 0% /tmp
/dev/longhorn/pvc-yyyyy ext4 2.9G 9.0M 2.9G 0% /mnt
무사히 pv/pvc가 만들어졌으며 포드에 마운트 할 수있었습니다.
결론
정식판이 되었습니다만, 여전히 심플하고 사용하기 쉽습니다.
PV/PVC를 쉽게 준비할 수 있는 것은 매력적이라고 생각합니다.
이번에는 Rancher의 관리 화면에서 배포했지만 helm 버전도 있으므로 helm을 사용하는 분은 아래에서 시도 할 수 있습니다.
ぉtps://ぉggrr. 이오/도 cs/1.0.2/에서 pぉy/인 s 탓 l/인 s 탓 l우우 th-에 lm/
Reference
이 문제에 관하여(Longhorn (v1.0) with Rancher), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/t_ume/items/a6bbb920238ec8b3d47f
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
$ yum install iscsi-initiator-utils -y
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 8G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 7G 0 part
├─centos-root 253:0 0 6.2G 0 lvm /
└─centos-swap 253:1 0 820M 0 lvm [SWAP]
sdb 8:16 0 50G 0 disk
└─sdb1 8:17 0 50G 0 part
└─var-docker 253:2 0 50G 0 lvm /var/lib/docker
sdc 8:32 0 50G 0 disk
└─sdc1 8:33 0 50G 0 part
└─longhorn-data 253:3 0 50G 0 lvm /var/lib/longhorn
Rancher 의 library catalog 에 포함되어 있으므로, 「apps」⇒「기동」에서 Deploy 합니다.
Longhorn을 선택하면 다음 화면이 표시됩니다.
템플릿 버전은 "1.0.2"입니다.
이전 기사에서는 「Kubelet Root Directory」를 설정하지 않으면 기동하지 않았습니다만, 이번은 지정하지 않고 기동했습니다.

Dashboard(관리 화면) 액세스 방법을 NodePort로 지정합니다.

시작을 클릭하면 배포가 시작됩니다.
Apps

워크로드

테스트
테스트를 위해 PV/PVC를 만들어 포드에 장착하십시오.
pvc.yamlapiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: tmp
namespace: default
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: longhorn
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mnt
namespace: default
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 3Gi
storageClassName: longhorn
pv, pvc 만들기$ kubectl apply -f pvc.yaml
persistentvolumeclaim/tmp created
persistentvolumeclaim/mnt created
$ kubectl get pvc,pv
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
persistentvolumeclaim/mnt Bound pvc-xxxxx 3Gi RWO longhorn 20s
persistentvolumeclaim/tmp Bound pvc-yyyyy 1Gi RWO longhorn 20s
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
persistentvolume/pvc-xxxxx 3Gi RWO Delete Bound default/mnt longhorn 13s
persistentvolume/pvc-yyyyy 1Gi RWO Delete Bound default/tmp longhorn 13s
pv/pvc 를 만들 수 있었으므로, Pod 에 마운트 해 봅시다.
pod.yamlapiVersion: v1
kind: Pod
metadata:
name: alpine
namespace: default
spec:
containers:
- image: alpine:edge
name: alpine
volumeMounts:
- mountPath: /mnt
name: mnt
- mountPath: /tmp
name: tmp
tty: true
volumes:
- name: mnt
persistentVolumeClaim:
claimName: mnt
- name: tmp
persistentVolumeClaim:
claimName: tmp
pod 작성$ kubectl apply -f pod.yaml
pod/alpine created
$ kubectl get pod
NAME READY STATUS RESTARTS AGE
alpine 1/1 Running 0 33s
$ kubectl exec alpine -- df -hT /mnt /tmp
Filesystem Type Size Used Available Use% Mounted on
/dev/longhorn/pvc-xxxxx ext4 975.9M 2.5M 957.4M 0% /tmp
/dev/longhorn/pvc-yyyyy ext4 2.9G 9.0M 2.9G 0% /mnt
무사히 pv/pvc가 만들어졌으며 포드에 마운트 할 수있었습니다.
결론
정식판이 되었습니다만, 여전히 심플하고 사용하기 쉽습니다.
PV/PVC를 쉽게 준비할 수 있는 것은 매력적이라고 생각합니다.
이번에는 Rancher의 관리 화면에서 배포했지만 helm 버전도 있으므로 helm을 사용하는 분은 아래에서 시도 할 수 있습니다.
ぉtps://ぉggrr. 이오/도 cs/1.0.2/에서 pぉy/인 s 탓 l/인 s 탓 l우우 th-에 lm/
Reference
이 문제에 관하여(Longhorn (v1.0) with Rancher), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/t_ume/items/a6bbb920238ec8b3d47f
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: tmp
namespace: default
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: longhorn
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mnt
namespace: default
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 3Gi
storageClassName: longhorn
$ kubectl apply -f pvc.yaml
persistentvolumeclaim/tmp created
persistentvolumeclaim/mnt created
$ kubectl get pvc,pv
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
persistentvolumeclaim/mnt Bound pvc-xxxxx 3Gi RWO longhorn 20s
persistentvolumeclaim/tmp Bound pvc-yyyyy 1Gi RWO longhorn 20s
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
persistentvolume/pvc-xxxxx 3Gi RWO Delete Bound default/mnt longhorn 13s
persistentvolume/pvc-yyyyy 1Gi RWO Delete Bound default/tmp longhorn 13s
apiVersion: v1
kind: Pod
metadata:
name: alpine
namespace: default
spec:
containers:
- image: alpine:edge
name: alpine
volumeMounts:
- mountPath: /mnt
name: mnt
- mountPath: /tmp
name: tmp
tty: true
volumes:
- name: mnt
persistentVolumeClaim:
claimName: mnt
- name: tmp
persistentVolumeClaim:
claimName: tmp
$ kubectl apply -f pod.yaml
pod/alpine created
$ kubectl get pod
NAME READY STATUS RESTARTS AGE
alpine 1/1 Running 0 33s
$ kubectl exec alpine -- df -hT /mnt /tmp
Filesystem Type Size Used Available Use% Mounted on
/dev/longhorn/pvc-xxxxx ext4 975.9M 2.5M 957.4M 0% /tmp
/dev/longhorn/pvc-yyyyy ext4 2.9G 9.0M 2.9G 0% /mnt
정식판이 되었습니다만, 여전히 심플하고 사용하기 쉽습니다.
PV/PVC를 쉽게 준비할 수 있는 것은 매력적이라고 생각합니다.
이번에는 Rancher의 관리 화면에서 배포했지만 helm 버전도 있으므로 helm을 사용하는 분은 아래에서 시도 할 수 있습니다.
ぉtps://ぉggrr. 이오/도 cs/1.0.2/에서 pぉy/인 s 탓 l/인 s 탓 l우우 th-에 lm/
Reference
이 문제에 관하여(Longhorn (v1.0) with Rancher), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/t_ume/items/a6bbb920238ec8b3d47f텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)