ข้ามไปยังเนื้อหา

This is the Experimental version (Latest). It is under active development and may change. For the most reliable documentation, use the version selector in the top-right to switch to Stable, or click here to go to the Stable version's homepage.

Update Standard OneChart Helm Values

อัพเดทล่าสุด:

เนื้อหานี้ยังไม่มีในภาษาของคุณ

จากที่ได้กล่าวไปในหัวข้อ Using CD ที่ Application ที่นำมา Deploy ผ่าน Opstella จะใช้ OneChart เป็นค่าเริ่มต้น

ในหัวข้อนี้จะอธิบาย Helm Values ที่ Opstella จะจัดเตรียมไว้ให้ เพื่อนำ Application ขึ้น Deploy กับ ArgoCD ด้วย Helm Chart ได้

nameOverride: <component>-develop
fullnameOverride: <company>-<platform>-<service>-<component>-develop
replicas: 1
image:
repository: registry.CHANGEME.com/<company>-<platform>-<service>-<component>/<component>
tag: develop-abc123de
pullPolicy: Always
imagePullSecrets:
- image-<company>-<platform>-<service>
containerPort: 3000
resources:
requests:
cpu: 10m
memory: 10Mi
limits:
cpu: 500m
memory: 500Mi
ingress:
tlsEnabled: true
secretName: <tls-secret-name>
host: <application-domain>
ingressClassName: nginx
podSecurityContext: {}
existingFileSecrets:
- name: <component>
path: /etc/config/secret/opstella.txt
subPath: opstella.txt
secretName: <component>

เป็นการตั้งชื่อของ Resource แทนชื่อ Chart แต่ยังมี Release ซึ่งจะกลายเป็นชื่อของ Kubernetes Pod, Service, Deployment และ ReplicaSet

ตัวอย่าง

กำหนด nameOverride ชื่อ my-custom-name

... (deducted)
nameOverride: my-custom-name
... (deducted)

นำไป Deploy และ ดู Resource ที่เกิดขึ้น

Terminal window
kubectl get all

nameOverride ที่กำหนดจะกลายเป็นชื่อต่อจาก Release

NAME READY STATUS RESTARTS AGE
pod/release-my-custom-name-<hash> 1/1 Running 0 5m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/release-my-custom-name ClusterIP 10.0.0.1 <none> 80/TCP 5m
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/release-my-custom-name 1/1 1 1 5m
NAME DESIRED CURRENT READY AGE
replicaset.apps/release-my-custom-name-<hash> 1 1 1 5m

เป็นการตั้งชื่อของ Resource แทนชื่อ chart และ release ซึ่งจะกลายเป็นชื่อของ pod, service, deployment และ replicaset เช่น

ตัวอย่าง

กำหนด fullnameOverride ชื่อ my-custom-name

... (deducted)
fullnameOverride: my-custom-name
... (deducted)

นำไป Deploy และ ดู Resource ที่เกิดขึ้น

Terminal window
kubectl get all

fullnameOverride ที่กำหนดจะกลายเป็นชื่อแทน Release

NAME READY STATUS RESTARTS AGE
pod/my-custom-name-<hash> 1/1 Running 0 5m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/my-custom-name ClusterIP 10.0.0.1 <none> 80/TCP 5m
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/my-custom-name 1/1 1 1 5m
NAME DESIRED CURRENT READY AGE
replicaset.apps/my-custom-name-<hash> 1 1 1 5m

จำนวน Pods ที่ต้องการให้สร้างขึ้น โดยกำหนดเป็นตัวเลข

replicaCount: 3
... (deducted)

นำไป Deploy และ ดู Resource ที่เกิดขึ้น

Terminal window
kubectl get all
NAME READY STATUS RESTARTS AGE
pod/my-custom-name-<hash> 3/3 Running 0 Xm
... (deducted)
image:
repository: registry.CHANGEME.com/<company>-<platform>-<service>-<component>/<component>
tag: develop-abc123de
pullPolicy: Always
... (deducted)

ส่วนสำหรับระบุชื่อ Image สำหรับสร้าง Container ขึ้นมา

  • repository ดึง Image อะไร สามารถใช้เป็นชื่อ หรือ Path ที่เก็บ Image
  • tag ให้ดึง Image จาก Tag อะไร ในกรณีที่ Image มีหลาย Tag หรือหลายเวอร์ชั่น Tag จะช่วยให้ระบุเฉพาะเจาะจงได้ กรณีที่ไม่ใส่ Tag จะดึง Image ที่ Tag ล่าสุดมา (latest)
  • pullPolicy กำหนดคุณลักษณะการ Pull Image (IfNotPresent, Always, Never)
    • IfNotPresent: ทำการดึง Image เมื่อไม่พบ Image บน Worker Node เท่านั้น
    • Always: ทำการดึง Image ทุกครั้ง
    • Never: ไม่ทำการดึง Image เลย
... (deducted)
imagePullSecrets:
- image-<company>-<platform>-<service>
... (deducted)

สำหรับระบุ Kubernetes Secret ของที่ใช้สำหรับเข้าถึง Private Registry เพื่อใช้ในการ Pull Container Image

... (deducted)
containerPort: 3000
... (deducted)

ใช้กำหนดว่าเชื่อมกับ Port ใดของ Container

... (deducted)
resources:
requests:
cpu: 10m
memory: 10Mi
limits:
cpu: 500m
memory: 500Mi
... (deducted)

กำหนด Resources request และ Resources limit สำหรับ container ใน pod

  • requests กำหนด Resources ต้องการใช้
    • cpu ระบุปริมาณ CPU ที่ Container ต้องการใช้
    • memory ระบุปริมาณ RAM ที่ Container ต้องการใช้
  • limits กำหนด Resources สามารถใช้ได้สูงสุด
    • cpu ระบุปริมาณ CPU ที่ Container สามารถใช้ได้สูงสุด
    • memory ระบุปริมาณ RAM ที่ Container สามารถใช้ได้สูงสุด
... (deducted)
ingress:
tlsEnabled: true
host: <application-domain>
secretName: <tls-secret-name>
ingressClassName: nginx
... (deducted)
  • tlsEnabled เปิดการใช้ TLS กับ Ingress
  • secretName ชื่อ Kubernetes Secret ที่เก็บ TLS Certificate
  • host กำหนดโดเมนที่จะให้เข้าสู่ Application
  • ingrssClassName กำหนด Class ของ Ingress (ค่าเริ่มต้น ให้ใช้ nginx)
    • เปลี่ยนแปลงก็ต่อเมื่อ Ingress Controller บน Kubernetes มีมากกว่า 1 Controller หรือ ไม่ใช่/ไม่มี nginx

กำหนดคุณสมบัติความปลอดภัยของ pod เช่น fsGroup, runAsUser หรือ supplementalGroups เช่น

... (deducted)
podSecurityContext:
runAsUser: 1000
fsGroup: 2000
supplementalGroups:
- 3000
... (deducted)
  • runAsUser: กำหนด user ID ที่จะใช้ในการรัน Container ภายใน Pod (เช่น 1000)
  • fsGroup: กำหนด group ID ที่จะใช้ในการกำหนด file system group ใน Container ภายใน Pod (เช่น 2000)
  • supplementalGroups: กำหนด supplemental groups ที่เพิ่มเติมสำหรับ Pod (เช่น [3000])

สามารถดูการตั้งค่า Helm Values อื่นๆ ได้ที่ Helm Charts/OneChart References

Finished?

Use the below navigation to proceed