You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "lfabriko (via GitHub)" <gi...@apache.org> on 2023/05/11 11:25:20 UTC

[GitHub] [camel-k] lfabriko opened a new pull request, #4363: Update kind installation via #4236

lfabriko opened a new pull request, #4363:
URL: https://github.com/apache/camel-k/pull/4363

   Instructions from https://github.com/apache/camel-k/issues/4236 to install kind cluster


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] essobedo commented on pull request #4363: Update kind installation via #4236

Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo commented on PR #4363:
URL: https://github.com/apache/camel-k/pull/4363#issuecomment-1543855306

   Just to be clear by "it is not the right approach", I mean what I proposed in the ticket https://github.com/apache/camel-k/issues/4236, it helps to workaround the problem but it is not a real fix


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] lfabriko closed pull request #4363: Update kind installation via #4236

Posted by "lfabriko (via GitHub)" <gi...@apache.org>.
lfabriko closed pull request #4363: Update kind installation via #4236
URL: https://github.com/apache/camel-k/pull/4363


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] lfabriko commented on a diff in pull request #4363: Update kind installation via #4236

Posted by "lfabriko (via GitHub)" <gi...@apache.org>.
lfabriko commented on code in PR #4363:
URL: https://github.com/apache/camel-k/pull/4363#discussion_r1191042506


##########
docs/modules/ROOT/pages/installation/platform/kind.adoc:
##########
@@ -1,25 +1,68 @@
 [[installation-on-kind]]
 = Installing Camel K on Kind
 
-Installing Camel K on Kind, with a public registry, doesn't require any special configuration.
+Assuming you have https://kind.sigs.k8s.io/docs/user/quick-start/#installation[Kind installed] and https://docs.docker.com/config/daemon/troubleshoot/#check-whether-docker-is-running[docker running], save and execute following script, which creates kind cluster and prepares the registry container:
 
+```
+#!/bin/sh
+set -o errexit
 
-Assuming you have Kind installed, then start by creating a cluster:
+# create registry container unless it already exists
+reg_name='kind-registry'
+reg_port='5001'
+if [ "$(docker inspect -f '{{.State.Running}}' "${reg_name}" 2>/dev/null)" != 'true' ]; then
+  docker run \
+    -d --restart=always -p "127.0.0.1:${reg_port}:5000" --name "${reg_name}" \
+    registry:2
+fi
 
-```
-kind create cluster
-```
+# create a cluster with the local registry enabled in containerd
+cat <<EOF | kind create cluster --config=-
+kind: Cluster
+apiVersion: kind.x-k8s.io/v1alpha4
+containerdConfigPatches:
+- |-
+  [plugins."io.containerd.grpc.v1.cri".registry.mirrors."${reg_name}:5000"]
+    endpoint = ["http://${reg_name}:5000"]
+EOF
 
-Create a secret with your registry username and password:
+# connect the registry to the cluster network if not already connected
+if [ "$(docker inspect -f='{{json .NetworkSettings.Networks.kind}}' "${reg_name}")" = 'null' ]; then
+  docker network connect "kind" "${reg_name}"
+fi
 
+# Document the local registry
+# https://github.com/kubernetes/enhancements/tree/master/keps/sig-cluster-lifecycle/generic/1755-communicating-a-local-registry
+cat <<EOF | kubectl apply -f -
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: local-registry-hosting
+  namespace: kube-public
+data:
+  localRegistryHosting.v1: |
+    host: "localhost:${reg_port}"
+    hostFromClusterNetwork: "${reg_name}:5000"
+    help: "https://kind.sigs.k8s.io/docs/user/local-registry/"
+EOF
+```
+Switch to your source code directory https://github.com/apache/camel-k[camel-k] and build image (camel-k:2.0.0-SNAPSHOT):
 ```
-kubectl -n default create secret docker-registry external-registry-secret --docker-username my-user --docker-password "password"
+make images
 ```
 
-Install Camel K operator on the cluster in the default namespace:
+Update your /etc/hosts by adding `kind-registry`:
+```
+127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 kind-registry
+```

Review Comment:
   @essobedo Sure, I'm sorry then



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] essobedo commented on a diff in pull request #4363: Update kind installation via #4236

Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo commented on code in PR #4363:
URL: https://github.com/apache/camel-k/pull/4363#discussion_r1191033412


##########
docs/modules/ROOT/pages/installation/platform/kind.adoc:
##########
@@ -1,25 +1,68 @@
 [[installation-on-kind]]
 = Installing Camel K on Kind
 
-Installing Camel K on Kind, with a public registry, doesn't require any special configuration.
+Assuming you have https://kind.sigs.k8s.io/docs/user/quick-start/#installation[Kind installed] and https://docs.docker.com/config/daemon/troubleshoot/#check-whether-docker-is-running[docker running], save and execute following script, which creates kind cluster and prepares the registry container:
 
+```
+#!/bin/sh
+set -o errexit
 
-Assuming you have Kind installed, then start by creating a cluster:
+# create registry container unless it already exists
+reg_name='kind-registry'
+reg_port='5001'
+if [ "$(docker inspect -f '{{.State.Running}}' "${reg_name}" 2>/dev/null)" != 'true' ]; then
+  docker run \
+    -d --restart=always -p "127.0.0.1:${reg_port}:5000" --name "${reg_name}" \
+    registry:2
+fi
 
-```
-kind create cluster
-```
+# create a cluster with the local registry enabled in containerd
+cat <<EOF | kind create cluster --config=-
+kind: Cluster
+apiVersion: kind.x-k8s.io/v1alpha4
+containerdConfigPatches:
+- |-
+  [plugins."io.containerd.grpc.v1.cri".registry.mirrors."${reg_name}:5000"]
+    endpoint = ["http://${reg_name}:5000"]
+EOF
 
-Create a secret with your registry username and password:
+# connect the registry to the cluster network if not already connected
+if [ "$(docker inspect -f='{{json .NetworkSettings.Networks.kind}}' "${reg_name}")" = 'null' ]; then
+  docker network connect "kind" "${reg_name}"
+fi
 
+# Document the local registry
+# https://github.com/kubernetes/enhancements/tree/master/keps/sig-cluster-lifecycle/generic/1755-communicating-a-local-registry
+cat <<EOF | kubectl apply -f -
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: local-registry-hosting
+  namespace: kube-public
+data:
+  localRegistryHosting.v1: |
+    host: "localhost:${reg_port}"
+    hostFromClusterNetwork: "${reg_name}:5000"
+    help: "https://kind.sigs.k8s.io/docs/user/local-registry/"
+EOF
+```
+Switch to your source code directory https://github.com/apache/camel-k[camel-k] and build image (camel-k:2.0.0-SNAPSHOT):
 ```
-kubectl -n default create secret docker-registry external-registry-secret --docker-username my-user --docker-password "password"
+make images
 ```
 
-Install Camel K operator on the cluster in the default namespace:
+Update your /etc/hosts by adding `kind-registry`:
+```
+127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 kind-registry
+```

Review Comment:
   I hope we can avoid that



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org