[Kubernetes] Kubespray 구성 I > OpenShift 자료실

본문 바로가기
사이트 내 전체검색

OpenShift 자료실

[Kubernetes] Kubespray 구성 I

페이지 정보

profile_image
작성자 꿈꾸는여행자
댓글 0건 조회 801회 작성일 25-09-05 14:41

본문

안녕하세요.

 

꿈꾸는여행자입니다.

 

 

이번에는 Kubespray을 주제로 다루고자 합니다.

 

Kubespray를 구성하기 위한 환경구성을 먼저 진행합니다. 

> 다음 

 

1. 환경 구성 

    I. Overview

    II. Rocky Linux 9

                        

 

목차 

I. Overview

1. 구성도

II. Rocky Linux 9

1. Installing Rocky Linux 9

1.1. OS Installation Prerequisites

1.2. Verifying the Installer ISO File

1.3. The Installation

1.3.1. Use KVM Virtualization

1.3.1.1. Create a disk of Virtual Machine

1.3.1.2. Create a new virtual machine

1.3.2. Create KVM VM from Qcow2 with Command

1.3.2.1. Copy qcow2 file

1.3.2.2. Create VM

1.3.3. Create KVM VM from Qcow2 with Command

1.3.3.1. Copy qcow2 file

1.3.3.2. Create VM

1.3.4. Create KVM VM from Qcow2 with Command

1.3.4.1. Copy qcow2 file

1.3.4.2. Create VM


 

 


상세 내역은 아래와 같습니다.

 

감사합니다.  

 

> 아래 

 


________________



I. Overview

1. 구성도

https://kubespray.lds.internal:31183



  








________________



II. Rocky Linux 9

1. Installing Rocky Linux 9

https://docs.rockylinux.org/guides/installation/



1.1. OS Installation Prerequisites

* The latest ISO image for the version of Rocky Linux that we will be using for this installation can be downloaded from here:

   * https://www.rockylinux.org/download/

   * https://rockylinux.org/ko-KR/download

  






* To download the ISO directly from the command line on an existing Linux based system use the wget command:



wget \

https://download.rockylinux.org/pub/rocky/9/isos/x86_64/Rocky-9.6-x86_64-dvd.iso







1.2. Verifying the Installer ISO File

First download the file that contains the official checksums for the available ISOs. While still in the folder that contains the downloaded Rocky Linux ISO download the checksum file for the ISO, type:



  






wget \

https://download.rockylinux.org/pub/rocky/9/isos/x86_64/Rocky-9.6-x86_64-dvd.iso.CHECKSUM



* Use the sha256sum utility to verify the integrity of the ISO file against corruption and/or tampering.



sha256sum -c CHECKSUM --ignore-missing

[root@host ISO]# sha256sum -c Rocky-9.6-x86_64-dvd.iso.CHECKSUM --ignore-missing

Rocky-9.6-x86_64-dvd.iso: OK

[root@host ISO]#


1.3. The Installation

1.3.1. Use KVM Virtualization 

* On Host

1.3.1.1. Create a disk of Virtual Machine

* qemu-img 명령어 사용

   * 필요한 용량을 사용하기 위해 qemu-img 사용하여 qcow2 파일 생성 



cd /var/lib/libvirt/images



cd /data/libvirt/images/pool/



qemu-img create -f qcow2 rocky-linux-9.6.qcow2 100G



chown qemu:qemu rocky-linux-9.6.qcow2

[root@host ~]# cd /data/libvirt/images/pool/

[root@host pool]# pwd

/data/libvirt/images/pool

[root@host pool]# qemu-img create -f qcow2 rocky-linux-9.6.qcow2 100G

Formatting 'rocky-linux-9.6.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=107374182400 lazy_refcounts=off refcount_bits=16

[root@host pool]# chown qemu:qemu rocky-linux-9.6.qcow2

[root@host pool]#


1.3.1.2. Create a new virtual machine 

