본문 바로가기

728x90
반응형

Development

(305)
[Docker] 컨테이너와 외부 디렉토리 연결하기 docker 실행시 컨테이너 내부에서 컨테이너 외부 파일을 연결할수 있는 방법이 있다. docker run 실행시 -v [호스트경로]:[컨테이너경로] 를 추가해주면 호스트 경로와 컨테이너 경로가 연결되게 된다. 한가지 중요한 점은 호스트 경로의 상태가 컨테이너 경로에 덮어써진다는 것이다. ➜ docker docker run --name nginx-mounts -d -p 8081:80 -v /Users/Workspaces/docker:/usr/share/nginx/html nginx Unable to find image 'nginx:latest' locally latest: Pulling from library/nginx 7d63c13d9b9b: Pull complete 15641ef07d80: Pull ..
[리눅스 명령어] arp 시스템의 mac 주소를 확인할때 사용한다. root@myserver-001:~# arp Address HWtype HWaddress Flags Mask Iface 10.32.0.2 ether e2:be:6b:98:75:27 C weave 10.32.0.3 ether c2:2b:4a:0f:0b:5b C weave 10.36.0.1 ether 02:84:38:18:ac:31 C weave 10.36.0.2 ether 8e:21:c9:42:d3:da C weave 10.36.0.3 ether a2:7f:5e:83:5b:c4 C weave 10.44.0.4 ether 2a:54:11:6b:1f:fe C weave 10.44.0.5 ether b6:bb:2c:98:2b:7b C weave _gateway ethe..
[Docker] docker container ip 확인방법 1. docker inspect container_id 명령어를 치면 굉장히 많은 정보를 확인할 수 있다. 그래서 grep 으로 조회하면 좀 수월하다. docker inspect container_id | grep IP "LinkLocalIPv6Address": "", "LinkLocalIPv6PrefixLen": 0, "SecondaryIPAddresses": null, "SecondaryIPv6Addresses": null, "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "IPAddress": "192.168.0.1", "IPPrefixLen": 16, "IPv6Gateway": "", "IPAMConfig": null, "IPAddress": "192.1..
Ansible Ping 테스트 해보자. 간단한(?) Ping 테스트. - inventory 파일 정보 [workers] worker1 ansible_host=192.168.0.12 ansible_user=root worker2 ansible_host=192.168.0.14 ansible_user=root - ping을 쏴보자. (-m 옵션은 module 이라는 의미) ansible workers -m ping 당연히 될줄 알았으나 Error 발생 worker1 | FAILED! => { "msg": "to use the 'ssh' connection type with passwords, you must install the sshpass program" } worker2 | FAILED! => { "msg": "to use the 'ssh' ..
Ansible Inventory 파일 호스트 파일에는 목적지 노드의 정보를 담고 있다. 1. 파일 위치 : /etc/ansible/hosts (설치위치에 따라 달라질수는 있다.) 실제로 ansible.cfg 파일을 보면 다음과 같이 default 로 정의되어있다. # some basic default values... #inventory = /etc/ansible/hosts 2. 사용 방법 test test.com [test] test.com [web] web1.com web2.com [db] db.com [mail] mail.com [workers] worker1 ansible_host=192.168.0.12 ansible_user=root worker2 ansible_host=192.168.0.14 ansible_user=root [al..
[Docker] history 명령어 history 명령어를 통해서 이미지가 어떤 과정을 거쳐 생성되었는지 확인해볼수 있다. 아래와 같이 nginx 의 latest 이미지와 stable 이미지에 대한 내역을 비교해볼수 있다. root@myserver-001:~# docker history nginx:stable IMAGE CREATED CREATED BY SIZE COMMENT c8d03f6b8b91 4 weeks ago /bin/sh -c #(nop) CMD ["nginx" "-g" "daemon… 0B 4 weeks ago /bin/sh -c #(nop) STOPSIGNAL SIGQUIT 0B 4 weeks ago /bin/sh -c #(nop) EXPOSE 80 0B 4 weeks ago /bin/sh -c #(nop) ENTRYPOI..
[k8s] drain 명령어 kubectl drain 노드명 - drain 명령어를 사용하게 되면 해당 노드의 pod 를 다른 노드로 옮긴다. - 실제로는 pod 를 옮기는게 아니라 다른 노드에 재 생성한다. - 데몬셋을 무시하고 진행할 경우에는 --ignore-daemonsets 옵션을 사용한다. 아래와 같이 myserver-002와 myserver-003 에 pod 가 각각 deploy 되어있다. root@myserver-001:~# kubectl get po -o wide NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES rollout-nginx-74695fdcd-5trw5 1/1 Running 0 3m55s 10.32.0.2 myserver-002 r..
taint, cordon 의 차이점은? cordon 지정한 노드에 Pod 를 스케줄링 하지 않는다. taint 지정한 노드에 Pod를 스케줄링 하지 않지만 tolerations 설정을 통해 스케줄링이 가능하다.
생활코딩 - 암호학 수업 암호학(cryptograph) 생활코딩 암호학 영상을 보고 요약한 정리 입니다. https://www.youtube.com/playlist?list=PLuHgQVnccGMD-9lk4xmb6EG1XK1OmwC3u 암호화의 특징 기밀성 (Confidentiality) : 암호화된것을 알수 없어야함. 무결성 (Integrity) : 내용이 원본과 같다는걸 유지해야함. 인증 (Authentication) : 권한이 있는 사람만 접근 가능해야함. 암호법의 구분 양방향 암호화 : 정보를 감추는 기밀성에 초점이 맞춰짐 대칭키 : 암,복호화시 같은 키 사용 비대칭키 : 암,복호화시 다른 키 사용 단방향 암호화 : 무결성에 초점을 맞춤 단반향 암호화 다른말로 HASH MD5, SHA-256, SHA-512등등 무결성체크..
파이썬 입력값 받기 ## 공백으로 input 값 받는 방법 data = list(map(int, input().split())) # 결과 1 2 3 [1, 2, 3] 파이썬으로 입력값을 받을때 위와 같이 코드를 작성하면 간편하다. (주로 코딩테스트의 입력값 받을때 사용하면 된다.) 입력값이 공백이 아닌 콤마(,) 로 구분될 경우 split(",") 으로 변경해서 코드를 작성하면 된다.

728x90
반응형