$ git diff
diff --git a/example.tfvars b/example.tfvars
index 177a1fe..a16914c 100644
--- a/example.tfvars
+++ b/example.tfvars
@@ -1,5 +1,5 @@
# AWS region where should the Minikube be deployed
-aws_region = "eu-central-1"
+aws_region = "ap-northeast-1"
# Name for role, policy and cloud formation stack (without DBG-DEV- prefix)
cluster_name = "my-minikube"
@@ -8,13 +8,13 @@ cluster_name = "my-minikube"
aws_instance_type = "t2.medium"
# SSH key for the machine
-ssh_public_key = "~/.ssh/id_rsa.pub"
+ssh_public_key = "~/.ssh/id_rsa.ubuntu.com.amazonaws.info.myservice.dev.all.pub"
# Subnet ID where the minikube should run
-aws_subnet_id = "subnet-8a3517f8"
+aws_subnet_id = "subnet-0a102dc87cd20932e"
# DNS zone where the domain is placed
-hosted_zone = "my-domain.com"
+hosted_zone = "my.service.com"
hosted_zone_private = false
# AMI image to use (if empty or not defined, latest CentOS 7 will be used)
2 年ぶりに Kubernetes を使います。以前、仕事で AWS とオンプレそれぞれにクラスタを構築して運用していたもの、構築部分は k8s プロフェッショナルなエンジニアが身近にいたせいでおんぶにだっこの状態でした。過去に Kubernetes The Hard Way を AWS で実施する をしたものの、2 年も経つとほとんど忘れてしまっています。今回は EKS を使います。
まずは動作を確認するために AWS が提供している Getting Started with Amazon EKS に則って進めてみました。基本的にはドキュメントの通りでしたが、AWS 側の都合で以下 2 点の修正が必要でしたのでワークアラウンドを残しておきます。
地雷1. NAT Gateway が作成できない AZ が存在する
Region に ap-northeast-1(Tokyo) を指定すると NAT Gateway を作成できずに Cloudformation がエラーになりました(個人的な経験だと法人だと a は使用できますが個人だと b と c しか使用できないので a 側にリソースを作成できないのはアカウントに依存するのかもしれません)
ワークアラウンドとしては単純に ap-northeast-1 以外のリージョンを選びました。最終的には ap-northeast-1 のどの AZ が問題なのかを明確にしたほうがいいですが、試用目的であればその限りではありません。今回は代わりに us-east-1(N.Virginia) を選びました。
地雷2. 選択した Region によっては Cloudformation で指定している AZ(a と b) でリソースに空きがない場合がある
us-east-1 を選択してクラスタを作ろうとしたのですが、AZ a にリソースの空きがないのが理由で AWS マネージメントコンソールがエラーになりました。
ワークアラウンドとしては a 以外の AZ を選びました。みんな a を使っているのかもしれないので、なるべく混んでいなそうな(?) e と f を選びます。AWS 側が提供している Cloudformation の YAML ファイル をローカルに DL して以下のように修正します。
$ cat combined.log
{"level":"info","message":"Shamshir started.","mode":"live","owner":"kyagi","repo":"awesome-project","service":"shamshir","timestamp":"2022-01-31 00:54:22"}
{"level":"info","message":"Shamshir got pulls: 2602,2598,2596,2575,2573,2557,2553,2551,2540,2539,2481,2478,2295,2281,1981,1951,1685","mode":"live","owner":"kyagi","repo":"awesome-project","service":"shamshir","timestamp":"2022-01-31 00:54:22"}
{"level":"info","message":"Shamshir added releasable label to pull/2598.","mode":"live","owner":"kyagi","repo":"awesome-project","service":"shamshir","timestamp":"2022-01-31 00:54:24"}
{"level":"info","message":"Shamshir added releasable label to pull/2596.","mode":"live","owner":"kyagi","repo":"awesome-project","service":"shamshir","timestamp":"2022-01-31 00:54:24"}
{"level":"info","message":"Shamshir added releasable label to pull/2575.","mode":"live","owner":"kyagi","repo":"awesome-project","service":"shamshir","timestamp":"2022-01-31 00:54:25"}
{"level":"info","message":"Shamshir removed releasable label from pull/2573.","mode":"live","owner":"kyagi","repo":"awesome-project","service":"shamshir","timestamp":"2022-01-31 00:54:26"}
{"level":"info","message":"Shamshir added releasable label to pull/2551.","mode":"live","owner":"kyagi","repo":"awesome-project","service":"shamshir","timestamp":"2022-01-31 00:54:28"}
{"level":"info","message":"Shamshir added releasable label to pull/2540.","mode":"live","owner":"kyagi","repo":"awesome-project","service":"shamshir","timestamp":"2022-01-31 00:54:29"}
{"level":"info","message":"Shamshir added releasable label to pull/2539.","mode":"live","owner":"kyagi","repo":"awesome-project","service":"shamshir","timestamp":"2022-01-31 00:54:30"}
{"level":"info","message":"Shamshir added releasable label to pull/2478.","mode":"live","owner":"kyagi","repo":"awesome-project","service":"shamshir","timestamp":"2022-01-31 00:54:31"}
{"level":"info","message":"Shamshir added releasable label to pull/2295.","mode":"live","owner":"kyagi","repo":"awesome-project","service":"shamshir","timestamp":"2022-01-31 00:54:32"}
{"level":"info","message":"Shamshir added releasable label to pull/1951.","mode":"live","owner":"kyagi","repo":"awesome-project","service":"shamshir","timestamp":"2022-01-31 00:54:34"}
{"level":"info","message":"Shamshir finished.","mode":"live","owner":"kyagi","repo":"awesome-project","service":"shamshir","timestamp":"2022-01-31 00:54:34"}
Github API (REST API) について
Github API では Issue と Pull Request でエンドポイントを共有しています("shared" actions for both features)。API Reference の Issue ページにはラベル処理がありますが Pulls ページにはラベル処理がありません。だからといって Pull Request にラベルをつけられないというわけではなく、Issue API のエンドポイントを使い key として pull_request を使用することで(shared) Pull Request に対してもラベル処理が可能です。
Note: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the pull_request key. Be aware that the id of a pull request returned from "Issues" endpoints will be an issue id. To find out the pull request id, use the "List pull requests" endpoint.
Every pull request is an issue, but not every issue is a pull request. For this reason, "shared" actions for both features, like manipulating assignees, labels and milestones, are provided within the Issues API.
https://docs.github.com/en/rest/reference/pulls