* Execute virt-manager

virt-manager

[root@host ~]# virt-manager

[root@host ~]#


* Create VM

   * virt-install 명령어를 사용 빠른 VM 생성 진행 

* Create VM Info

   * --graphics vnc 

      * vnc 사용 및 자동 port 할당 

   * --disk /data/libvirt/images/pool/rocky-linux-9.6.qcow2

      * 기존 생성한 Disk 사용 

   * --network network:default 

      * 사용할 network 

virt-install --os-variant list



virt-install \

    -n rocky96 \

    --description "Rocky Linux 96" \

    --os-variant=rocky9 \

    --ram=8192 \

    --vcpus=4 \

    --graphics vnc \

    --disk /data/libvirt/images/pool/rocky-linux-9.6.qcow2 \

    --network network:default \

    --cdrom=/data/libvirt/images/ISO/Rocky-9.6-x86_64-dvd.iso \

    --noautoconsole

[root@host pool]# virt-install \

    -n rocky96 \

    --description "Rocky Linux 96" \

    --os-variant=rocky9 \

    --ram=8192 \

    --vcpus=4 \

    --graphics vnc \

    --disk /data/libvirt/images/pool/rocky-linux-9.6.qcow2 \

    --network network:default \

    --cdrom=/data/libvirt/images/ISO/Rocky-9.6-x86_64-dvd.iso \

    --noautoconsole



Starting install...

Creating domain...                                                                 |         00:00:00     



Domain is still running. Installation may be in progress.

You can reconnect to the console to complete the installation process.

[root@host pool]#


* Rocky Linux 설치 

   * 기본 Rocky Linux 설치 내역을 참고 하여 설치 진행 

   * 설치 완료 



1.3.2. Create KVM VM from Qcow2 with Command 

* Rocky Linux 8.10 설치된 Image를 골드 이미지 형태로 사용

1.3.2.1. Copy qcow2 file 

* Copy and Set permission file

cp \

    /data/libvirt/images/pool/rocky-linux-9.6.qcow2 \

    /data/libvirt/images/pool/k8s-mst-00-rocky9.6.qcow2



chown qemu:qemu /data/libvirt/images/pool/k8s-mst-00-rocky9.6.qcow2



[root@host ~]# cp \

    /data/libvirt/images/pool/rocky-linux-9.6.qcow2 \

    /data/libvirt/images/pool/k8s-mst-00-rocky9.6.qcow2

[root@host ~]# chown qemu:qemu /data/libvirt/images/pool/k8s-mst-00-rocky9.6.qcow2

[root@host ~]#


1.3.2.2. Create VM

* Create VM by copied qcow2 file 

virt-install \

    --import \

    -n k8s-mst-00-rocky96 \

    --description "K8s Master 00 rocky 9.6" \

    --os-variant=rocky9 \

    --ram=8192 \

    --vcpus=4 \

    --graphics vnc \

    --disk /data/libvirt/images/pool/k8s-mst-00-rocky9.6.qcow2 \

    --network network:default \

    --noautoconsole



[root@host ~]# virt-install \

    --import \

    -n k8s-mst-00-rocky96 \

    --description "K8s Master 00 rocky 9.6" \

    --os-variant=rocky9 \

    --ram=8192 \

    --vcpus=4 \

    --graphics vnc \

    --disk /data/libvirt/images/pool/k8s-mst-00-rocky9.6.qcow2 \

    --network network:default \

    --noautoconsole



Starting install...

Creating domain...                                                                      |         00:00:00     

Domain creation completed.

[root@host ~]#


1.3.3. Create KVM VM from Qcow2 with Command 

* Rocky Linux 8.10 설치된 Image를 골드 이미지 형태로 사용

1.3.3.1. Copy qcow2 file 

* Copy and Set permission file

cp \

    /data/libvirt/images/pool/rocky-linux-9.6.qcow2 \

    /data/libvirt/images/pool/k8s-wkr-01-rocky9.6.qcow2



