레드햇에서 클라우드 네이티브 컨테이어 디자인 관련 문서(쿠버네티스)를 공유했다. 






http://blog.kubernetes.io/2018/03/principles-of-container-app-design.html?m=1




https://www.redhat.com/cms/managed-files/cl-cloud-native-container-design-whitepaper-f8808kc-201710-v3-en.pdf


PRINCIPLES OF

SOFTWARE DESIGN:

•Keep it simple, stupid (KISS)

•Don’t repeat yourself (DRY)

•You aren’t gonna need it

(YAGNI)

•Separation of concerns (SoC)

RED HAT APPROACH

TO CLOUD-NATIVE

CONTAINERS:

•Single concern principle (SCP)

•High observability

principle (HOP)

•Life-cycle conformance

principle (LCP)

•Image immutability

principle (IIP)

•Process disposability

principle (PDP)

•Self-containment

principle (S-CP)

•Runtime confinement

principle (RCP)



레드햇 아키텍트가 infoq에 쓴 글이다.


https://www.infoq.com/articles/kubernetes-effect



Posted by '김용환'
,


오픈 스택의 overcommit 정보



https://docs.openstack.org/arch-design/design-compute/design-compute-overcommit.html




오픈 스택의 가상화 서버의 overcommit 기본 값은 다음과 같이 되어 있다.  가상 서버를 사용할 때 효율을 위해서 비율이 크다.


  • CPU allocation ratio: 16:1
  • RAM allocation ratio: 1.5:1



CPU allocation ratio가 16:1이라는 의미는 스케쥴러가 물리 코어 하나 당 16개의 가상 코어를 쓸 수 있도록 할당하겠다는 의미이다. 물리 서버가 12코어가 있다면.. 스케쥴러는 192개의 가상 코어를 사용할 수 있다. 인스턴스당 4 가상 코어를 쓰겠다고 하면.. 물리 서버의 192개중 48 인스턴스를 제공한다는 의미이다.


오픈 스택 문서를 보면 설명이 잘 나와 있다. 


OR
CPU overcommit ratio (virtual cores per physical core)
PC
Number of physical cores
VC
Number of virtual cores per instance

인스턴스 개수 = (OR*PC)/VC





https://inter6.github.io/2016/04/22/nova-overcommit/ 이 분의 글이 좋아서 발췌한다.



  • (Instance Count) = (Overcommit Ratio) * (Physical Cores) / (vCores per Instance)
  • (Overcommit Ratio) = (Instance Count) / (Physical Cores) * (vCores per Instance)



만약 인텔의 Hyper-Thread 기능을 사용할 경우, Mirantis에서는 총 코어 개수를 물리 코어 x 1.3 으로 계산할 것을 가이드한다.

다음 환경에서 오버커밋 비율로 생성해낼 수 있는 인스턴스 개수는 다음과 같다.

  • 인텔 E5-2640 v3 2.6Ghz 8Core x 2way
  • Hyper-Thread 활성화
  • 인스턴스당 평균 4개의 코어를 사용
Overcommit RatioInstance CountPhysical CoresvCores per Instance
15.220.84
210.420.84
420.820.84
841.620.84
1683.220.84



Posted by '김용환'
,

