- Create a file named
kind-config.yaml
with the following content:
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
kubeadmConfigPatches:
- |
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
node-labels: "ingress-ready=true"
extraPortMappings:
- containerPort: 3080
hostPort: 3080
protocol: TCP
- containerPort: 30443
hostPort: 30443
protocol: TCP
📖 NOTE
ContainerPorts 3080 and 30443 are customisable, you can change them to any other port number, but make sure to update the port number in the following kubectl patch commands.
- Run the following command
kind create cluster --config=kind-config.yaml
-
Install the controller by using
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml
-
Patch the ports inside the controller's deployment, by running the following commands:
kubectl patch deployment -n ingress-nginx ingress-nginx-controller --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/ports/0/hostPort", "value": 3080}]'
kubectl patch deployment -n ingress-nginx ingress-nginx-controller --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/ports/1/hostPort", "value": 30443}]'
kubectl create namespace kubeflow
kubectl apply -k "https://github.com/kubeflow/model-registry/manifests/kustomize/overlays/db"
kubectl wait --for=condition=available -n kubeflow deployment/model-registry-deployment --timeout=1m
- Create a file named
mr-ingress.yaml
with the following content:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: model-registry
spec:
rules:
- host: "model-registry.io" # choose a name of your liking
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: model-registry-service
port:
number: 8080
-
Run the following command
kubectl apply -f mr-ingress.yaml -n kubeflow
-
Add the following line to the file
/etc/hosts
:
127.0.0.1 model-registry.io
Run curl http://model-registry.io:3080/api/model_registry/v1alpha3/registered_models
, you should see and output similar to this:
{"items":[],"nextPageToken":"","pageSize":0,"size":0}
kind delete cluster