chown qemu:qemu /data/libvirt/images/pool/k8s-wkr-01-rocky9.6.qcow2



[root@host ~]# cp \

    /data/libvirt/images/pool/rocky-linux-9.6.qcow2 \

    /data/libvirt/images/pool/k8s-wkr-01-rocky9.6.qcow2

[root@host ~]# chown qemu:qemu /data/libvirt/images/pool/k8s-wkr-01-rocky9.6.qcow2

[root@host ~]#


1.3.3.2. Create VM

* Create VM by copied qcow2 file 

virt-install \

    --import \

    -n k8s-wkr-01-rocky96 \

    --description "K8s Worker 01 rocky 9.6" \

    --os-variant=rocky9 \

    --ram=8192 \

    --vcpus=4 \

    --graphics vnc \

    --disk /data/libvirt/images/pool/k8s-wkr-01-rocky9.6.qcow2 \

    --network network:default \

    --noautoconsole



[root@host ~]# virt-install \

    --import \

    -n k8s-wkr-01-rocky96 \

    --description "K8s Worker 01 rocky 9.6" \

    --os-variant=rocky9 \

    --ram=8192 \

    --vcpus=4 \

    --graphics vnc \

    --disk /data/libvirt/images/pool/k8s-wkr-01-rocky9.6.qcow2 \

    --network network:default \

    --noautoconsole



Starting install...

Creating domain...                                                                      |         00:00:00     

Domain creation completed.

[root@host ~]#




1.3.4. Create KVM VM from Qcow2 with Command 

* Rocky Linux 8.10 설치된 Image를 골드 이미지 형태로 사용

 

1.3.4.1. Copy qcow2 file 


- Copy and Set permission file


cp \

    /data/libvirt/images/pool/rocky-linux-9.6.qcow2 \

    /data/libvirt/images/pool/k8s-wkr-02-rocky9.6.qcow2



chown qemu:qemu /data/libvirt/images/pool/k8s-wkr-02-rocky9.6.qcow2



[root@host ~]# cp \

    /data/libvirt/images/pool/rocky-linux-9.6.qcow2 \

    /data/libvirt/images/pool/k8s-wkr-02-rocky9.6.qcow2

[root@host ~]# chown qemu:qemu /data/libvirt/images/pool/k8s-wkr-02-rocky9.6.qcow2

[root@host ~]#


1.3.4.2. Create VM

- Create VM by copied qcow2 file 


virt-install \

    --import \

    -n k8s-wkr-02-rocky96 \

    --description "K8s Worker 02 rocky 9.6" \

    --os-variant=rocky9 \

    --ram=8192 \

    --vcpus=4 \

    --graphics vnc \

    --disk /data/libvirt/images/pool/k8s-wkr-02-rocky9.6.qcow2 \

    --network network:default \

    --noautoconsole



[root@host ~]# virt-install \

    --import \

    -n k8s-wkr-02-rocky96 \

    --description "K8s Worker 02 rocky 9.6" \

    --os-variant=rocky9 \

    --ram=8192 \

    --vcpus=4 \

    --graphics vnc \

    --disk /data/libvirt/images/pool/k8s-wkr-02-rocky9.6.qcow2 \

    --network network:default \

    --noautoconsole



Starting install...

Creating domain...                                                                      |         00:00:00     

Domain creation completed.

[root@host ~]#




 


 

 

댓글목록

등록된 댓글이 없습니다.

회원로그인

회원가입

사이트 정보

회사명 : (주)리눅스데이타시스템
대표이사 : 정정모
본사 : 강남구 봉은사로 114길 40 홍선빌딩 2층
- tel : 02-6207-1160
대전지사 : 유성구 노은로174 도원프라자 5층
- tel : 042-331-1161

접속자집계

오늘
2,109
어제
2,585
최대
8,445
전체
2,034,319
Copyright © www.linuxdata.org All rights reserved.