bug(local-dev): local development setup fails on all non-Kind Kubernetes clusters (K3s, Minikube, K3d)

オープン
#7,023 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

  • #7024 @parthtiw710 による — マージされずにクローズ

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
docker, helm, kubernetes

調査の方向性

Makefile のターゲット run/pipecd と関連するローカルの Helm values から始めて、イメージの公開と host-path ストレージのセットアップを追跡します。次に、Redis、MySQL、MinIO の deployment.yaml テンプレートを調べます。Kind、K3s、K3d、Minikube、およびその他の指定されたディストリビューションで、イメージの取得やストレージ権限に関する失敗なしにローカルセットアップが動作すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

kind/bug
What happened?

The local development environment (run via make run/pipecd and the associated local Helm values) is tightly coupled with Kind. When attempting to start the local development cluster on any non-Kind distribution (such as K3s, Minikube, K3d, or MicroK8s), the setup fails due to registry image pulling and persistent storage permission blockers.

Steps to Reproduce
  1. Configure your Kubernetes context to point to a local K3s or Minikube cluster.
  2. Enable local storage by setting localStorageVolumes.enabled: true in the Helm values.
  3. Run make run/pipecd.
  4. Observe:
    • The cluster fails to pull the newly built PipeCD image (ErrImagePull) because it cannot reach/resolve localhost:5001.
    • If the image is manually sideloaded, the database (mysql), cache (redis), and storage (minio) pods crash in a loop with Permission Denied errors.
Root Cause
  1. Registry Hardcoding: The Makefile currently assumes a Kind registry setup and runs a hardcoded docker push localhost:5001/... to publish images. Other clusters running on isolated runtimes (like containerd in K3s/K3d) cannot resolve this host registry out-of-the-box.
  2. Storage Permissions: HostPath directories (e.g. /tmp/pipecd-data/*) created by Kubernetes on the host system are owned by root. However, the MySQL, Redis, and MinIO containers run as non-root users (UID 999 or 1000) and lack write permissions to these directories.
Expected Behavior

The local development setup should be platform-agnostic, supporting K3s, Minikube, K3d, and other distributions seamlessly alongside Kind.

Proposed Solution
  1. Dynamic Environment Detection in Makefile: Update run/pipecd to inspect the active Kubernetes context.
    • For K3s/K3d, save the image and import it directly using sudo k3s ctr --namespace k8s.io images import.
    • For Minikube, load the image using minikube image load.
    • Fall back to docker push only for Kind/standard setups.
  2. Permission Initialization: Add initContainers to the Redis, MySQL, and MinIO template deployments in deployment.yaml that run as root (runAsUser: 0) to chown the mounted directories to the correct non-root UIDs before the main containers start.
主要言語
Go
スター
1.4k
フォーク
391
平均マージ
4日 1時間
マージ済み PR(30日)
58

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pipe-cd/pipecd のほかの issue

pipe-cd/pipecd の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。