Skip to content

Commit 46dfba5

Browse files
committed
Update devcontainer
Replace minikube with kind to match tests Signed-off-by: James Taylor <[email protected]>
1 parent 692087c commit 46dfba5

File tree

2 files changed

+50
-15
lines changed

2 files changed

+50
-15
lines changed

.devcontainer/devcontainer.json

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,29 @@
77

88
// Features to add to the dev container. More info: https://containers.dev/features.
99
"features": {
10-
"ghcr.io/devcontainers/features/python:1": {},
11-
"ghcr.io/devcontainers-contrib/features/mkdocs:2": {
12-
"plugins": "mkdocs-material mike"
13-
},
1410
"ghcr.io/devcontainers/features/docker-in-docker:2": {
15-
"enableNonRootDocker": "true",
16-
"moby": "true"
11+
"moby": true,
12+
"azureDnsAutoDetection": true,
13+
"installDockerBuildx": true,
14+
"installDockerComposeSwitch": false,
15+
"version": "latest",
16+
"dockerDashComposeVersion": "none"
1717
},
1818
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {
1919
"version": "latest",
20-
"helm": "latest",
21-
"minikube": "latest"
20+
"helm": "none",
21+
"minikube": "none"
22+
},
23+
"ghcr.io/devcontainers-extra/features/kind:1": {
24+
"version": "latest"
25+
},
26+
"ghcr.io/devcontainers/features/python:1": {
27+
"installTools": true,
28+
"version": "latest"
29+
},
30+
"ghcr.io/devcontainers-extra/features/mkdocs:2": {
31+
"version": "latest",
32+
"plugins": "mkdocs-material mike pymdown-extensions mkdocstrings[crystal,python] mkdocs-monorepo-plugin mkdocs-pdf-export-plugin mkdocs-awesome-pages-plugin"
2233
}
2334
},
2435

@@ -28,11 +39,6 @@
2839
// Use 'postCreateCommand' to run commands after the container is created.
2940
"postCreateCommand": ".devcontainer/postCreateCommand.sh",
3041

31-
// Use 'postStartCommand' to run commands after the container is created like starting minikube.
32-
"postStartCommand": {
33-
"minikube": "nohup bash -c 'minikube start &' > minikube.log 2>&1"
34-
},
35-
3642
// Configure tool-specific properties.
3743
// "customizations": {},
3844

@@ -41,7 +47,7 @@
4147

4248
"containerEnv": {
4349
"FABRIC_K8S_BUILDER_DEBUG": "true",
44-
"CORE_PEER_CHAINCODEADDRESS_HOST_OVERRIDE": "host.minikube.internal",
50+
"CORE_PEER_CHAINCODEADDRESS_HOST_OVERRIDE": "dockerhost",
4551
"CORE_PEER_CHAINCODELISTENADDRESS_HOST_OVERRIDE": "0.0.0.0"
4652
}
4753
}

CONTRIBUTING.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,36 @@ golangci-lint run ./...
4343
## Development environment
4444

4545
There is a [Visual Studio Code Dev Container](https://code.visualstudio.com/docs/devcontainers/containers) which should help develop and test the k8s builder in a consistent development environment.
46-
It includes a preconfigured nano Fabric test network and minikube which can be used to run end to end tests.
46+
It includes a preconfigured nano Fabric test network and [kind](https://kind.sigs.k8s.io/), which can be used to run end to end tests.
47+
48+
Create a Kubernetes cluster.
49+
50+
```shell
51+
kind create cluster --name fabric-builder-k8s-dev
52+
```
53+
54+
Allow chaincode pods to reach peers.
55+
(Make sure the gateway IP is correct! See [Is it possible accessing host machine ports from Kind pods?](https://github.com/kubernetes-sigs/kind/issues/1200) for background.)
56+
57+
```shell
58+
kubectl apply -f - <<EOF
59+
---
60+
apiVersion: v1
61+
kind: Endpoints
62+
metadata:
63+
name: dockerhost
64+
subsets:
65+
- addresses:
66+
- ip: 172.18.0.1 # this is the gateway IP in the "bridge" docker network
67+
---
68+
apiVersion: v1
69+
kind: Service
70+
metadata:
71+
name: dockerhost
72+
spec:
73+
clusterIP: None
74+
EOF
75+
```
4776

4877
Build your latest k8s builder changes.
4978

0 commit comments

Comments
 (0)