筆者最近在部署 Kubernetes 過程中,好奇每個元件究竟安裝與不安裝對 Kubernetes 造成什麼影響?CoreDNS 主要的功能之一是當 Pods 做套件更新或安裝時,可以提供 DNS Forward 功能,將請求轉發至外部進行 Domain 解析,並從正確的位址下載套件進行安裝。
本篇就聚焦在 CoreDNS 將 Pods 的請求轉發至外部 DNS Server 進行解析的運作流程。
首先先檢視當前 Kubernetes 上運行的 Pods。
| version: "3" | |
| services: | |
| # configuration manager for NiFi | |
| zookeeper: | |
| hostname: myzookeeper | |
| container_name: zookeeper_container_persistent | |
| image: 'bitnami/zookeeper:3.7.0' # latest image as of 2021-11-09. | |
| restart: on-failure | |
| environment: | |
| - ALLOW_ANONYMOUS_LOGIN=yes |
| # Testing process to expand k8s PVCs without losing data | |
| #region Install | |
| # Check the current cluster | |
| kubectl config current-context | |
| # Add bitnami repo | |
| helm repo list | |
| helm repo add bitnami https://charts.bitnami.com/bitnami |
| ''' | |
| This function send Application Load Balancer logs to CloudWatch Logs. So you can use CloudWatch tools, like Insight or custom metrics. | |
| By default, ALB log its access in gz file in S3, and there is no way yo send the log directly to a Log Group / Log Stream. | |
| This lambda function is triggered on S3 "PUT" action (when ALB write its log file). It then download the file localy, unzip it, sort it, and stream it to a CloudWatch log groups. | |
| Installation | |
| Activate ALB logs, and indicate the S3 bucket and the prefix for the log files. Enable, on the bucket, the deletion of old log files |
| #!/bin/bash | |
| LIFECYCLE_POLICY='{"rules":[{"rulePriority":10,"description":"keeps 50 latest tagged images","selection":{"tagStatus":"tagged","countType":"imageCountMoreThan","countNumber":50,"tagPrefixList":["v"]},"action":{"type":"expire"}},{"rulePriority":20,"description":"keeps 5 latest untagged images","selection":{"tagStatus":"untagged","countType":"imageCountMoreThan","countNumber":5},"action":{"type":"expire"}},{"rulePriority":30,"description":"keeps latest 20 numeric-tagged images","selection":{"tagStatus":"tagged","countType":"imageCountMoreThan","tagPrefixList":["0","1","2","3","4","5","6","7","8","9"],"countNumber":20},"action":{"type":"expire"}},{"rulePriority":40,"description":"keeps latest 20 a-f tagged images","selection":{"tagStatus":"tagged","countType":"imageCountMoreThan","tagPrefixList":["a","b","c","d","e","f"],"countNumber":20},"action":{"type":"expire"}}]}' | |
| aws ecr put-lifecycle-policy --region ${AWS_REGION} --repository-name ${REPO} --lifecycle-policy-text ${LIFECYCLE_POLICY} || echo "Fa |
| QUESTION 1 | |
| Which SysV init configuration file should be modified to disable the ctrl-alt-delete key combination? | |
| A. /etc/keys | |
| B. /proc/keys | |
| C. /etc/inittab | |
| D. /proc/inittab | |
| E. /etc/reboot | |
| QUESTION 2 | |
| Which of the following information is stored within the BIOS? (Choose TWO correct answers.) |
get name and image and startTime
kubectl get pods -Ao jsonpath='{range .items[*]}{@.metadata.name}{" "}{@..spec..containers[*].image}{" "}{@.status.phase}{" "}{@.status.startTime}{"\n"}{end}'edited 10/2022 with .. and A suggestions
| curl -I -X OPTIONS \ | |
| -H "Origin: http://EXAMPLE.COM" \ | |
| -H 'Access-Control-Request-Method: GET' \ | |
| http://EXAMPLE.COM/SOMETHING 2>&1 | grep 'Access-Control-Allow-Origin' |