├── .gitignore ├── README.md ├── hands-on ├── advanced │ ├── affinity │ │ └── README.md │ ├── controllers │ │ ├── README.md │ │ ├── answers │ │ │ ├── deploy.yaml │ │ │ └── statefulset.yaml │ │ ├── daemonset │ │ │ ├── daemonset.md │ │ │ └── daemonset.yaml │ │ ├── deployment │ │ │ ├── deploy.md │ │ │ └── deploy.yaml │ │ ├── job-cronjob │ │ │ ├── job-cronjob.md │ │ │ └── job-cronjob.yaml │ │ └── statefulset │ │ │ ├── mysql-example │ │ │ ├── README.md │ │ │ ├── mysql-configmap.yaml │ │ │ ├── mysql-services.yaml │ │ │ └── mysql-statefulset.yaml │ │ │ ├── statefulset.md │ │ │ └── statefulset.yaml │ ├── helm │ │ ├── README.md │ │ └── examples │ │ │ ├── 0-example │ │ │ ├── .helmignore │ │ │ ├── Chart.yaml │ │ │ ├── templates │ │ │ │ ├── NOTES.txt │ │ │ │ ├── _helpers.tpl │ │ │ │ ├── deployment.yaml │ │ │ │ ├── hpa.yaml │ │ │ │ ├── ingress.yaml │ │ │ │ ├── service.yaml │ │ │ │ ├── serviceaccount.yaml │ │ │ │ └── tests │ │ │ │ │ └── test-connection.yaml │ │ │ └── values.yaml │ │ │ ├── 1-builtin-objects │ │ │ ├── .helmignore │ │ │ ├── Chart.yaml │ │ │ ├── templates │ │ │ │ └── deployment.yaml │ │ │ └── values.yaml │ │ │ ├── 2-values-files │ │ │ ├── .helmignore │ │ │ ├── Chart.yaml │ │ │ ├── README.md │ │ │ ├── templates │ │ │ │ └── deployment.yaml │ │ │ ├── values-prod.yaml │ │ │ └── values.yaml │ │ │ ├── 3-named-template │ │ │ ├── .helmignore │ │ │ ├── Chart.yaml │ │ │ ├── templates │ │ │ │ ├── _helpers.tpl │ │ │ │ └── deployment.yaml │ │ │ └── values.yaml │ │ │ ├── 4-access-files-in-template │ │ │ ├── .helmignore │ │ │ ├── Chart.yaml │ │ │ ├── conf │ │ │ │ ├── fluentd.conf │ │ │ │ └── nginx.conf │ │ │ ├── example.conf │ │ │ ├── secret │ │ │ │ └── login.txt │ │ │ ├── templates │ │ │ │ ├── configmap.yaml │ │ │ │ └── secret.yaml │ │ │ └── values.yaml │ │ │ ├── 5-flow-control │ │ │ ├── .helmignore │ │ │ ├── Chart.yaml │ │ │ ├── templates │ │ │ │ └── configmap.yaml │ │ │ └── values.yaml │ │ │ ├── 6-raise-exception │ │ │ ├── .helmignore │ │ │ ├── Chart.yaml │ │ │ ├── templates │ │ │ │ └── configmap.yaml │ │ │ └── values.yaml │ │ │ └── 7-dependencies │ │ │ ├── .helmignore │ │ │ ├── Chart.yaml │ │ │ └── values.yaml │ ├── hpa │ │ └── README.md │ ├── network-policy │ │ └── README.md │ ├── pdb │ │ └── README.md │ ├── rbac │ │ └── README.md │ ├── system-design │ │ ├── ans │ │ │ └── helm │ │ │ │ └── wordpress │ │ │ │ ├── .helmignore │ │ │ │ ├── Chart.yaml │ │ │ │ ├── config │ │ │ │ ├── fluentd.conf │ │ │ │ └── nginx-default.conf │ │ │ │ ├── templates │ │ │ │ ├── fluentd.yaml │ │ │ │ ├── mysql.yaml │ │ │ │ ├── nginx.yaml │ │ │ │ └── wordpress.yaml │ │ │ │ └── values.yaml │ │ └── assets │ │ │ └── answer.png │ └── taints_tolerations │ │ └── README.md ├── basic │ ├── 0-local-k8s-kubeadm │ │ └── README.md │ ├── 1-namespace │ │ └── README.md │ ├── 2-pod │ │ ├── README.md │ │ └── YAML.md │ ├── 3-volume │ │ ├── README.md │ │ ├── ans │ │ │ └── hostpath.yaml │ │ └── assets │ │ │ └── pod.png │ ├── 4-persistence-volume │ │ └── README.md │ ├── 5-service │ │ ├── README.md │ │ └── assets │ │ │ └── pod-svc.png │ ├── 6-configuration │ │ └── README.md │ ├── 7-system-design │ │ ├── README.md │ │ └── assets │ │ │ └── example.png │ └── 8-ingress │ │ └── README.md └── ckad │ ├── 0 │ └── README.md │ ├── 1 │ └── README.md │ ├── 2 │ └── README.md │ ├── 3 │ ├── README.md │ └── deployment.yaml │ ├── 4 │ └── README.md │ ├── 5 │ └── README.md │ ├── 6 │ ├── README.md │ └── pod.yaml │ ├── 7 │ ├── README.md │ └── pod.yaml │ └── 8 │ ├── README.md │ └── pod.yaml ├── homework ├── 1 │ ├── README.md │ ├── ans │ │ └── homework │ │ │ ├── architecture.png │ │ │ ├── conf │ │ │ ├── fluentd.conf │ │ │ └── nginx.conf │ │ │ ├── configmap.yaml │ │ │ ├── demo-wordpress-css-issue │ │ │ └── demo-nginx.yaml │ │ │ ├── pod-mysql.yaml │ │ │ ├── pod-nginx.yaml │ │ │ ├── pod-wordpress.yaml │ │ │ ├── secret.yaml │ │ │ └── svc.yaml │ └── assets │ │ └── hw.png └── 2 │ ├── 1_controllers.md │ ├── 2_hpa.md │ ├── 3_helm.md │ ├── ans │ └── 1-example-yaml │ │ ├── architecture.png │ │ ├── configmap.yaml │ │ ├── pod-mysql.yaml │ │ ├── pod-nginx.yaml │ │ ├── pod-wordpress.yaml │ │ ├── secret.yaml │ │ └── svc.yaml │ └── assets │ ├── example.png │ └── example2.png ├── k8s-object ├── README.md ├── daemonset │ ├── README.md │ └── ds.yaml ├── deployment │ ├── README.md │ └── depl.yaml ├── hpa │ ├── README.md │ └── hpa.yaml ├── job │ ├── cronjob.yaml │ └── job.yaml ├── minikube │ └── README.md ├── pod │ ├── README.md │ └── pod.yaml ├── service │ ├── README.md │ ├── pod-with-label-1.yaml │ ├── pod-with-label-2-with-probe.yaml │ ├── pod-with-label-2.yaml │ ├── pod-with-label-3.yaml │ └── svc.yaml ├── statefulset │ ├── storageclass-for-gce.yaml │ ├── storageclass-for-minikube.yaml │ └── sts.yaml └── volume │ ├── README.md │ ├── cfgmap.yaml │ ├── downwardapi.yaml │ ├── secret.yaml │ ├── variation │ ├── configmap-from-mk201309.yaml │ └── nginx-pod-from-akilakuma.yml │ └── volume.yaml ├── kubectl ├── README.md ├── kubectl-cheat-sheet-1.jpg ├── kubectl-cheat-sheet-2.jpg └── troubleshooting-guide.png └── network-policies ├── 00-create-cluster.md ├── 01-deny-all-traffic-to-an-application.md ├── 02-limit-traffic-to-an-application.md ├── 02a-allow-all-traffic-to-an-application.md ├── 03-deny-all-non-whitelisted-traffic-in-the-namespace.md ├── 04-deny-traffic-from-other-namespaces.md ├── 05-allow-traffic-from-all-namespaces.md ├── 06-allow-traffic-from-a-namespace.md ├── 07-allow-traffic-from-some-pods-in-another-namespace.md ├── 08-allow-external-traffic.md ├── 09-allow-traffic-only-to-a-port.md ├── 10-allowing-traffic-with-multiple-selectors.md ├── 11-deny-egress-traffic-from-an-application.md ├── 12-deny-all-non-whitelisted-traffic-from-the-namespace.md ├── 14-deny-external-egress-traffic.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md └── img ├── 1.gif ├── 2.gif ├── 3.gif ├── 4.gif ├── 5.gif ├── 6.gif ├── 8.gif └── 9.gif /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .DS_Store -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Kubernetes 容器編排平台 2 | 3 | ## 資料夾說明 4 | 5 | ```bash 6 | ├── kubectl: CLI 操作指令祕技 7 | ├── hands-on-*: 自己動手做 8 | └── k8s-object: Kubernetes 物件範例 9 | ``` 10 | 11 | ## Kubernetes Objects 範例 12 | 13 | * https://github.com/algolia/kubernetes-hands-on 14 | * https://github.com/collabnix/kubelabs 15 | 16 | -------------------------------------------------------------------------------- /hands-on/advanced/affinity/README.md: -------------------------------------------------------------------------------- 1 | # Kubernetes 節點親和性練習 2 | 3 | 根據以下範例,了解如何使用 Kubernetes 的節點親和性功能將 Pod 定位在特定節點上。 4 | 5 | ## 練習步驟 6 | 7 | 1. 為任意節點添加自定義標籤,例如 `user-=user-` (請將 `` 替換為您自己的 ID): 8 | 9 | ``` 10 | $ kubectl label node user-0=user-0 11 | ``` 12 | 13 | 2. 修改以下範例 YAML 文件,以創建使用節點親和性的 Deployment 14 | 15 | * 使用 `requiredDuringSchedulingIgnoredDuringExecution` 16 | 17 | ```yaml 18 | apiVersion: apps/v1 19 | kind: Deployment 20 | metadata: 21 | name: affinity-prefer-nginx 22 | spec: 23 | replicas: 1 24 | selector: 25 | matchLabels: 26 | app: nginx 27 | template: 28 | metadata: 29 | labels: 30 | app: nginx 31 | spec: 32 | # 在此添加 nodeAffinity 33 | containers: 34 | - image: nginx 35 | name: nginx 36 | resources: {} 37 | ``` 38 | 39 | 3. 創建成功後,確認 Pod 是否在指定節點上運行 40 | 41 | ``` 42 | $ kubectl get pod -o wide 43 | ``` 44 | 45 | ## 使用 Deployment 模擬 DaemonSet 的效果 46 | 47 | 1. 使用 `kubectl describe node` 查看要用作 `topologyKey` 的標籤,並利用 `Pod Anti-affinity` 確保每個 worker 節點都有一個 Pod。 48 | 49 | * `topologyKey` 可以使用 `kubernetes.io/hostname` 50 | 51 | 2. 參考以下範例 YAML 文件創建 2 個 Deployment,分別練習: 52 | 53 | * requiredDuringSchedulingIgnoredDuringExecution 54 | * preferredDuringSchedulingIgnoredDuringExecution 55 | 56 | ``` 57 | apiVersion: apps/v1 58 | kind: Deployment 59 | metadata: 60 | name: deployment-as-daemonset 61 | spec: 62 | replicas: <節點數量 + 1> 63 | selector: 64 | matchLabels: 65 | app: deployment-as-daemonset 66 | template: 67 | metadata: 68 | labels: 69 | app: deployment-as-daemonset 70 | spec: 71 | # 在此添加 pod antiAffinity 72 | containers: 73 | - image: nginx 74 | name: nginx 75 | resources: {} 76 | ``` 77 | 78 | 3. 確認 `required` 與 `preferred` 兩種做法的差異: 79 | 80 | ``` 81 | $ kubectl get pod -o wide 82 | ``` 83 | 84 | 通過以上練習,您將了解如何在 Kubernetes 中使用節點親和性和 Pod 反親和性功能, 85 | -------------------------------------------------------------------------------- /hands-on/advanced/controllers/README.md: -------------------------------------------------------------------------------- 1 | # Kubernetes Controllers 2 | 3 | * [Deployment](deploy.md) 4 | * [DaemonSet](daemonset.md) 5 | * [StatefulSet](statefulset.md) 6 | * [Job/CronJob](job-cronjob.md) 7 | -------------------------------------------------------------------------------- /hands-on/advanced/controllers/answers/deploy.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: nginx-deployment-1 5 | labels: 6 | app: nginx 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: nginx 12 | template: 13 | metadata: 14 | name: nginx-pod-1 15 | labels: 16 | app: nginx 17 | spec: 18 | containers: 19 | - name: nginx 20 | image: nginx:1.19.0 21 | imagePullPolicy: Always 22 | resources: 23 | requests: 24 | memory: "64Mi" 25 | cpu: "100m" 26 | limits: 27 | memory: "128Mi" 28 | cpu: "200m" 29 | livenessProbe: 30 | httpGet: 31 | port: 80 32 | path: / 33 | readinessProbe: 34 | httpGet: 35 | port: 80 36 | path: / -------------------------------------------------------------------------------- /hands-on/advanced/controllers/answers/statefulset.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: mysql-secret 5 | type: Opaque 6 | data: 7 | root_passwd: cGFzc3dvcmQ= 8 | user: ZEdWemRBbz0= 9 | user_passwd: cGFzc3dvcmQ= 10 | 11 | --- 12 | apiVersion: v1 13 | kind: ConfigMap 14 | metadata: 15 | name: mysql-cfgmap 16 | data: 17 | db_host: mysql-svc 18 | db_name: Test_1234 19 | 20 | --- 21 | apiVersion: v1 22 | kind: Service 23 | metadata: 24 | name: mysql-svc 25 | labels: 26 | app: mysql 27 | spec: 28 | ports: 29 | - port: 3306 30 | name: mysql 31 | clusterIP: None 32 | selector: 33 | app: mysql 34 | --- 35 | apiVersion: apps/v1 36 | kind: StatefulSet 37 | metadata: 38 | name: mysql 39 | spec: 40 | serviceName: "mysql-svc" 41 | replicas: 1 42 | selector: 43 | matchLabels: 44 | app: mysql 45 | template: 46 | metadata: 47 | labels: 48 | app: mysql 49 | spec: 50 | terminationGracePeriodSeconds: 10 51 | containers: 52 | - name: mysql 53 | image: mysql:5.6 54 | env: 55 | # Use secret in real usage 56 | - name: MYSQL_ROOT_PASSWORD 57 | valueFrom: 58 | secretKeyRef: 59 | name: mysql-secret 60 | key: root_passwd 61 | - name: MYSQL_USER 62 | valueFrom: 63 | secretKeyRef: 64 | name: mysql-secret 65 | key: user 66 | - name: MYSQL_PASSWORD 67 | valueFrom: 68 | secretKeyRef: 69 | name: mysql-secret 70 | key: user_passwd 71 | - name: MYSQL_DATABASE 72 | valueFrom: 73 | configMapKeyRef: 74 | name: mysql-cfgmap 75 | key: db_name 76 | ports: 77 | - containerPort: 3306 78 | name: mysql 79 | volumeMounts: 80 | - name: mysql-vol 81 | mountPath: /var/lib/mysql 82 | volumeClaimTemplates: 83 | - metadata: 84 | name: mysql-vol 85 | spec: 86 | accessModes: [ "ReadWriteOnce" ] 87 | resources: 88 | requests: 89 | storage: 20Gi 90 | --- 91 | apiVersion: apps/v1 92 | kind: Deployment 93 | metadata: 94 | name: myapp 95 | spec: 96 | selector: 97 | matchLabels: 98 | app: myapp 99 | template: 100 | metadata: 101 | labels: 102 | app: myapp 103 | spec: 104 | containers: 105 | - name: myapp 106 | image: wordpress 107 | env: 108 | - name: WORDPRESS_DB_HOST 109 | valueFrom: 110 | configMapKeyRef: 111 | name: mysql-cfgmap 112 | key: db_host 113 | - name: WORDPRESS_DB_USER 114 | valueFrom: 115 | secretKeyRef: 116 | name: mysql-secret 117 | key: user 118 | - name: WORDPRESS_DB_PASSWORD 119 | valueFrom: 120 | secretKeyRef: 121 | name: mysql-secret 122 | key: root_passwd 123 | - name: WORDPRESS_DB_NAME 124 | valueFrom: 125 | configMapKeyRef: 126 | name: mysql-cfgmap 127 | key: db_name 128 | ports: 129 | - containerPort: 80 -------------------------------------------------------------------------------- /hands-on/advanced/controllers/daemonset/daemonset.md: -------------------------------------------------------------------------------- 1 | # DaemonSet 2 | 3 | * 請為節點加上標籤 `network: 10g` 4 | * 請將 daemonset.yaml 加上以下設定 5 | * nodeSelector: 要部署到含有 `network: 10g` 的節點上 6 | 7 | # 升級策略 8 | 9 | * OnDelete v.s RollingUpdate -------------------------------------------------------------------------------- /hands-on/advanced/controllers/daemonset/daemonset.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: DaemonSet 3 | metadata: 4 | name: nginx-daemonset-1 5 | labels: 6 | app: nginx 7 | spec: 8 | selector: 9 | matchLabels: 10 | app: nginx 11 | updateStrategy: 12 | type: RollingUpdate 13 | rollingUpdate: 14 | maxUnavailable: 1 15 | template: 16 | metadata: 17 | name: nginx-pod-1 18 | labels: 19 | app: nginx 20 | spec: 21 | containers: 22 | - image: nginx:latest 23 | imagePullPolicy: Always 24 | name: nginx 25 | terminationGracePeriodSeconds: 10 # small value just for demonstration 26 | -------------------------------------------------------------------------------- /hands-on/advanced/controllers/deployment/deploy.md: -------------------------------------------------------------------------------- 1 | # Deployment 2 | 3 | * 請將 deploy.yaml 加上以下設定 4 | * readiness/liveness probe 5 | * resources.requests 與 resources.limits 限制 6 | 7 | # 測試滾動升級相關指令 8 | 9 | * 確認升級狀況 10 | 11 | ``` 12 | $ kubectl rollout status deployment nginx 13 | ``` 14 | 15 | * 暫停升級 16 | 17 | ``` 18 | $ kubectl rollout pause deployment 19 | ``` 20 | 21 | * 繼續升級 22 | 23 | ``` 24 | $ kubectl rollout resume deployment 25 | ``` 26 | 27 | * 查看升級歷史紀錄 28 | 29 | ``` 30 | $ kubectl rollout history deployment 31 | ``` 32 | 33 | * 回滾至特定版本 34 | 35 | ``` 36 | $ kubectl rollout undo deployment 37 | $ kubectl rollout undo deployment --to-revision= 38 | ``` 39 | 40 | * 紀錄升級過程,以呈現在 rollout history 41 | 42 | ``` 43 | $ kubectl apply -f --record 44 | ``` -------------------------------------------------------------------------------- /hands-on/advanced/controllers/deployment/deploy.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: nginx-deployment-1 5 | labels: 6 | app: nginx 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: nginx 12 | template: 13 | metadata: 14 | name: nginx-pod-1 15 | labels: 16 | app: nginx 17 | spec: 18 | containers: 19 | - image: nginx:latest 20 | imagePullPolicy: Always 21 | name: nginx -------------------------------------------------------------------------------- /hands-on/advanced/controllers/job-cronjob/job-cronjob.md: -------------------------------------------------------------------------------- 1 | # Job/CronJob 2 | 3 | * 查看 job / cronjob 執行結果 4 | * 暫時停止 cronjob: `.spec.suspend` 設為 `true` -------------------------------------------------------------------------------- /hands-on/advanced/controllers/job-cronjob/job-cronjob.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: batch/v1 2 | kind: Job 3 | metadata: 4 | name: hello 5 | spec: 6 | template: 7 | spec: 8 | containers: 9 | - name: hellow 10 | image: busybox 11 | args: 12 | - /bin/sh 13 | - -c 14 | - date; echo Hello World 15 | restartPolicy: OnFailure 16 | 17 | --- 18 | apiVersion: batch/v1beta1 19 | kind: CronJob 20 | metadata: 21 | name: hello 22 | spec: 23 | schedule: "*/1 * * * *" 24 | successfulJobsHistoryLimit: 1 25 | failedJobsHistoryLimit: 3 26 | startingDeadlineSeconds: 60 27 | jobTemplate: 28 | spec: 29 | template: 30 | spec: 31 | containers: 32 | - name: hellow 33 | image: busybox 34 | args: 35 | - /bin/sh 36 | - -c 37 | - data; echo "Hello World" 38 | restartPolicy: OnFailure -------------------------------------------------------------------------------- /hands-on/advanced/controllers/statefulset/mysql-example/mysql-configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: mysql 5 | labels: 6 | app: mysql 7 | app.kubernetes.io/name: mysql 8 | data: 9 | primary.cnf: | 10 | # Apply this config only on the primary. 11 | [mysqld] 12 | log-bin 13 | replica.cnf: | 14 | # Apply this config only on replicas. 15 | [mysqld] 16 | super-read-only 17 | 18 | -------------------------------------------------------------------------------- /hands-on/advanced/controllers/statefulset/mysql-example/mysql-services.yaml: -------------------------------------------------------------------------------- 1 | # Headless service for stable DNS entries of StatefulSet members. 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: mysql 6 | labels: 7 | app: mysql 8 | app.kubernetes.io/name: mysql 9 | spec: 10 | ports: 11 | - name: mysql 12 | port: 3306 13 | clusterIP: None 14 | selector: 15 | app: mysql 16 | --- 17 | # Client service for connecting to any MySQL instance for reads. 18 | # For writes, you must instead connect to the primary: mysql-0.mysql. 19 | apiVersion: v1 20 | kind: Service 21 | metadata: 22 | name: mysql-read 23 | labels: 24 | app: mysql 25 | app.kubernetes.io/name: mysql 26 | readonly: "true" 27 | spec: 28 | ports: 29 | - name: mysql 30 | port: 3306 31 | selector: 32 | app: mysql 33 | -------------------------------------------------------------------------------- /hands-on/advanced/controllers/statefulset/mysql-example/mysql-statefulset.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: StatefulSet 3 | metadata: 4 | name: mysql 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: mysql 9 | app.kubernetes.io/name: mysql 10 | serviceName: mysql 11 | replicas: 3 12 | template: 13 | metadata: 14 | labels: 15 | app: mysql 16 | app.kubernetes.io/name: mysql 17 | spec: 18 | initContainers: 19 | - name: init-mysql 20 | image: mysql:5.7 21 | command: 22 | - bash 23 | - "-c" 24 | - | 25 | set -ex 26 | # Generate mysql server-id from pod ordinal index. 27 | [[ $HOSTNAME =~ -([0-9]+)$ ]] || exit 1 28 | ordinal=${BASH_REMATCH[1]} 29 | echo [mysqld] > /mnt/conf.d/server-id.cnf 30 | # Add an offset to avoid reserved server-id=0 value. 31 | echo server-id=$((100 + $ordinal)) >> /mnt/conf.d/server-id.cnf 32 | # Copy appropriate conf.d files from config-map to emptyDir. 33 | if [[ $ordinal -eq 0 ]]; then 34 | cp /mnt/config-map/primary.cnf /mnt/conf.d/ 35 | else 36 | cp /mnt/config-map/replica.cnf /mnt/conf.d/ 37 | fi 38 | volumeMounts: 39 | - name: conf 40 | mountPath: /mnt/conf.d 41 | - name: config-map 42 | mountPath: /mnt/config-map 43 | - name: clone-mysql 44 | image: gcr.io/google-samples/xtrabackup:1.0 45 | command: 46 | - bash 47 | - "-c" 48 | - | 49 | set -ex 50 | # Skip the clone if data already exists. 51 | [[ -d /var/lib/mysql/mysql ]] && exit 0 52 | # Skip the clone on primary (ordinal index 0). 53 | [[ `hostname` =~ -([0-9]+)$ ]] || exit 1 54 | ordinal=${BASH_REMATCH[1]} 55 | [[ $ordinal -eq 0 ]] && exit 0 56 | # Clone data from previous peer. 57 | ncat --recv-only mysql-$(($ordinal-1)).mysql 3307 | xbstream -x -C /var/lib/mysql 58 | # Prepare the backup. 59 | xtrabackup --prepare --target-dir=/var/lib/mysql 60 | volumeMounts: 61 | - name: data 62 | mountPath: /var/lib/mysql 63 | subPath: mysql 64 | - name: conf 65 | mountPath: /etc/mysql/conf.d 66 | containers: 67 | - name: mysql 68 | image: mysql:5.7 69 | env: 70 | - name: MYSQL_ALLOW_EMPTY_PASSWORD 71 | value: "1" 72 | ports: 73 | - name: mysql 74 | containerPort: 3306 75 | volumeMounts: 76 | - name: data 77 | mountPath: /var/lib/mysql 78 | subPath: mysql 79 | - name: conf 80 | mountPath: /etc/mysql/conf.d 81 | resources: 82 | requests: 83 | cpu: 500m 84 | memory: 1Gi 85 | livenessProbe: 86 | exec: 87 | command: ["mysqladmin", "ping"] 88 | initialDelaySeconds: 30 89 | periodSeconds: 10 90 | timeoutSeconds: 5 91 | readinessProbe: 92 | exec: 93 | # Check we can execute queries over TCP (skip-networking is off). 94 | command: ["mysql", "-h", "127.0.0.1", "-e", "SELECT 1"] 95 | initialDelaySeconds: 5 96 | periodSeconds: 2 97 | timeoutSeconds: 1 98 | - name: xtrabackup 99 | image: gcr.io/google-samples/xtrabackup:1.0 100 | ports: 101 | - name: xtrabackup 102 | containerPort: 3307 103 | command: 104 | - bash 105 | - "-c" 106 | - | 107 | set -ex 108 | cd /var/lib/mysql 109 | 110 | # Determine binlog position of cloned data, if any. 111 | if [[ -f xtrabackup_slave_info && "x$( change_master_to.sql.in 115 | # Ignore xtrabackup_binlog_info in this case (it's useless). 116 | rm -f xtrabackup_slave_info xtrabackup_binlog_info 117 | elif [[ -f xtrabackup_binlog_info ]]; then 118 | # We're cloning directly from primary. Parse binlog position. 119 | [[ `cat xtrabackup_binlog_info` =~ ^(.*?)[[:space:]]+(.*?)$ ]] || exit 1 120 | rm -f xtrabackup_binlog_info xtrabackup_slave_info 121 | echo "CHANGE MASTER TO MASTER_LOG_FILE='${BASH_REMATCH[1]}',\ 122 | MASTER_LOG_POS=${BASH_REMATCH[2]}" > change_master_to.sql.in 123 | fi 124 | 125 | # Check if we need to complete a clone by starting replication. 126 | if [[ -f change_master_to.sql.in ]]; then 127 | echo "Waiting for mysqld to be ready (accepting connections)" 128 | until mysql -h 127.0.0.1 -e "SELECT 1"; do sleep 1; done 129 | 130 | echo "Initializing replication from clone position" 131 | mysql -h 127.0.0.1 \ 132 | -e "$(=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} 5 | {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} 6 | {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} 7 | {{- end }} 8 | {{- end }} 9 | {{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} 10 | apiVersion: networking.k8s.io/v1 11 | {{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} 12 | apiVersion: networking.k8s.io/v1beta1 13 | {{- else -}} 14 | apiVersion: extensions/v1beta1 15 | {{- end }} 16 | kind: Ingress 17 | metadata: 18 | name: {{ $fullName }} 19 | labels: 20 | {{- include "0-example.labels" . | nindent 4 }} 21 | {{- with .Values.ingress.annotations }} 22 | annotations: 23 | {{- toYaml . | nindent 4 }} 24 | {{- end }} 25 | spec: 26 | {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} 27 | ingressClassName: {{ .Values.ingress.className }} 28 | {{- end }} 29 | {{- if .Values.ingress.tls }} 30 | tls: 31 | {{- range .Values.ingress.tls }} 32 | - hosts: 33 | {{- range .hosts }} 34 | - {{ . | quote }} 35 | {{- end }} 36 | secretName: {{ .secretName }} 37 | {{- end }} 38 | {{- end }} 39 | rules: 40 | {{- range .Values.ingress.hosts }} 41 | - host: {{ .host | quote }} 42 | http: 43 | paths: 44 | {{- range .paths }} 45 | - path: {{ .path }} 46 | {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} 47 | pathType: {{ .pathType }} 48 | {{- end }} 49 | backend: 50 | {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} 51 | service: 52 | name: {{ $fullName }} 53 | port: 54 | number: {{ $svcPort }} 55 | {{- else }} 56 | serviceName: {{ $fullName }} 57 | servicePort: {{ $svcPort }} 58 | {{- end }} 59 | {{- end }} 60 | {{- end }} 61 | {{- end }} 62 | -------------------------------------------------------------------------------- /hands-on/advanced/helm/examples/0-example/templates/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ include "0-example.fullname" . }} 5 | labels: 6 | {{- include "0-example.labels" . | nindent 4 }} 7 | spec: 8 | type: {{ .Values.service.type }} 9 | ports: 10 | - port: {{ .Values.service.port }} 11 | targetPort: http 12 | protocol: TCP 13 | name: http 14 | selector: 15 | {{- include "0-example.selectorLabels" . | nindent 4 }} 16 | -------------------------------------------------------------------------------- /hands-on/advanced/helm/examples/0-example/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.serviceAccount.create -}} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ include "0-example.serviceAccountName" . }} 6 | labels: 7 | {{- include "0-example.labels" . | nindent 4 }} 8 | {{- with .Values.serviceAccount.annotations }} 9 | annotations: 10 | {{- toYaml . | nindent 4 }} 11 | {{- end }} 12 | {{- end }} 13 | -------------------------------------------------------------------------------- /hands-on/advanced/helm/examples/0-example/templates/tests/test-connection.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: "{{ include "0-example.fullname" . }}-test-connection" 5 | labels: 6 | {{- include "0-example.labels" . | nindent 4 }} 7 | annotations: 8 | "helm.sh/hook": test 9 | spec: 10 | containers: 11 | - name: wget 12 | image: busybox 13 | command: ['wget'] 14 | args: ['{{ include "0-example.fullname" . }}:{{ .Values.service.port }}'] 15 | restartPolicy: Never 16 | -------------------------------------------------------------------------------- /hands-on/advanced/helm/examples/0-example/values.yaml: -------------------------------------------------------------------------------- 1 | # Default values for 0-example. 2 | # This is a YAML-formatted file. 3 | # Declare variables to be passed into your templates. 4 | 5 | replicaCount: 10 6 | 7 | image: 8 | repository: nginx 9 | pullPolicy: IfNotPresent 10 | # Overrides the image tag whose default is the chart appVersion. 11 | tag: "" 12 | 13 | imagePullSecrets: [] 14 | nameOverride: "" 15 | fullnameOverride: "" 16 | 17 | serviceAccount: 18 | # Specifies whether a service account should be created 19 | create: true 20 | # Annotations to add to the service account 21 | annotations: {} 22 | # The name of the service account to use. 23 | # If not set and create is true, a name is generated using the fullname template 24 | name: "" 25 | 26 | podAnnotations: {} 27 | 28 | podSecurityContext: {} 29 | # fsGroup: 2000 30 | 31 | securityContext: {} 32 | # capabilities: 33 | # drop: 34 | # - ALL 35 | # readOnlyRootFilesystem: true 36 | # runAsNonRoot: true 37 | # runAsUser: 1000 38 | 39 | service: 40 | type: ClusterIP 41 | port: 80 42 | 43 | ingress: 44 | enabled: false 45 | className: "" 46 | annotations: {} 47 | # kubernetes.io/ingress.class: nginx 48 | # kubernetes.io/tls-acme: "true" 49 | hosts: 50 | - host: chart-example.local 51 | paths: 52 | - path: / 53 | pathType: ImplementationSpecific 54 | tls: [] 55 | # - secretName: chart-example-tls 56 | # hosts: 57 | # - chart-example.local 58 | 59 | resources: {} 60 | # We usually recommend not to specify default resources and to leave this as a conscious 61 | # choice for the user. This also increases chances charts run on environments with little 62 | # resources, such as Minikube. If you do want to specify resources, uncomment the following 63 | # lines, adjust them as necessary, and remove the curly braces after 'resources:'. 64 | # limits: 65 | # cpu: 100m 66 | # memory: 128Mi 67 | # requests: 68 | # cpu: 100m 69 | # memory: 128Mi 70 | 71 | autoscaling: 72 | enabled: false 73 | minReplicas: 1 74 | maxReplicas: 100 75 | targetCPUUtilizationPercentage: 80 76 | # targetMemoryUtilizationPercentage: 80 77 | 78 | nodeSelector: {} 79 | 80 | tolerations: [] 81 | 82 | affinity: {} 83 | -------------------------------------------------------------------------------- /hands-on/advanced/helm/examples/1-builtin-objects/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | -------------------------------------------------------------------------------- /hands-on/advanced/helm/examples/1-builtin-objects/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: builtin-objects 3 | description: A Helm chart for Kubernetes 4 | 5 | # A chart can be either an 'application' or a 'library' chart. 6 | # 7 | # Application charts are a collection of templates that can be packaged into versioned archives 8 | # to be deployed. 9 | # 10 | # Library charts provide useful utilities or functions for the chart developer. They're included as 11 | # a dependency of application charts to inject those utilities and functions into the rendering 12 | # pipeline. Library charts do not define any templates and therefore cannot be deployed. 13 | type: application 14 | 15 | # This is the chart version. This version number should be incremented each time you make changes 16 | # to the chart and its templates, including the app version. 17 | # Versions are expected to follow Semantic Versioning (https://semver.org/) 18 | version: 0.1.0 19 | 20 | # This is the version number of the application being deployed. This version number should be 21 | # incremented each time you make changes to the application. Versions are not expected to 22 | # follow Semantic Versioning. They should reflect the version the application is using. 23 | # It is recommended to use it with quotes. 24 | appVersion: "1.16.0" 25 | -------------------------------------------------------------------------------- /hands-on/advanced/helm/examples/1-builtin-objects/templates/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | creationTimestamp: null 5 | labels: 6 | app: demo 7 | chartver: {{ .Chart.Version }} 8 | appver: {{ .Chart.AppVersion }} 9 | name: {{ .Release.Name }}-demo 10 | namespace: {{ .Release.Namespace }} 11 | spec: 12 | replicas: 1 13 | selector: 14 | matchLabels: 15 | app: demo 16 | strategy: {} 17 | template: 18 | metadata: 19 | creationTimestamp: null 20 | labels: 21 | app: demo 22 | spec: 23 | containers: 24 | - image: nginx 25 | name: nginx 26 | resources: {} -------------------------------------------------------------------------------- /hands-on/advanced/helm/examples/1-builtin-objects/values.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srcmesh-workshop/kubernetes-adoption-hands-on/c32f5533b37a5483c9d73944981343af7f3b99b5/hands-on/advanced/helm/examples/1-builtin-objects/values.yaml -------------------------------------------------------------------------------- /hands-on/advanced/helm/examples/2-values-files/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | -------------------------------------------------------------------------------- /hands-on/advanced/helm/examples/2-values-files/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: values-files 3 | description: A Helm chart for Kubernetes 4 | 5 | # A chart can be either an 'application' or a 'library' chart. 6 | # 7 | # Application charts are a collection of templates that can be packaged into versioned archives 8 | # to be deployed. 9 | # 10 | # Library charts provide useful utilities or functions for the chart developer. They're included as 11 | # a dependency of application charts to inject those utilities and functions into the rendering 12 | # pipeline. Library charts do not define any templates and therefore cannot be deployed. 13 | type: application 14 | 15 | # This is the chart version. This version number should be incremented each time you make changes 16 | # to the chart and its templates, including the app version. 17 | # Versions are expected to follow Semantic Versioning (https://semver.org/) 18 | version: 0.1.0 19 | 20 | # This is the version number of the application being deployed. This version number should be 21 | # incremented each time you make changes to the application. Versions are not expected to 22 | # follow Semantic Versioning. They should reflect the version the application is using. 23 | # It is recommended to use it with quotes. 24 | appVersion: "1.16.0" 25 | -------------------------------------------------------------------------------- /hands-on/advanced/helm/examples/2-values-files/README.md: -------------------------------------------------------------------------------- 1 | # Values Files 2 | 3 | `values.yaml` 會放置`常替換`的變數以利於不同需求的部署 4 | 5 | 通常來說,`values.yaml` 放置的是此 chart 的預設值,另外會根據`不同環境建立不同 values.yaml` 6 | 7 | # 覆蓋預設值 8 | 9 | * `--set` 10 | * `--set-file` 與 `--set-string` 為變體,請參考官網說明 11 | 12 | ```bash 13 | $ helm template demo . --set replicaCount=50 14 | ``` 15 | 16 | * `--values` 17 | 18 | ```bash 19 | $ helm template demo . -f values-prod.yaml 20 | ``` -------------------------------------------------------------------------------- /hands-on/advanced/helm/examples/2-values-files/templates/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | creationTimestamp: null 5 | labels: 6 | app: demo 7 | name: demo 8 | spec: 9 | replicas: {{ .Values.replicaCount }} 10 | selector: 11 | matchLabels: 12 | {{- with .Values.labels }} 13 | # Must not have any spaces in front of toYaml to preserve YAML structure. 14 | # Otherwise, it generates something like this: 15 | # matchLabels: 16 | # env: test 17 | # version: 1.0.0 18 | {{ toYaml . | indent 6 }} 19 | {{- end }} 20 | strategy: {} 21 | template: 22 | metadata: 23 | creationTimestamp: null 24 | labels: 25 | {{- range $key, $val := .Values.labels }} 26 | {{ $key }}: {{ $val | quote }} 27 | {{- end }} 28 | spec: 29 | containers: 30 | # If you have empty .Values.image.tag and template like 31 | # 32 | # - image: {{ .Values.image.repository }}:{{ .Values.image.tag }} 33 | # 34 | # In the end, the YAML would be like 35 | # 36 | # - image: nginx: 37 | # 38 | # Parser will then treat the second ":" as a field key instead of a value string of "image" 39 | # and failed the deployment. 40 | # 41 | # To avoid this, add quote 42 | # 43 | # "{{ .Values.image.repository }}:{{ .Values.image.tag }}" 44 | # 45 | # It will become 46 | # 47 | # - image: "nginx:" 48 | # 49 | # Or, always ensure .Values.image.tag is not empty 50 | - image: {{ .Values.image.repository }}:{{ .Values.image.tag }} 51 | name: nginx 52 | resources: {} -------------------------------------------------------------------------------- /hands-on/advanced/helm/examples/2-values-files/values-prod.yaml: -------------------------------------------------------------------------------- 1 | # Default values for values-files. 2 | # This is a YAML-formatted file. 3 | # Declare variables to be passed into your templates. 4 | 5 | replicaCount: 5 -------------------------------------------------------------------------------- /hands-on/advanced/helm/examples/2-values-files/values.yaml: -------------------------------------------------------------------------------- 1 | # Default values for values-files. 2 | # This is a YAML-formatted file. 3 | # Declare variables to be passed into your templates. 4 | 5 | replicaCount: 1 6 | 7 | image: 8 | repository: nginx 9 | pullPolicy: IfNotPresent 10 | # Overrides the image tag whose default is the chart appVersion. 11 | tag: "latest" 12 | 13 | labels: 14 | version: 1.0.0 15 | env: test 16 | -------------------------------------------------------------------------------- /hands-on/advanced/helm/examples/3-named-template/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | -------------------------------------------------------------------------------- /hands-on/advanced/helm/examples/3-named-template/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: named-template 3 | description: A Helm chart for Kubernetes 4 | 5 | # A chart can be either an 'application' or a 'library' chart. 6 | # 7 | # Application charts are a collection of templates that can be packaged into versioned archives 8 | # to be deployed. 9 | # 10 | # Library charts provide useful utilities or functions for the chart developer. They're included as 11 | # a dependency of application charts to inject those utilities and functions into the rendering 12 | # pipeline. Library charts do not define any templates and therefore cannot be deployed. 13 | type: application 14 | 15 | # This is the chart version. This version number should be incremented each time you make changes 16 | # to the chart and its templates, including the app version. 17 | # Versions are expected to follow Semantic Versioning (https://semver.org/) 18 | version: 0.1.0 19 | 20 | # This is the version number of the application being deployed. This version number should be 21 | # incremented each time you make changes to the application. Versions are not expected to 22 | # follow Semantic Versioning. They should reflect the version the application is using. 23 | # It is recommended to use it with quotes. 24 | appVersion: "1.16.0" 25 | -------------------------------------------------------------------------------- /hands-on/advanced/helm/examples/3-named-template/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{- define "nginx-resources" -}} 2 | limits: 3 | cpu: {{ .Values.nginx.resource.limits.cpu }} 4 | memory: 128Mi 5 | requests: 6 | cpu: 100m 7 | memory: {{ .Values.nginx.resource.requests.memory }} 8 | {{- end }} 9 | -------------------------------------------------------------------------------- /hands-on/advanced/helm/examples/3-named-template/templates/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | creationTimestamp: null 5 | labels: 6 | app: demo 7 | name: demo 8 | spec: 9 | replicas: 1 10 | selector: 11 | matchLabels: 12 | app: demo 13 | template: 14 | metadata: 15 | creationTimestamp: null 16 | labels: 17 | app: demo 18 | spec: 19 | containers: 20 | - image: nginx:latest 21 | name: nginx 22 | resources: 23 | # Remove all spaces to avoid generating wrong indents. 24 | {{ include "nginx-resources" . | indent 12 }} 25 | 26 | --- 27 | apiVersion: apps/v1 28 | kind: Deployment 29 | metadata: 30 | creationTimestamp: null 31 | labels: 32 | app: demo 33 | name: demo2 34 | spec: 35 | replicas: 1 36 | selector: 37 | matchLabels: 38 | app: demo 39 | template: 40 | metadata: 41 | creationTimestamp: null 42 | labels: 43 | app: demo 44 | spec: 45 | containers: 46 | - image: nginx:latest 47 | name: nginx 48 | resources: 49 | {{ include "nginx-resources" . | indent 12 }} -------------------------------------------------------------------------------- /hands-on/advanced/helm/examples/3-named-template/values.yaml: -------------------------------------------------------------------------------- 1 | # Default values for template-function. 2 | # This is a YAML-formatted file. 3 | # Declare variables to be passed into your templates. 4 | 5 | nginx: 6 | resource: 7 | requests: 8 | memory: 100Mi 9 | limits: 10 | cpu: 100m 11 | -------------------------------------------------------------------------------- /hands-on/advanced/helm/examples/4-access-files-in-template/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | -------------------------------------------------------------------------------- /hands-on/advanced/helm/examples/4-access-files-in-template/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: access-files-in-template 3 | description: A Helm chart for Kubernetes 4 | 5 | # A chart can be either an 'application' or a 'library' chart. 6 | # 7 | # Application charts are a collection of templates that can be packaged into versioned archives 8 | # to be deployed. 9 | # 10 | # Library charts provide useful utilities or functions for the chart developer. They're included as 11 | # a dependency of application charts to inject those utilities and functions into the rendering 12 | # pipeline. Library charts do not define any templates and therefore cannot be deployed. 13 | type: application 14 | 15 | # This is the chart version. This version number should be incremented each time you make changes 16 | # to the chart and its templates, including the app version. 17 | # Versions are expected to follow Semantic Versioning (https://semver.org/) 18 | version: 0.1.0 19 | 20 | # This is the version number of the application being deployed. This version number should be 21 | # incremented each time you make changes to the application. Versions are not expected to 22 | # follow Semantic Versioning. They should reflect the version the application is using. 23 | # It is recommended to use it with quotes. 24 | appVersion: "1.16.0" 25 | -------------------------------------------------------------------------------- /hands-on/advanced/helm/examples/4-access-files-in-template/conf/fluentd.conf: -------------------------------------------------------------------------------- 1 | 2 | type tail 3 | path /logs/**/access.log 4 | tag nginx.access 5 | format nginx 6 | 7 | 8 | 9 | @type tail 10 | format /^(?