본문 바로가기

CKA &. CKAD/Application Lifecycle Management

(8)
InitContainer and Practice Test Multi-container Pod에서 각 Container는 POD의 Lifecycle동안 활성 상태로 유지되는 프로세스를 실행해야 한다. 예를 들어 이전에 Web Application과 logging Agent가 있는 Mutli Container Pod에서 두 컨테이너 모두 항상 활성 상태를 유지해야 한다. Log Agent Container에서 실행되는 프로세스는 Web Application이 실행되는 동안 활성 상태로 유지 된다. 이들 중 하나라도 실패하면 POD가 다시 시작된다. 그러나 때대로 Container에서 완료될 때까지 실행되는 프로세스를 실행할 수 있다. 예를 들어, 기본 웹 애플리케이션에서 사용할 저장소에서 코드 또는 바이너리를 가져 오는 프로세스이다. 이는 Pod가 처음 생성될 때..
Practice Test - Multi-Container Pod [Practice Test] ㅁ Identify the number of containers running in the 'red' pod kubectl get pod red ㅁ Identify the name of the containers running in the 'blue' pod kubectl describe pod blue ㅁ Create a multi-container pod with 2 containers - Name: yellow - Container 1 Name: lemon - Container 1 Image: busybox - Container 2 Name: gold - Container 2 Image: redis kubectl run yellow --image=busybox --res..
Secret Practice Test ㅁ How many Secrets exsit on the system? kubectl get secrets ㅁ How many secrets are defined in the 'default-token' secret? kubectl describe secret default-token Data 영역의 값 확인 Data ==== ca.crt: 1066 bytes namespace: 7 bytes token: eyJhbGciOiJSUzI1NiIsImtpZCI6IlNTZjZGUEZCTFRLUlhiMGhyY2txNDF2M01HOWdOZGlQMzM4bWpJbi05d0kifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYW..
Secret Two Way Imperative Method kubectl create secret generic --from-literal== kubectl create secret generic \ app-secret --from-literal=DB_Host=mysql \ --from-literal=DB_User=root --from-literal=DB_Password=paswrd kubectl create secret generic --from-file= kubectl create secret generic \ app-secret --from-file=app_secret.properties Declarative Method kubectl create -f secret-data.yaml apiVersion: v1 ..
ConfigMap Practice Test ㅁ How many PODs exist on the system? kubectl get pods ㅁ What is the environment variable name set on the container in the pod? kubectl describe pod webapp-color ㅁ Update the environment variable on the POD to display a 'green' background kubectl get pod web-app -o yaml > pod-definition.yaml 이후 필요 부분 수정 ㅁ How many ConfigMaps exist in the environment? kubectl get configmaps ㅁ Identify the database..
Configure Environment Variable in Applications docker run -e APP_COLOR=pink simple-webapp-color pod-definition.yaml apiVersion: v1 kind: Pod metadata: name: simple-webapp-color spec: containers: - name: simple-webapp-color image: simple-webapp-color ports: - containerPort: 8080 env: - name: APP_COLOR value: pink APP_COLOR: blue APP_MODE: prod 1st Create ConfigMap [imperative] kubectl create configmap --from-literal== 예시 kubectl create config..
Application Commands & Argument and Practice Test docker run ubuntu docker ps docker ps -a Nignx Docker File # Install Nginx. RUN \ add-apt-repository -y ppa:nginx/stable && \ apt-get update && \ apt-get install -y nginx && \ rm -rf /var/lib/apt/lists/* && \ echo "\ndaemon off;" >> /etc/nginx/nginx.conf && \ chown -R www-data:www-data /var/lib/nginx # Define mountable directories. VOLUME ["/etc/nginx/sites-enabled", "/etc/nginx/certs", "/etc/ng..
Rolling Update and Rollout [Summarize Command] ㅁ Create kubectl create -f deployoment-definition.yml ㅁ Get kubectl get deployments ㅁ Update kubectl apply -f deployment-definition.yml kubectl set image deployment/myapp-deployment nginx=nginx:1.9.1 ㅁ Status kubectl rollout status deployment/myapp-deployment kubectl rollout history deployment/myapp-deployment ㅁ Rollback kubectl rollout undo deployment/myapp-deployment [Pract..