스프링 보안 이슈(https://spring.io/blog/2018/04/09/cve-2018-1275-address-partial-fix-for-cve-2018-1270)가 발생했다.


Spring Framework, versions 5.0.x prior to 5.0.5 and versions 4.3.x prior to 4.3.16, and older unsupported versions allow applications to expose STOMP over WebSocket endpoints with a simple, in-memory STOMP broker through the spring-messaging module. A malicious user (or attacker) can craft a message to the broker that can lead to a remote code execution attack.


https://spring.io/blog/2018/04/05/multiple-cve-reports-published-for-the-spring-framework




spring 2.0.1과 spring 1.5.12를 사용하길 권고한다고 떴다.


https://spring.io/blog/2018/04/05/spring-boot-2-0-1-available-now


https://spring.io/blog/2018/04/10/spring-boot-1-5-12-available-now



요약하면.



Spring Framework 5.0.x ->Spring Framework 5.0.5 로 업그레이드

Spring Framework 4.3.x -> Spring Framework 4.3.16 로 업그레이드


Spring Boot 2.0.0 -> Spring Boot 2.0.1로 업그레이드

Spring Boot 1.x.0 -> Spring Boot 1.5.12로 업그레이드



Posted by '김용환'
,


Dockerfile에서  USER를 nobody로 설정해서. docker container를 띄워서 톰캣이 재시작되지 않는 버그를 발견했다.


centos, mac에서는 잘 동작하는데, ubuntu에서만 동작하지 못했다.


Permission denied.. 분명 권한이 있는데로 파일 생성을 어느 path에서는 할 수 있고, 어느 path에서는 할 수 없었다.



nobody@08678a6be7c9:/usr/local/tomcat$ ls -al
total 120
drwxr-sr-x 28 nobody nogroup  4096 Apr  9 15:32 .
drwxrwsr-x 23 root   staff    4096 Apr  9 15:32 ..
-rw-r-----  1 nobody nogroup 57092 Sep 28  2017 LICENSE
-rw-r-----  1 nobody nogroup  1723 Sep 28  2017 NOTICE
-rw-r-----  1 nobody nogroup  7064 Sep 28  2017 RELEASE-NOTES
-rw-r-----  1 nobody nogroup 15946 Sep 28  2017 RUNNING.txt
drwxr-x---  2 nobody nogroup  4096 Nov  8 19:45 bin
drwx--S---  2 nobody nogroup  4096 Apr  9 15:30 conf
drwxr-x---  2 nobody nogroup  4096 Nov  8 19:45 lib
drwxr-x---  2 nobody nogroup  4096 Sep 28  2017 logs
drwxr-x---  2 nobody nogroup  4096 Nov  8 19:45 temp
drwxr-x---  9 nobody nogroup  4096 Apr  9 15:32 webapps
drwxr-x---  2 nobody nogroup  4096 Sep 28  2017 work

nobody@08678a6be7c9:/usr/local/tomcat$ touch a
nobody@08678a6be7c9:/usr/local/tomcat$ ls a
-rw-r--r--  1 nobody nogroup     0 Apr  9 16:51 a


nobody@08678a6be7c9:/usr/local/tomcat/logs$ touch a
touch: cannot touch ‘a’: Permission denied


docker info를 통해 driver를 확인했다. 

mac은 overlay2를 사용하고 있고. centos는 overlay, ubuntu는 aufs를 사용하고 있었다.


aufs 정보는 다음과 같으며 https://docs.docker.com/storage/storagedriver/aufs-driver/..


docker 공식 문서에서는 더 이상 aufs를 사용하지 않고 overlay를 사용하라고 되어 있다.

https://docs.docker.com/storage/storagedriver/overlayfs-driver/





mesos, docker 장비에서 docker 파일 드라이버를 aufs로 overlay로 변경했다. 



로컬에 저장된 기존 도커 container 모두 중단 및 docker image 삭제한다.


$ docker rm $(docker ps -qa)

$ docker images

$ docker rmi ...




시스템 설정을 변경한다.



$ sudo -i

 

$ CONFIGURATION_FILE=$(systemctl show --property=FragmentPath docker | cut -f2 -d=)

#/etc/systemd/system/docker.service


$ cp $CONFIGURATION_FILE /etc/systemd/system/docker.service

 

$ perl -pi -e 's/^(ExecStart=.+)$/$1 -s overlay/' /etc/systemd/system/docker.service



$ cat > /etc/docker/daemon.json

{

    "storage-driver": "overlay"

}


$ service mesos-slave restart #메소스 사용중이라면.. 반드시.

$ service docker restart 



그리고.  $ docker info를 실행해 docker 기본 filer driver가 overlay인지 확인한다.

docker container를 실행한 후, docker insepect $container_id로 확인해서. overlay인지 확인한다.

정상적으로 잘 동작하면 ok










'Cloud' 카테고리의 다른 글

java docker image 확인하기  (0) 2018.04.19
[openstack] 오버 커밋(overcommit) 공부  (0) 2018.04.11
fluentd 정규식 확인하기  (0) 2018.04.10
[fluentd] format json  (0) 2018.04.10
[openstack] keystone 인증(auth)만 해보기  (0) 2018.02.07
Posted by '김용환'
,