ということで今までは同じプロジェクト内にある GKE に Cloud Run を向いた ExternalName Service を作って、その Service を向いた Ingress を作り、そこでクラスタ内ですでに使っている oauth2-proxy を利用しつつ認証・認可・Proxyするようにしていた。ただそれはそれで Cloud run 側で IAM 認証が使えなくなって境界ベースの防御になるのでイケてない前時代 SOHO セキュリティになっていた。
Cloud Run と IAP の組み合わせが LB 無しでできるようになった
という悩みを長年抱えていて新しい Service を作るたびにもにょっていたのだが、今月 Cloud Run で IAP が LB なしで使える機能が出ていたのに気付いた。
ドキュメントにもあるが、Cloud Run の IAP で Principal として設定できるのは組織に属するユーザーのみである(正確に言うと、他のユーザーも設定はできるが動作しない)。そのため、普段の gmail アカウントを Principal に入れてアクセスしても IAP のエラー画面が返ってくる。
PS C:\Windows\System32> wsl.exe --list --running |Format-Hex
...
Offset Bytes Ascii
00010203040506070809 0A 0B 0C 0D 0E 0F
------ ----------------------------------------------- -----
000000000000000000550062007500 6E 0074007500200028 U b u n t u (
00000000000000100044006500660061007500 6C 00740029 D e f a u l t )
000000000000002000
-- Grafana userCREATEUSERIFNOTEXISTS grafana IDENTIFIEDBY'password' SETTINGS max_execution_time CHANGEABLE_IN_READONLY, PROFILE `readonly`;
GRANT SELECT, SHOW ON *.* TO grafana;
-- otel_collectorCREATEUSERIFNOTEXISTS otel_collector IDENTIFIEDBY'password';
CREATE DATABASE IFNOTEXISTS otel;
GRANT CREATE, INSERT, SELECT, dictGet ON otel.* TO otel_collector;
We recommend users avoid doing excessive event processing using operators or transform processors. These can incur considerable memory and CPU overhead, especially JSON parsing. It is possible to do all processing in ClickHouse at insert time with materialized views and columns with some exceptions - specifically, context-aware enrichment e.g. adding of k8s metadata. For more details see Extracting structure with SQL.
...
We recommend users disable auto schema creation and create their tables manually. This allows modification of the primary and secondary keys, as well as the opportunity to introduce additional columns for optimizing query performance. For further details see Schema design.
$ kubewrapper __complete -p staging get po
-> wrapper 内部では以下のように解釈する
$ kubewrapper -p staging __complete get po
-> そうすると wrapper の機能で自然と __complete が打たれる
$ kubectl __complete --context foo --namespace bar get po