Prometheus
Kubernetesでよく利用するコマンドやマニフェスト等のカンペ
kind: Deployment
spec:
  replicas: 1
  # ...
  strategy:
    type: Recreate
  template:
    #...
When to Use a Recreate Deployment
ケース: nginxイメージを使っていて、 /etc/nginx 配下にある nginx.conf のみを上書きしたい場合。ディレクトリごと上書きしてしまうと、同ディレクトリにあるその他ファイルまで上書きしてしまう。
解決策: subPath を利用する
# Pod リソースの設定
# name: nginx-config は ConfigMap の名前に変更
volumeMounts:
  - mountPath: /etc/nginx/nginx.conf
    subPath: nginx.conf
    name: nginx-config
    readOnly: true
  - mountPath: /etc/nginx/conf.d/default.conf
    subPath: default.conf
    name: nginx-config
    readOnly: true
Client --> GCP (GCE LoadBalancer) --> Ingress Nginx Controller --> Nginx (PHP-FPM) --> Application 構成の場合
# LBのIPアドレスを書く(Ingress Service: type LoadBalancerで作成しているリソース)
set_real_ip_from YOUR-LOADBALANCER-ID/32;
# GKEクラスタのIPアドレス帯。Ingress Controller (Nginx) Pod が動いているIPアドレス
set_real_ip_from 10.XX.0.0/16;
real_ip_header X-Forwarded-For;
real_ip_recursive on;
参考情報
shareProcessNamespace を利用して、apiVersion: batch/v1
kind: Job
metadata:
  name: job-xxx
spec:
  backoffLimit: 1
  template:
    spec:
      shareProcessNamespace: true
      restartPolicy: Never
      containers:
        - name: app
	        # ...
	        command: ["/bin/bash", "-c"]
	        args:
	          - |
	            # ... 最後に pkill する
	            pkill cloud_sql_proxy
wordpress cloudsql 2022/12/16 14:04:14 errors parsing config:
wordpress cloudsql 	googleapi: Error 403: The client is not authorized to make this request., notAuthorized
対策
Kubernetesでよく利用するコマンドやマニフェスト等のカンペ
Helm でよく利用するコマンドやマニフェスト等のカンペ
MySQLやPostgresのCRUD操作をお手軽にするためのWebインタフェース Adminer の起動
Helm configuration