Kubenews #4
2020-12-18
配信URL
各タイトルを押していただくことで、実際の記事に飛びます。
Efficient Multi-Zone Networking with Topology Aware Routing
- kubeweekly(12/12)
- Google OSS Blog
- Service Topology
Topology Aware Routing of Services: topologyKeys
を用いてトラフィックを細かく分割する方法
- Kubernetes v1.17 alpha機能であり、影響範囲はPod-Pod間の通信
- TopologyKeyにおいて、Nodeのlabelを設定することで、上から書かれている順番に応じて、優先的に指定Labelを持つNode上で動くPodに通信が流れるように設定できる。
- 例えばマルチAZ構成において、クライアントと同一ノードまたは同一AZのようなネットワーク的に近いエンドポイントにトラフィックが優先的にルーティングされるように指定できる。
- 1Serviceに複数Endpointがひも付く構成になる。
以下のマニフェストでは、
1. kubernetes.io/hostname
より、同一Node
2. topology.kubernetes.io/zone
より、同一Zone
3. topology.kubernetes.io/region
より、同一region
4. *
より、その他全て
apiVersion: v1 kind: Service metadata: name: my-service spec: selector: app: my-app ports: - protocol: TCP port: 80 targetPort: 9376 topologyKeys: - "kubernetes.io/hostname" - "topology.kubernetes.io/zone" - "topology.kubernetes.io/region" - "*"
OPA The Easy Way
- kubeweekly(12/12)
- InflaCloud Blog
- How to Use a Policy Engine to Improve Your Security Posture
無料オンライントレーニングと[Styra DAS Free](https://www.styra.com/pricing)の宣伝。
[VScode OPA Plugin](https://marketplace.visualstudio.com/items?itemName=tsandall.opa)もあるらしい。
- Styra DAS Freeへのアクセス
- 自分のk8s clusterの登録
- 各種ルールの作成
- ルールのテスト
- etc
自分的に一番嬉しいのが、AddmissionReviewの取得ができるらしい!
Automating Volume Expansion Management
- kubeweekly(12/12)
- Redhut Openshift blog
- volume-expander-operator
Persistent Volumeを用いる際は、PrometheusにこのAlertを入れたほうがいい。
- alert: "Storage Saturation" labels: severity: critical annotations: summary: Storage usage over 75% persistentvolumeclaim: namespace: expr: kubelet_volume_stats_used_bytes / kubelet_volume_stats_capacity_bytes > 0.75 for: 1m ``` という前置きの元、PVの拡張を自動化するソリューションとして、volume-expander-operatorに関する紹介が始まる。 - 監視したいPVCのannotationに`volume-expander-operator.redhat-cop.io/autoexpand: “true”`を設定が必要。 - Once enabled, the volume-expander-operator will start polling the platform Prometheus instance that is part of OpenShift Monitoringとあり、OpenShiftでしかできなそう?? - `kubelet_volume_stats_used_bytes`と`kubelet_volume_stats_capacity_bytes`の2つのメトリックより判断。 - その他設定するannotaionは以下 - volume-expander-operator.redhat-c<200b><200b>op.io/expand-threshold-percent: ボリュームの拡張をトリガーする閾値 - volume-expander-operator.redhat-c<200b><200b>op.io/expand-by-percent: 拡張される既存ボリュームのサイズに基づくパーセンテージ - volume-expander-operator.redhat-c<200b><200b>op.io/expand-up-to: ボリュームの上限 - volume-expander-operator.redhat-c<200b><200b>op.io/polling-frequency: ポーリングする頻度 参考manifest
kind: PersistentVolumeClaim apiVersion: v1 metadata: annotations: volume-expander-operator.redhat-cop.io/autoexpand: 'true' volume-expander-operator.redhat-cop.io/expand-threshold-percent: "85" volume-expander-operator.redhat-cop.io/expand-by-percent: "20" volume-expander-operator.redhat-cop.io/polling-frequency: "1m" volume-expander-operator.redhat-cop.io/expand-up-to: "20Gi" name: to-be-expanded spec: accessModes: - ReadWriteOnce resources: requests: storage: "1Gi"