kubernetes in action 7

[kubernetes in action] 7. Configmaps and Secrets - 2

7.3. Setting environment variables for a container Kubernetes에서는 각각의 컨테이너에 환경변수를 지정해 줄 수 있다. 다만 아직 pod레벨에서 지정하는 방법은 없다. 환경변수로 위에서 만든 fortune image의 interval을 설정해보자. fortune-env/fortuneloop.sh #!/bin/bash trap "exit" SIGINT echo Configured to generate new fortune every $INTERVAL seconds mkdir -p /var/htdocs while : do echo $(date) Writing fortune to /var/htdocs/index.html /usr/games/fortune > /va..

[kubernetes in action] 7. Configmaps and Secrets - 1

7. ConfigMaps and Secrets configuring applications Changing the main process of a container Passing command-line options to the app Setting environment variables exposed to the app Configuring apps through ConfigMaps Passing sensitive information through Secrets 거의 모든 app이 configuration을 필요로 하고 이를 app 자체에 담을 수 없으므로 kubernetes에서 어떻게 configuration option을 넘겨줄 수 있음 7.1. Configuring containerized ap..

[kubernetes in action] 6. Volumes: attaching disk storage to containers

Chapter 6. Volumes: attaching disk storage to containers Creating multi-container pods Creating a volume to share disk storage between containers Using a Git repository inside a pod Attaching persistent storage such as a GCE Persistent Disk to pods Using pre-provisioned persistent storage Dynamic provisioning of persistent storage 6.1. INTRODUCING VOLUMES 6.2. Usnig volumes to share data between..

[kubernetes in action] 5.5. Signaling when a pod is ready to accept connections

5.5. Signaling when a pod is ready to accept connections Introducing readiness probes container의 readiness probe가 성공하면 해당 컨테이너는 request를 받을 준비가 된 것 liveness probe와는 다르게 readiness가 실패해도 pod가 제거되거나 다시 시작되지는 않는다. Adding a readiness probe to a pod $ kubectl edit rc kubiaAdd spec.template.spec.containers. in kubia-rc-readnessprobe.yaml apiVersion: v1 kind: ReplicationController metadata: name: kubia ..

[kubernetes in action] 5-1. Introducing Services

Ch 5. Services: enabling clients to discover and talk to pods 이 챕터는 다음 내용을 다룬다. Service 리소스를 만들고 한 주소로 pod 그룹을 expose 클러스터 안의 services를 expose 외부 서비스를 클러스터 안의 service와 연결 service의 부분으로 pod가 준비되게 컨트롤 Troubleshooting service 요즘의 많은 애플리케이션들은 외부 요청에 응답하게 만들어진다. kubernetes가 아닌 상황에서는 sysadmin이 클라이언트 앱에 각각의 IP주소나 hostname을 부여하지만, Kubernetes에서는 이런 방식으로 작동하지 않는다. Pod는 ephemeral (덧없다, 단명한다): 언제든지 생기고 사라질 ..

kubernetes in action - 02. First steps with docker and kubernetes

2. First steps with Docker and Kubernetes 도커에 대한 기본적인 설명. 도커 사용법을 안다면 생략해도 될듯하다. kubenertes 띄우기: minikube 설치 및 사용법에 대한 설명 minikube나 GKE(Google Kubernetes Engine)으로 설명이 되어있다. GKE는 GKE Quickstart를 따라하면 됨. google은 12 month free trial를 제공하지만 이미 사용하였을 경우에는 금액이 청구된다. 이후에 kubernetes 명령어에 사용할 docker image를 빌드해서 push 해주어야한다 app.js에 다음 내용을 추가 const http = require('http'); const os = require('o..

kubernetes in action - 01. Introducing Kubernetes

Kubernetes in action 1. Introducing Kubernetes 단일규모의 큰 앱의 다양한 단점 마이크로서비스들의 등장 이들을 오케스트레이션해줄 기능이 필요 적은 수일 경우에는 VM으로도 가능 hardware resources human resources VM 대신 Linux container technologies run multiple services on the same host machine isolating environment like VM; less overhead container는 host의 OS에서 작동하지만 각 프로세스들은 isolated VM과 비교하면? single isolated process running in the host OS, consuming onl..