Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

proposal(crossplane project): add configuration options to support users in closed networks and devcontainers

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

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
docker, go, kubernetes

調査の方向性

internal/project/controlplane/controlplane.go から始め、特に 419 行付近の Kubeconfig エクスポート、449 行付近のクラスター作成、472 行付近の createKindClusterConfig を確認します。既存の project コマンドと KinD 設定を追跡し、その後、devcontainer または閉鎖ネットワーク構成で、提案されている内部 kubeconfig、Docker ネットワーク、Registry-Mirror オプションを検証します。

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

説明

enhancement

Hi, awesome that crossplane project has been added and cant wait to try it out more, but unfortunately it is currently unusable for people who develop in devcontainers and in a closed company networks.

I've done some digging and i believe i would have to add 3 functionalities for this to work seamlessly.

  1. Configuring internal kubeconfig

Currently the crossplane project command only exports the kubeconfig with the external addresses:

https://github.com/crossplane/cli/blob/main/internal/project/controlplane/controlplane.go#L419

This could be fixed by adding an option to configure the export of the KinD kubeconfig with an --internal flag to use the internal addresses which are reachable inside devcontainer.

This fixes the following error on startup:

crossplane: error: failed to create crossplane-system namespace: failed to get server groups: Get "https://127.0.0.1:35341/api": dial tcp 127.0.0.1:35341: connect: connection refused
  1. Configuring kind docker network

While this solves the initial connectivity issue from a devcontainer, the cluster creation will still not work seamlessly as the "kind" docker network is automatically created. And this docker network does not automatically have connectivity to the dev-container.

A simple solution for this is that the user is allowed to specify the docker-network that kind should use when starting the up the containers. Perhaps with a --docker-network="" flag?

But KinD does not expose this as a configuration option in the go-library.

The only solution that i have found is to set the environment variable KIND_EXPERIMENTAL_DOCKER_NETWORK.

I quickly tested to set this environment-variable before the cluster creation before this line and it worked:

os.Setenv("KIND_EXPERIMENTAL_DOCKER_NETWORK", "the-network-my-devcontainer-is-in")
  1. Configure containerd registry mirrors

The last hurdle to overcome i believe, is configuring the containerd registry mirrors so that KinD fetches images from the configured registry-proxies.

In closed network environments, it is usually required that container-images are fetched via a central registry, so for example docker.io cannot be reached directly.

With the assumption that if a user passes ImageConfigs via the --init-resources flag, the user also most likely would like to configure the containerd registry mirrors, it seems like the best option is to parse the ImageConfigs the user supplies and configure the containerd with the containerdConfigPatches option in KinD like this:

containerdConfigPatches:
  - |
    [plugins."io.containerd.grpc.v1.cri".registry.mirrors]
      [plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
        endpoint = ["https://docker-remote.my-registry-proxy.com"]

This could be done in the existing createKindClusterConfig function.

What do you think? I'd be happy to send in a PR and test it more, but is this something you want to add support for?

Let me know if you have any questions!

What problem are you facing?

Running crossplane project in a dev-container and closed company network.

主要言語
Go
スター
19
フォーク
31
平均マージ
2日 15時間
マージ済み PR(30日)
53

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

crossplane/cli のほかの issue

crossplane/cli の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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