KubeWeekly #160

# はじめに
KubeWeeklyは毎週Kubernetesに関する興味深いニュースを提供しています。（http://bit.ly/kubeweekly ）この記事は 2019/01/23に発行された Kube Weekly #160 ( https://mailchi.mp/cncf/kubeweekly-160 ) を読んで、感じたことをメモ的にまとめたものです。
私の勘違いや説明不足による誤解もあるかと思いますので、この記事読んで「おっ」と思ったらURLを辿って本文を確認してください。

# The Headlines

## A Crash Course For Running Istio – Namely Labs – Medium
<table>
<tr>
  <td colspan="2"><a href="https://medium.com/namely-labs/a-crash-course-for-running-istio-1c6125930715">A Crash Course For Running Istio – Namely Labs – Medium</a></td>
</tr>
<tr>
  <td><img src="https://cdn-images-1.medium.com/max/1200/1*36mSzheRxdoU-71LY8wvOg.png"></td>
  <td>At Namely we’ve been running with Istio for a year now. Yes, that’s pretty much when it first came out. We had a major performance…</td>
</tr>
</table>

Istioの動作概要の説明とTips
IstioのSidecarがJobに注入されると、Jobが終わらなくなる、という問題も紹介している。
1年間Istioを使ってきたらしい。

## GitHub actions to deliver on kubernetes
<table>
<tr>
  <td colspan="2"><a href="https://gianarb.it/blog/kubernetes-github-action">GitHub actions to deliver on kubernetes</a></td>
</tr>
<tr>
  <td><img src="https://gianarb.it/img/hero/action.jpg"></td>
  <td>GitHub recently released a new feature called GitHub Actions. They are a serverless approach to allow developers to run their own code based on what happens to a particular repository. They are amazing for continuous integration and delivery. I used them to deploy and validate kubernetes code.</td>
</tr>
</table>

GitHub ActionsでKubernetesにCDする方法を紹介。

## Detect overspending by measuring idle Kubernetes resources
<table>
<tr>
  <td colspan="2"><a href="https://medium.com/kubecost/detect-overspending-by-measuring-idle-kubernetes-resources-d5d97eb205e0">Detect overspending by measuring idle Kubernetes resources</a></td>
