Posts Kubernetes 3
Post
Cancel

Kubernetes 3

Kubernetes 3


๐Ÿ’ฟ Deployment

  • ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ๋‹ค์šด ํƒ€์ž„์—†์ด ์—…๋ฐ์ดํŠธ ๊ฐ€๋Šฅํ•˜๋„๋ก ๋„์™€์ฃผ๋Š” ๋ฆฌ์†Œ์Šค
  • ๋ ˆํ”Œ๋ฆฌ์นด ์…‹๊ณผ ๋ ˆํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ปจํŠธ๋กค๋Ÿฌ ์ƒ์œ„์— ๋ฐฐํฌ๋˜๋Š” ๋ฆฌ์†Œ์Šค
  • ๋ชจ๋“  ํฌ๋“œ๋ฅผ ์—…๋ฐ์ดํŠธํ•˜๋Š” ๋ฐฉ๋ฒ•
    • ์ž ๊น์˜ ๋‹ค์šด ํƒ€์ž„ ๋ฐœ์ƒ(์ƒˆ๋กœ์šด ํฌ๋“œ๋ฅผ ์ƒ์„ฑ์‹œํ‚ค๊ณ  ์ž‘์—…์ด ์™„๋ฃŒ๋˜๋ฉด ์˜ค๋ž˜๋œ ํฌ๋“œ๋ฅผ ์‚ญ์ œ)
    • ๋กค๋ง ์—…๋ฐ์ดํŠธ

๋กค๋ง ์—…๋ฐ์ดํŠธ

  • ๊ธฐ์กด์˜ ๋ชจ๋“  ํฌ๋“œ๋ฅผ ์‚ญ์ œ ํ›„ ์ƒˆ๋กœ์šด ํฌ๋“œ ์ƒ์„ฑ
    • ์ž ๊น์˜ ๋‹ค์šด ํƒ€์ž„ ๋ฐœ์ƒ
  • ์ƒˆ๋กœ์šด ํฌ๋“œ๋ฅผ ์‹คํ–‰์‹œํ‚ค๊ณ  ์ž‘์—…์ด ์™„๋ฃŒ๋˜๋ฉด ์˜ค๋ž˜๋œ ํฌ๋“œ๋ฅผ ์‚ญ์ œ
    • ์ƒˆ ๋ฒ„์ „์„ ์‹คํ–‰์‹œํ‚ค๋Š” ๋™์•ˆ ๊ตฌ ๋ฒ„์ „ ํฌ๋“œ์™€ ์—ฐ๊ฒฐ
    • ์„œ๋น„์Šค์˜ ๋ ˆ์ด๋ธ” ์…€๋ ‰ํ„ฐ๋ฅผ ์ˆ˜์ •ํ•˜์—ฌ ๊ฐ„๋‹จํ•˜๊ฒŒ ์ˆ˜ํ–‰ ๊ฐ€๋Šฅ
  • ๋ ˆํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ปจํŠธ๋กค๋Ÿฌ๊ฐ€ ์ œ๊ณตํ•˜๋Š” ๋กค๋ง ์—…๋ฐ์ดํŠธ
    • ์ด์ „์—๋Š” kubectl์„ ์‚ฌ์šฉํ•œ ์Šค์ผ€์ผ๋ง์„ ์‚ฌ์šฉํ•˜์—ฌ ์ˆ˜๋™์œผ๋กœ ๋กค๋ง ์—…๋ฐ์ดํŠธ ์ง„ํ–‰ ๊ฐ€๋Šฅ
    • kubectl ์ค‘๋‹จ๋˜๋ฉด ์—…๋ฐ์ดํŠธ๋Š”?
    • ๋ ˆํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ปจํŠธ๋กค๋Ÿฌ ๋˜๋Š” ๋ ˆํ”Œ๋ฆฌ์นด ์…‹์„ ํ†ต์ œํ•  ์ˆ˜ ์žˆ๋Š” ์‹œ์Šคํ…œ์ด ํ•„์š”
    • ๋””ํ”Œ๋กœ์ด๋จผํŠธ ํŒŒ๋“œ๊ฐ€ ์ด๋Ÿฌํ•œ ์—ญํ• ์„ ์ˆ˜ํ–‰
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: app-go
spec:
  replicas: 3
  selector:
    matchLabels:
      app: app-go
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: http-go:v1
        image: gasbugs/http-go:v1 
        ports:
        - containerPort: 80
  • kubectl create -f nginx-deployment.yml โ€“record=true
    • log๋ฅผ ๋‚จ๊ฒจ๋†“์Œ
This post is licensed under CC BY 4.0 by the author.

Kubernetes 2

Kubernetes 4