이쿠의 슬기로운 개발생활

함께 성장하기 위한 보안 개발자 EverNote 내용 공유

반응형

클라우드 60

Ansible 원격지 파일 가져오기 (fetch 모듈)

파일 가져오기 (fetch 모듈) managed node에서 control node로 파일 가져오기 fetch 모듈 사용. playbook 예제 --- - hosts: all remote_user: root become: true tasks: - name: file move to control node fetch: src: /temp/sample.txt dest: ./managedNodeFile.txt flat: yes "src:" 복사할 파일 경로 managed node 경로 "dest:" 붙여넣기할 파일 경로 control node 경로 "flat: yes" flat yes 설정을 하지 않으면 dest 경로에 src 경로전체가 복사됨. playbook 실행 ansible-playbook -i host..

Ansible command(shell) 실행

command(shell) 실행 (shell 모듈) playbook 예제 --- - hosts: all remote_user: root become: true tasks: - name: execute the script shell: ./test.sh args: chdir: /temp executable: /bin/bash "shell:" shell script 실행 "chdir" cd 명령과 동일함. 경로 이동. "executable:" 실행 shell을 변경함. shell 변경하지 않으면 default로 sh shell로 실행됨. playbook 실행 ansible-playbook -i host.ini ./testplaybook Managed node에서 결과 확인 script가 실행되서 sample...

Ansible file 전달 (copy 모듈)

managed node에 file 전달 (copy 모듈) 먼저 sample file을 생성함. test.sh 파일 #!/bin/bash echo "ansible playbook Test!!!!!" > sample.txt playbook 예제 --- - hosts: all remote_user: root become: true tasks: - name: store file to remote server copy: src: /root/ansible_test/temp/test.sh dest: /temp/test.sh "become: true" become은 특정 사용자로 전환(become)할지 여부확인 true 설정 시 sudo 명령과 동일함. 해당 설정 없으면 errno 13 permission denied..

Ansible directory 생성 (file 모듈)

managed node에 directory 생성 (file 모듈) playbook 예제 --- - hosts: all remote_user: root become: true tasks: - name: Creates directory file: path: /temp state: directory "become: true" 옵션 become은 특정 사용자로 전환(become)할지 여부확인 true 설정 시 sudo 명령과 동일함. 해당 설정 없으면 errno 13 permission denied 오류 발생함. "file: " state 사용 시 해당 경로에 directory가 없다면 directory 생성 playbook 실행 ansible-playbook -i host.ini ./testplaybook M..

OPA (Open Policy Agent) 프로젝트 리서치

OPA (Open Policy Agent) 리서치 목표 Open Policy Agent 리서치 프로젝트 소개 OPA란? OPA(Open Policy Agent)는 정책을 통합하여 적용/관리하도록 도와주는 오픈소스 프로젝트임. OPA는 현재 CNCF의 졸업 프로젝트(graduated project)로 클라우드 네이티브 정책의 사실상 표준으로 자리잡아 있음. OPA에서 말하는 정책이란? 정책이란 governance(거버넌스), 법적 요구사항 때문에 반드시 지켜져야 하는 정책도 있고 프로젝트를 동작하기 위한 정책 등 다양한 정책이 있음. 클라우드 생태계를 보면 많은 오픈소스 프로젝트들이 존재함 그리고 이러한 프로젝트들은 프로그램 동작을 위한 자체적인 정책을 사용하고 있음. 자체적인 정책이기 때문에 양식이 통일..

02. ContainerD private Registry image pull

ContainerD private Registry image pull 목표 harbor private registry에 있는 image를 containerD를 통해 pull 받아보는 과정을 정리. harbor private registry는 https 설정이 되어있음. Test 환경 [private registry server ] OS : CentOS 7.5 IP : 10.0.2.5 domain : iksoon.registry.com Harbor version : 2.4.1 push 되어있는 image 항목 : iksoon.registry.com/testproject/tomcat:1.0.0 [containerD server] OS : CentOS 7.5 IP : 10.0.2.4 containerD ver..

17. Harbor private registry 구축 및 image push, pull

Harbor private registry 구축 Certification 생성 인증서 생성 및 기타 작업을 수행하기 위한 디렉터리를 생성함. [명령어] mkdir /certs cd /certs CA Certificates 생성 실제 RootCA (신뢰할 수 있는 루트 인증 기관)를 사용하는게 아니라면, 직접 CA (인증 기관)를 생성하여 Server의 인증서가 안전하다고 인증해주어야 함. 따라서 아래의 명령어로 개인용 Root CA 역할을 할 CA.key를 생성하고, CA.key의 짝이 되는 CA.crt 공개키를 생성함. [Root CA의 비밀키 생성] openssl genrsa -out ca.key 4096 [Root CA의 비밀키와 짝을 이룰 공개키 생성] openssl req -x509 -new -..

클라우드/Docker 2022.01.13

01. ContainerD crictl tool 설치

ContainerD crictl tool 설치 목표 ContainerD default cli tool인 ctr은 containerD 프로젝트에 포함되어있어서 자동으로 설치됨. 하지만 ctr의 경우 containerD 전용 tool 이지만 전체적으로 놓고보면 기능이 제한적이라 보다 더 다양한 기능을 제공하고 containerD 이외의 container runtime tool을 지원하는 crictl을 사용해도록 함. Test 환경 [containerD server] OS : CentOS 7.5 IP : 10.0.2.4 containerD version : 1.4.12 crictl 설치 [명령어] VERSION="v1.22.0" wget https://github.com/kubernetes-sigs/cri-t..

반응형