</tr>
<tr>
  <td><img src="https://cdn-images-1.medium.com/max/1200/0*HRKVuSTN3QJoK6Vp"></td>
  <td>(This is part 2 of a series about cost monitoring and cost management for Kubernetes. In our first article, we talked about getting…</td>
</tr>
</table>

Kubernetesクラスタの無駄を調べるPrometheusのクエリの紹介。

# The Technical

## Kubernetes Events Explained
<table>
<tr>
  <td colspan="2"><a href="https://www.bluematador.com/blog/kubernetes-events-explained">Kubernetes Events Explained</a></td>
</tr>
<tr>
  <td><img src="https://www.bluematador.com/hubfs/blog/new/Safely-Removing-Pods-From-a-Kubernetes-Node/Safely-Removing-Pods-From-a-Kubernetes-Node.jpg#keepProtocol"></td>
  <td>Kubernetes keeps track of dozens of event types that can be used to expose interesting issues in your cluster. Learn what kind of events exist and which ones to look out for.</td>
</tr>
</table>

KubernetsのリソースであるEventの紹介。
`kubectl get evnents`の引数`--field-selector`のお勧めの設定や、主要なEventのTypeの紹介。
[caicloud/event_exporter](https://github.com/caicloud/event_exporter)を使ったEventの監視など

## How to Create an API Gateway using Ambassador on Kubernetes
<table>
<tr>
  <td colspan="2"><a href="https://medium.com/devopslinks/how-to-create-an-api-gateway-using-ambassador-on-kubernetes-95f181904ff7">How to Create an API Gateway using Ambassador on Kubernetes</a></td>
</tr>
<tr>
  <td><img src="https://cdn-images-1.medium.com/max/1200/1*EC4PgLdEudM5UkTKEsuFRA.jpeg"></td>
  <td>API Gateway is an important aspect in your Kubernetes deployment for your services. It acts as an single entry point and can help simplify…</td>
</tr>
</table>

API Gatewayの一つであるAmbassadorの紹介
インストール方法から、エントリポイントの登録方法、ステータスの確認方法など。

## Deploy Microsoft SQL Server on Google Kubernetes Engine (GKE)
<table>
<tr>
  <td colspan="2"><a href="https://medium.com/searce/deploy-microsoft-sql-server-on-google-kubernetes-engine-gke-14d646f05153">Deploy Microsoft SQL Server on Google Kubernetes Engine (GKE)</a></td>
</tr>
<tr>
  <td><img src="https://cdn-images-1.medium.com/max/1200/1*KR2Gf9QzBIaPevfEMGjgzQ.jpeg"></td>
  <td>If this post’s title brought you here — you either know SQL Server or Kubernetes(or both), so we will skip the intros.</td>
</tr>
</table>

Microsoft SQL ServerをGKE上に立ち上げる方法の紹介。PVCをつかってボリュームを用意している。
HA化は次回紹介するとのこと

## [Create a High-Availability Kubernetes Cluster on AWS with Kops](https://itnext.io/create-a-high-availability-kubernetes-cluster-on-aws-with-kops-c12c6cd4f976)

AWSでkopsを使ってHAのKubernetesクラスタを構築する方法を紹介。
また作成したクラスタにアプリケーションをデプロイして、Service,type=Loadbalancerを作成し、外部からアクセスできるようにする方法と、その樒を解説している。

## The basics of deploying Logstash pipelines to Kubernetes
<table>
<tr>
  <td colspan="2"><a href="https://towardsdatascience.com/the-basics-of-deploying-logstash-pipelines-to-kubernetes-94a470ad34d9">The basics of deploying Logstash pipelines to Kubernetes</a></td>
</tr>
<tr>
  <td><img src="https://cdn-images-1.medium.com/max/1200/1*7qQZXueRN60yMTk5Zi8z1g.jpeg"></td>
  <td>Do you have a long list of the things you want to learn on a list in your brain?</td>
</tr>
</table>

LogstashをKubernetes上で動かす方法の紹介
ローカルでFilebeatを動かして、Kubernetes上で動くLogstashにログを転送する。
またLogstashからElasticスタックにも、転送している。

## Creating Your Own Admission Controller in Kubernetes using Golang
<table>
<tr>
  <td colspan="2"><a href="https://itnext.io/creating-your-own-admission-controller-in-kubernetes-using-golang-3fad3b3e0c81">Creating Your Own Admission Controller in Kubernetes using Golang</a></td>
</tr>
<tr>
  <td><img src="https://cdn-images-1.medium.com/max/1200/0*ZTKiHAovX_J-5Ecp.png"></td>
  <td>The Kubernetes API is an amazing territory. Thanks to being built around the REST model, it gives us the possibility to manage all our…</td>
</tr>
</table>

Admission Controllerの概要と、validating admission controllerを実装する話。
非常に簡単なValidationの[サンプル](https://github.com/giantswarm/grumpy)の紹介。

## Kubernetes Pod Resource Limitations and Quality of Service
<table>
<tr>
  <td colspan="2"><a href="https://www.weave.works/blog/kubernetes-pod-resource-limitations-and-quality-of-service">Kubernetes Pod Resource Limitations and Quality of Service</a></td>
</tr>
<tr>
  <td><img src="https://www.weave.works/assets/images/blt4de0631cc88bd0a9/Blog_ Kubernetes Pod Resource Limitations and Quality of Service-cropped.png"></td>
  <td>Keep your workloads running efficiently in Kubernetes by correctly setting the request and limits on your deployments as well as the appropriate Quality of Service classes for your pods.</td>
</tr>
</table>

Kubernetesの機能であるResource Request and Limitの紹介。
またそれによって設定されるQuolity of Serviceの紹介。
DaemonSetの場合は、どうせ再スケジューリングされても同じNodeになるので、Guaranteedにしておくと良い。などのTips

## Running Argo Workflows Across Multiple Kubernetes Clusters
<table>
<tr>
  <td colspan="2"><a href="https://admiralty.io/blog/running-argo-workflows-across-multiple-kubernetes-clusters/">Running Argo Workflows Across Multiple Kubernetes Clusters</a></td>
</tr>
<tr>
  <td><img src="https://admiralty.io/static/Building_Argo_BM_TerrD603-half-e590f75ec5fcdccce8dc33ae9ae62937-20543.jpg"></td>
  <td>We recently open-sourced multicluster-scheduler, a system of Kubernetes controllers that intelligently schedules workloads across clusters. In this blog post, we will use it with Argo to run multicluster workflows (pipelines, DAGs, ETLs) that better utilize resources and/or combine data from different regions or clouds.</td>
</tr>
</table>


複数クラスタにまたがるスケジューリングを可能にする [admiraltyio/multicluster-scheduler](https://github.com/admiraltyio/multicluster-scheduler)の作者による。マルチクラスタにまたがるパイプラインをArgo Workflowで実現する方法の紹介。
このスケジューラは特定のアノテーションのついたPodを、場合によっては別クラスタで動作させる動きをする。該当Podはmutating pod admission webhookにより、ProxyするだけのPodに変更され、実際のPodは Delegate Podと呼ばれ、このスケジューラが別クラスタで実行することとなる。
Argoでのタスクをマルチクラスタで動作させるためには、単純にこのアノテーションを適切に設定するだけである。

この方式はfederation 2.0などよりもシンプルで、強力である。

## Update on Volume Snapshot Alpha for Kubernetes
<table>
<tr>
  <td colspan="2"><a href="https://kubernetes.io/blog/2019/01/17/update-on-volume-snapshot-alpha-for-kubernetes/">Update on Volume Snapshot Alpha for Kubernetes</a></td>
</tr>
<tr>
  
  <td>Authors: Jing Xu (Google), Xing Yang (Huawei), Saad Ali (Google)
Volume snapshotting support was introduced in Kubernetes v1.12 as an alpha feature. In Kubernetes v1.13, it remains an alpha feature, but a few enhancements were added and some breaking changes were made. This post summarizes the changes.
Breaking Changes CSI spec v1.0 introduced a few breaking changes to the volume snapshot feature. CSI driver maintainers should be aware of these changes as they upgrade their drivers to support v1.</td>
</tr>
</table>

CSIのVolume snapshottingの機能の1.13での破壊的な変更と、新機能についての紹介。

## OPA policy for Kubernetes label management
<table>
<tr>
  <td colspan="2"><a href="https://www.youtube.com/watch?v=xg19CD4TRC8">OPA policy for Kubernetes label management</a></td>
</tr>
<tr>
  <td><img src="https://i.ytimg.com/vi/xg19CD4TRC8/maxresdefault.jpg"></td>
  <td>Tim Hinrichs, CTO of Styra and Co-founder of Open Policy Agent, live codes an OPA policy for Kubernetes admission control. The policy requires an owner label...</td>
</tr>
</table>

動画（みていない）


# Editorial

## Open for event based tracing? – OpenTracing – Medium
<table>
<tr>
  <td colspan="2"><a href="https://medium.com/opentracing/open-for-event-based-tracing-a326c295f2a2">Open for event based tracing? – OpenTracing – Medium</a></td>
</tr>
<tr>
  <td><img src="https://cdn-images-1.medium.com/max/1200/1*nap7dtCxAgtmn9tFdw2d1w.png"></td>
  <td>In OpenTracing the fundamental concept for representing distributed traces is the (time) span: something that starts and then finishes…</td>
</tr>
</table>

OpenTracingなどが採用しているtime spanベースのトレーシングの限界を示し、新たにEventベースのトレーシングを提案している。

## Kubernetes Operators — When, how and the gotchas to keep in mind
<table>
<tr>
  <td colspan="2"><a href="https://medium.com/@cloudark/kubernetes-operators-when-how-and-the-gotchas-to-keep-in-mind-b13be9830346">Kubernetes Operators — When, how and the gotchas to keep in mind</a></td>
</tr>
<tr>
  <td><img src="https://cdn-images-1.medium.com/fit/c/100/100/1*WEmdF0pd_ttafCdrST0FXw.png"></td>
  <td>Kubernetes Operators have now become mainstream. An Operator is essentially a Kubernetes Custom Controller managing one or more Custom…</td>
</tr>
</table>

KubernetesのOperatorの紹介と、Spec設計の勘所について述べている。
また、Operatorがたくさん紹介されている。

## Database Operators Bring Stateful Workloads to Kubernetes - The New Stack
<table>
<tr>
  <td colspan="2"><a href="https://thenewstack.io/databases-operators-bring-stateful-workloads-to-kubernetes/">Database Operators Bring Stateful Workloads to Kubernetes - The New Stack</a></td>
</tr>
<tr>
  <td><img src="https://cdn.thenewstack.io/media/2018/08/d5cc641a-operators-red_hat.jpg"></td>
  <td>Last year, Red Hat formally launched the Operator Framework, a way to customize the APIs of Kubernetes for specific applications. With the Operator Framework, originally developed by CoreOS before the company was purchased by Red Hat, users can spin up an application, with all of its specific settings and dependencies, and have Kubernetes handle all …</td>
</tr>
</table>

KubernetesのOperatorの紹介として、データベースを扱うオペレータをいくつか紹介している。

- [Kubernetes – Autonomous Operator – Cloud | Couchbase](https://www.couchbase.com/products/cloud/kubernetes)
- [Crunchy PostgreSQL For Kubernetes | Crunchy Data](https://www.crunchydata.com/products/crunchy-postgresql-for-kubernetes/)
- [GitHub - pingcap/tidb-operator: TiDB operator creates and manages TiDB clusters running in Kubernetes](https://github.com/pingcap/tidb-operator)

## Kubernetes Failure Stories
<table>
<tr>
  <td colspan="2"><a href="https://srcco.de/posts/kubernetes-failure-stories.html">Kubernetes Failure Stories</a></td>
</tr>
<tr>
  <td><img src="https://srcco.de/galleries/kubernetes-logo.png"></td>
  <td>I started to compile a list of public failure/horror stories related to Kubernetes.
It should make it easier for people tasked with operations to find outage reports to learn from.

Since we started w</td>
</tr>
</table>

Kubernetesの失敗事例の紹介をしている　[GitHub - hjacobs/kubernetes-failure-stories: Compilation of public failure/horror stories related to Kubernetes](https://github.com/hjacobs/kubernetes-failure-stories) の紹介。

## Kubernetes is Boring - Let’s Talk Serverless
<table>
<tr>
  <td colspan="2"><a href="https://www.weave.works/blog/kubernetes-is-boring-lets-talk-serverless">Kubernetes is Boring - Let’s Talk Serverless</a></td>
</tr>
<tr>
  <td><img src="https://www.weave.works/assets/images/blt2e9bd375cb015fa3/kubernetes-boring.png"></td>
  <td>We sat down with Alexis Richardson to discuss what new technologies you can expect and how they might play out over the upcoming year.</td>
</tr>
</table>

Serverlessがこれから盛り上がるという話。どのような分野に及ぶか？
クラウドネイティブな開発環境とは？

## Why You Really Can (and Should) Be a Kubernetes Mentor - The New Stack
<table>
<tr>
  <td colspan="2"><a href="https://thenewstack.io/why-you-really-can-and-should-be-a-kubernetes-mentor/">Why You Really Can (and Should) Be a Kubernetes Mentor - The New Stack</a></td>
</tr>
<tr>
  <td><img src="https://cdn.thenewstack.io/media/2019/01/7d4b0bfb-outreaachy.jpg"></td>
  <td>In many respects, the future of Kubernetes depends on active members in the community.To discuss the essential role mentoring plays in Kubernetes’ growth, Libby Clark, gathered a group of experts and advocates for this podcast, hosted at KubeCon + CloudNativeCon North America in Seattle.</td>
</tr>
</table>

Kubernetes mentorship programs についてのPodCastの紹介。（聞いていない）

## Kubernetes jobs: 9 facts and figures
<table>
<tr>
  <td colspan="2"><a href="https://enterprisersproject.com/article/2019/1/kubernetes-jobs-9-facts-and-figures-0">Kubernetes jobs: 9 facts and figures</a></td>
</tr>
<tr>
  <td><img src="https://enterprisersproject.com/sites/default/files/images/cio_resume.png"></td>
  <td>Kubernetes jobs - some of today’s hottest IT roles - pay a national average of $144,648. What else should IT pros and hiring managers know?</td>
</tr>
</table>

Kubernetes絡みの採用の話。
Kubernetes Jobといっても、それはKubernetesリソースの一つである`Job`のことかもしれない。といった話から平均給与の話まで。

## What is Istio? The Kubernetes service mesh explained
<table>
<tr>
  <td colspan="2"><a href="https://www.computerworld.com.au/article/656621/what-istio-kubernetes-service-mesh-explained/">What is Istio? The Kubernetes service mesh explained</a></td>
</tr>
<tr>
  <td><img src="https://d321cxw853vaeo.cloudfront.net/dimg/600x600//idg_sites/logos/computerworld_6.png"></td>
  <td>Learn how Google’s Istio open source project conquers the complexities of managing the networks used to connect microservices</td>
</tr>
</table>

Istioの簡単な説明。（ServiceMeshとは、Istioの各コンポーネントの概要など）

## The Kubernetes startups we're watching in 2019 - SiliconANGLE
<table>
<tr>
  <td colspan="2"><a href="https://siliconangle.com/2019/01/22/kubernetes-startups-watching-2019-thecube/">The Kubernetes startups we're watching in 2019 - SiliconANGLE</a></td>
</tr>
<tr>
  <td><img src="https://d15shllkswkct0.cloudfront.net/wp-content/blogs.dir/1/files/2019/01/man-3338109_1920.jpg"></td>
  <td>The Kubernetes startups we're watching in 2019 - SiliconANGLE</td>
</tr>
</table>

Kubernetes周りで盛り上がっている分野と、その周辺のスタートアップ企業の紹介。

## Atlassian admits it did Kubernetes 'the hard way'
<table>
<tr>
  <td colspan="2"><a href="http://www.itnews.com.au/news/atlassian-admits-it-did-kubernetes-the-hard-way-517984">Atlassian admits it did Kubernetes 'the hard way'</a></td>
</tr>
<tr>
  <td><img src="https://i.nextmedia.com.au/News/Atlassian_Nick_Young.png"></td>
  <td>And wouldn't recommend others do the same.</td>
</tr>
</table>

AtlassianでのKubernetesの活用事例

- 20のクラスタ
- 最大の構成は14,000CPU, 50TB RAM

etcdのスケール性能に悩まされたとのこと、またセキュリティについても難しいとのこと。
そういった理由からこの記事では、kubeadmやkops、kubicornを利用する事を勧めている。