作成したKubernetesのNamespaceを削除しようとしてもTerminatingのまま削除できないのでkubectl replaceコマンドでImperative(命令)的に削除する

1.この記事を書こうと思った背景 Amazon EKS 上で作成した Namespace を kubetcl delete namespace <namespace> と削除しようとしても削除できないことがあった。(ここで削除したい Namespace は argocd) $ kubectl get ns argocd NAME STATUS AGE argocd Terminating 50m $ kubectl get namespace argocd -o json { "apiVersion": "v1", "kind": "Namespace", "metadata": { "creationTimestamp": "2022-05-06T15:36:43Z", "deletionTimestamp": "2022-05-06T16:15:02Z", "labels": { "kubernetes.io/metadata.name": "argocd" }, "name": "argocd", "resourceVersion": "16545", "uid": "7e29177f-2c2c-4583-b027-49946160bf2b" }, "spec": { "finalizers": [ "kubernetes" ] }, "status": { "conditions": [ { "lastTransitionTime": "2022-05-06T16:15:09Z", "message": "All resources successfully discovered", "reason": "ResourcesDiscovered", "status": "False", "type": "NamespaceDeletionDiscoveryFailure" }, { "lastTransitionTime": "2022-05-06T16:15:09Z", "message": "All legacy kube types successfully parsed", "reason": "ParsedGroupVersions", "status": "False", "type": "NamespaceDeletionGroupVersionParsingFailure" }, { "lastTransitionTime": "2022-05-06T16:15:09Z", "message": "All content successfully deleted, may be waiting on finalization", "reason": "ContentDeleted", "status": "False", "type": "NamespaceDeletionContentFailure" }, { "lastTransitionTime": "2022-05-06T16:15:09Z", "message": "Some resources are remaining: applications....

May 7, 2022 · 2 min · gkzz

Github Actions の schedule で日時と曜日を指定することができなかったけどなんとかした

1.この記事を書こうと思った背景 Github Actionsでは、schedule ( schedule イベントやスケジュール実行ともいうがここでは、 schedule とする。)というイベントが用意されている https://docs.github.com/ja/actions/using-workflows/events-that-trigger-workflows#schedule 他のイベントとしては、push や workflow_dispatch などがある scheduleは、POSIX 規格の crontab の構文 で表記するのだが、日時の条件指定と曜日の指定はAND判定されるかと思いきや、OR判定されるようだと分かり、Github feedback や Support などで問い合わせた 問い合わせた結果、丁寧に教えていただいたので共有したい [bug] Schedule event’s multiple conditions are judged by OR conditions, not AND conditions #12804 日時の条件指定と曜日の指定のAND判定というのは、たとえば、第1月曜日の午前2:00に schedule を実行したい場合、下記のような書き方を指している(ただし、この書き方ではAND判定とならないので要注意!) on: schedule: - cron: '0 17 1-7 * 1' 2.長いので結論を書く Github Actions の cron で採用されている POSIX 規格の crontab の構文 では日時と曜日が指定されている場合、日時と曜日のOR判定となることが正しい if either the month or day of month is specified as an element or list, and the day of week is also specified as an element or list, then any day matching either the month and day of month, or the day of week, shall be matched....

March 11, 2022 · 3 min · gkzz

【InvalidParameterValue: The same permission must not appear multiple times】aws_security_group リソースを terraform apply したときのエラーの原因と解決策

1.この記事で達成したいこと aws_security_groupリソースを使って複数のインバウンドルールを追加しようとして引いたエラーを解決する $ terraform apply 略 │ Error: error updating Security Group (sg-000000000000): error authorizing Security Group (ingress) rules: InvalidParameterValue: The same permission must not appear multiple times │ status code: 400, request id: 000000000000000000 │ │ with aws_security_group.dummy-sg, │ on main.tf line 23, in resource "aws_security_group" "dummy-sg": │ 23: resource "aws_security_group" "dummy-sg" { エラーメッセージが指す23行目付近で書いていること $ view main.tf 略 23 resource "aws_security_group" "dummy-sg" { 24 name = "dummy-sg" 25 description = "dummy security group" 26 vpc_id = aws_vpc....

January 4, 2022 · 3 min · gkzz