Skip to content

Commit

Permalink
fix: change k8s port to 5800
Browse files Browse the repository at this point in the history
  • Loading branch information
tcp committed Feb 8, 2024
1 parent e0e6921 commit 9f1e129
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion docs/source/deployment/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ Ingress is not working on Mac and Docker and the issue is `being tracked here <h
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
57f73851bf08 gcr.io/k8s-minikube/kicbase:v0.0.25 "/usr/local/bin/entr…" 46 hours ago Up About a minute 127.0.0.1:57954->22/tcp, 127.0.0.1:57955->2376/tcp, 127.0.0.1:57957->5000/tcp, 127.0.0.1:57958->8443/tcp, 127.0.0.1:57956->32443/tcp minikube
57f73851bf08 gcr.io/k8s-minikube/kicbase:v0.0.25 "/usr/local/bin/entr…" 46 hours ago Up About a minute 127.0.0.1:57954->22/tcp, 127.0.0.1:57955->2376/tcp, 127.0.0.1:57957->5800/tcp, 127.0.0.1:57958->8443/tcp, 127.0.0.1:57956->32443/tcp minikube
Expand Down
2 changes: 1 addition & 1 deletion notebooks/api/0.8/11-container-images-k8s.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
"metadata": {},
"outputs": [],
"source": [
"registry = \"k3d-registry.localhost:5000\"\n",
"registry = \"k3d-registry.localhost:5800\"\n",
"repo = \"openmined/grid-backend\"\n",
"\n",
"res = requests.get(url=f\"http://{registry}/v2/{repo}/tags/list\")\n",
Expand Down
2 changes: 1 addition & 1 deletion packages/grid/helm/syft/templates/registry-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
ports:
- protocol: TCP
port: 80
targetPort: 5000
targetPort: 5800
selector:
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/component: registry
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
- name: REGISTRY_STORAGE_DELETE_ENABLED
value: "true"
ports:
- containerPort: 5000
- containerPort: 5800
volumeMounts:
- mountPath: /var/lib/registry
name: registry-data
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_images.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

REGISTRY=${1:-"k3d-registry.localhost:5000"}
REGISTRY=${1:-"k3d-registry.localhost:5800"}
TAG=${2:-"latest"}

docker image build -f ./packages/grid/backend/backend.dockerfile --target backend -t $REGISTRY/openmined/grid-backend:$TAG ./packages
Expand Down
24 changes: 12 additions & 12 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ commands =


# Creating registory
bash -c 'k3d registry create registry.localhost --port 5000 -v `pwd`/k3d-registry:/var/lib/registry || true'
bash -c 'k3d registry create registry.localhost --port 5800 -v `pwd`/k3d-registry:/var/lib/registry || true'

# Creating testgateway1 cluster on port 9081
bash -c 'NODE_NAME=testgateway1 NODE_PORT=9081 && \
Expand All @@ -707,7 +707,7 @@ commands =
-p gateway \
--var NODE_NAME=$NODE_NAME \
--var TEST_MODE=1 \
--var CONTAINER_REGISTRY=k3d-registry.localhost:5000 \
--var CONTAINER_REGISTRY=k3d-registry.localhost:5800 \
--var NODE_TYPE=gateway \
deploy -b; \
do ((--r))||exit;echo "retrying" && sleep 20;done)'
Expand All @@ -723,7 +723,7 @@ commands =
devspace --no-warn --kube-context "k3d-$NODE_NAME" --namespace $NODE_NAME \
--var NODE_NAME=$NODE_NAME \
--var TEST_MODE=1 \
--var CONTAINER_REGISTRY=k3d-registry.localhost:5000 \
--var CONTAINER_REGISTRY=k3d-registry.localhost:5800 \
deploy -b; \
do ((--r))||exit;echo "retrying" && sleep 20;done)'

Expand Down Expand Up @@ -869,14 +869,14 @@ commands =

bash -c "k3d registry delete k3d-registry.localhost || true"

bash -c 'k3d registry create registry.localhost --port 5000 -v `pwd`/k3d-registry:/var/lib/registry || true'
bash -c 'k3d registry create registry.localhost --port 5800 -v `pwd`/k3d-registry:/var/lib/registry || true'

bash -c 'NODE_NAME=syft NODE_PORT=8080 && \
k3d cluster create syft -p "$NODE_PORT:80@loadbalancer" --registry-use k3d-registry.localhost || true \
k3d cluster start syft'

; skopeo list-tags --tls-verify=false docker://k3d-registry.localhost:5000/openmined/grid-backend
; skopeo inspect --tls-verify=false docker://k3d-registry.localhost:5000/openmined/grid-backend:f1725f
; skopeo list-tags --tls-verify=false docker://k3d-registry.localhost:5800/openmined/grid-backend
; skopeo inspect --tls-verify=false docker://k3d-registry.localhost:5800/openmined/grid-backend:f1725f
; helm uninstall --kube-context k3d-syft --namespace syft syft
; helm install --kube-context k3d-syft --namespace syft syft ./syft
; k3d cluster create syft -p "8080:80@loadbalancer" && k3d cluster start syft
Expand Down Expand Up @@ -932,13 +932,13 @@ allowlist_externals =
sudo
commands =
; create registry
bash -c 'k3d registry create registry.localhost --port 5000 -v $HOME/.k3d-registry:/var/lib/registry || true'
bash -c 'k3d registry create registry.localhost --port 5800 -v $HOME/.k3d-registry:/var/lib/registry || true'

; add patches to host
bash -c 'if ! grep -q k3d-registry.localhost /etc/hosts; then sudo {envpython} scripts/patch_hosts.py --add-k3d-registry --fix-docker-hosts; fi'

; Fail this command if registry is not working
bash -c 'URL=http://k3d-registry.localhost:5000/v2/_catalog; curl -X GET $URL'
bash -c 'URL=http://k3d-registry.localhost:5800/v2/_catalog; curl -X GET $URL'

[testenv:dev.k8s.start]
description = Start local Kubernetes registry & cluster with k3d
Expand All @@ -953,7 +953,7 @@ commands =
tox -e dev.k8s.registry

; for NodePort to work add the following --> -p "NodePort:NodePort@loadbalancer"
bash -c 'k3d cluster create syft-dev -p "8080:80@loadbalancer" --registry-use k3d-registry.localhost:5000; \
bash -c 'k3d cluster create syft-dev -p "8080:80@loadbalancer" --registry-use k3d-registry.localhost:5800; \
kubectl create namespace syft || true'

; dump cluster info
Expand All @@ -968,7 +968,7 @@ allowlist_externals =
bash
commands =
; deploy syft helm charts
bash -c 'devspace deploy -b --kube-context k3d-syft-dev --namespace syft --var CONTAINER_REGISTRY=k3d-registry.localhost:5000'
bash -c 'devspace deploy -b --kube-context k3d-syft-dev --namespace syft --var CONTAINER_REGISTRY=k3d-registry.localhost:5800'

[testenv:dev.k8s.hotreload]
description = Start development with hot-reload in Kubernetes
Expand All @@ -979,7 +979,7 @@ allowlist_externals =
tox
commands =
; deploy syft helm charts with hot-reload
bash -c 'devspace dev --kube-context k3d-syft-dev --namespace syft --var CONTAINER_REGISTRY=k3d-registry.localhost:5000'
bash -c 'devspace dev --kube-context k3d-syft-dev --namespace syft --var CONTAINER_REGISTRY=k3d-registry.localhost:5800'

[testenv:dev.k8s.info]
description = Gather info about the localKubernetes cluster
Expand All @@ -1003,7 +1003,7 @@ allowlist_externals =
bash
commands =
bash -c 'devspace purge --force-purge --kube-context k3d-syft-dev --namespace syft; sleep 3'
bash -c 'devspace cleanup images --kube-context k3d-syft-dev --namespace syft --var CONTAINER_REGISTRY=k3d-registry.localhost:5000 || true'
bash -c 'devspace cleanup images --kube-context k3d-syft-dev --namespace syft --var CONTAINER_REGISTRY=k3d-registry.localhost:5800 || true'
bash -c 'kubectl config use-context k3d-syft-dev'
bash -c 'kubectl delete all --all --namespace syft || true'
bash -c 'kubectl delete pvc --all --namespace syft || true'
Expand Down

0 comments on commit 9f1e129

Please sign in to comment.