Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1154 Update examples notebooks in line with Helm v3 #1188

Merged
merged 4 commits into from
Dec 6, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
352 changes: 3 additions & 349 deletions examples/ambassador/canary/ambassador_canary.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,355 +11,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Prerequisites\n",
"## Setup Seldon Core\n",
"\n",
"You will need\n",
"\n",
" - [Git clone of Seldon Core](https://github.com/SeldonIO/seldon-core) running this notebook\n",
" - A running Kubernetes cluster with kubectl authenticated\n",
" - [Helm client](https://helm.sh/)\n",
" - Seldon Core Python Module : `pip install seldon-core`"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Creating a Kubernetes Cluster\n",
"\n",
"Follow the [Kubernetes documentation to create a cluster](https://kubernetes.io/docs/setup/).\n",
"\n",
"Once created ensure ```kubectl``` is authenticated against the running cluster."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Setup"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"namespace/seldon created\r\n"
]
}
],
"source": [
"!kubectl create namespace seldon"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Context \"minikube\" modified.\r\n"
]
}
],
"source": [
"!kubectl config set-context $(kubectl config current-context) --namespace=seldon"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"clusterrolebinding.rbac.authorization.k8s.io/kube-system-cluster-admin created\r\n"
]
}
],
"source": [
"!kubectl create clusterrolebinding kube-system-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Install Helm"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"serviceaccount/tiller created\n",
"clusterrolebinding.rbac.authorization.k8s.io/tiller created\n",
"$HELM_HOME has been configured at /home/clive/.helm.\n",
"\n",
"Tiller (the Helm server-side component) has been installed into your Kubernetes Cluster.\n",
"\n",
"Please note: by default, Tiller is deployed with an insecure 'allow unauthenticated users' policy.\n",
"To prevent this, run `helm init` with the --tiller-tls-verify flag.\n",
"For more information on securing your installation see: https://docs.helm.sh/using_helm/#securing-your-helm-installation\n",
"Happy Helming!\n"
]
}
],
"source": [
"!kubectl -n kube-system create sa tiller\n",
"!kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller\n",
"!helm init --service-account tiller"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Waiting for deployment \"tiller-deploy\" rollout to finish: 0 of 1 updated replicas are available...\n",
"deployment \"tiller-deploy\" successfully rolled out\n"
]
}
],
"source": [
"!kubectl rollout status deploy/tiller-deploy -n kube-system"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Start seldon-core"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"NAME: seldon-core\n",
"LAST DEPLOYED: Sun Jun 30 17:10:55 2019\n",
"NAMESPACE: seldon-system\n",
"STATUS: DEPLOYED\n",
"\n",
"RESOURCES:\n",
"==> v1/ClusterRole\n",
"NAME AGE\n",
"seldon-operator-manager-role 1s\n",
"\n",
"==> v1/ClusterRoleBinding\n",
"NAME AGE\n",
"seldon-operator-manager-rolebinding 1s\n",
"\n",
"==> v1/ConfigMap\n",
"NAME DATA AGE\n",
"seldon-spartakus-config 3 1s\n",
"\n",
"==> v1/Pod(related)\n",
"NAME READY STATUS RESTARTS AGE\n",
"seldon-operator-controller-manager-0 0/1 ContainerCreating 0 1s\n",
"seldon-spartakus-volunteer-5866b6df59-vd58f 0/1 ContainerCreating 0 1s\n",
"\n",
"==> v1/Secret\n",
"NAME TYPE DATA AGE\n",
"seldon-operator-webhook-server-secret Opaque 0 1s\n",
"\n",
"==> v1/Service\n",
"NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE\n",
"seldon-operator-controller-manager-service ClusterIP 10.107.70.152 <none> 443/TCP 1s\n",
"\n",
"==> v1/ServiceAccount\n",
"NAME SECRETS AGE\n",
"seldon-core-seldon-core-operator 1 1s\n",
"seldon-spartakus-volunteer 1 1s\n",
"\n",
"==> v1/StatefulSet\n",
"NAME READY AGE\n",
"seldon-operator-controller-manager 0/1 1s\n",
"\n",
"==> v1beta1/ClusterRole\n",
"NAME AGE\n",
"seldon-spartakus-volunteer 1s\n",
"\n",
"==> v1beta1/ClusterRoleBinding\n",
"NAME AGE\n",
"seldon-spartakus-volunteer 1s\n",
"\n",
"==> v1beta1/CustomResourceDefinition\n",
"NAME AGE\n",
"seldondeployments.machinelearning.seldon.io 1s\n",
"\n",
"==> v1beta1/Deployment\n",
"NAME READY UP-TO-DATE AVAILABLE AGE\n",
"seldon-spartakus-volunteer 0/1 1 0 1s\n",
"\n",
"\n",
"NOTES:\n",
"NOTES: TODO\n",
"\n",
"\n"
]
}
],
"source": [
"!helm install ../../../helm-charts/seldon-core-operator --name seldon-core --set usageMetrics.enabled=true --namespace seldon-system"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"partitioned roll out complete: 1 new pods have been updated...\r\n"
]
}
],
"source": [
"!kubectl rollout status deploy/seldon-controller-manager -n seldon-system"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Setup Ingress\n",
"Please note: There are reported gRPC issues with ambassador (see https://github.com/SeldonIO/seldon-core/issues/473)."
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"NAME: ambassador\n",
"LAST DEPLOYED: Sun Jun 30 17:12:39 2019\n",
"NAMESPACE: seldon\n",
"STATUS: DEPLOYED\n",
"\n",
"RESOURCES:\n",
"==> v1/Deployment\n",
"NAME READY UP-TO-DATE AVAILABLE AGE\n",
"ambassador 0/3 3 0 1s\n",
"\n",
"==> v1/Pod(related)\n",
"NAME READY STATUS RESTARTS AGE\n",
"ambassador-778b689797-kzj5f 0/1 ContainerCreating 0 1s\n",
"ambassador-778b689797-r8mqj 0/1 ContainerCreating 0 1s\n",
"ambassador-778b689797-wjm2k 0/1 ContainerCreating 0 1s\n",
"\n",
"==> v1/Service\n",
"NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE\n",
"ambassador LoadBalancer 10.108.250.98 <pending> 80:30114/TCP,443:32175/TCP 1s\n",
"ambassador-admins ClusterIP 10.109.203.166 <none> 8877/TCP 1s\n",
"\n",
"==> v1/ServiceAccount\n",
"NAME SECRETS AGE\n",
"ambassador 1 1s\n",
"\n",
"==> v1beta1/ClusterRole\n",
"NAME AGE\n",
"ambassador 1s\n",
"\n",
"==> v1beta1/ClusterRoleBinding\n",
"NAME AGE\n",
"ambassador 1s\n",
"\n",
"==> v1beta1/CustomResourceDefinition\n",
"NAME AGE\n",
"authservices.getambassador.io 1s\n",
"mappings.getambassador.io 1s\n",
"modules.getambassador.io 1s\n",
"ratelimitservices.getambassador.io 1s\n",
"tcpmappings.getambassador.io 1s\n",
"tlscontexts.getambassador.io 1s\n",
"tracingservices.getambassador.io 1s\n",
"\n",
"\n",
"NOTES:\n",
"Congratuations! You've successfully installed Ambassador.\n",
"\n",
"For help, visit our Slack at https://d6e.co/slack or view the documentation online at https://www.getambassador.io.\n",
"\n",
"To get the IP address of Ambassador, run the following commands:\n",
"NOTE: It may take a few minutes for the LoadBalancer IP to be available.\n",
" You can watch the status of by running 'kubectl get svc -w --namespace seldon ambassador'\n",
"\n",
" On GKE/Azure:\n",
" export SERVICE_IP=$(kubectl get svc --namespace seldon ambassador -o jsonpath='{.status.loadBalancer.ingress[0].ip}')\n",
"\n",
" On AWS:\n",
" export SERVICE_IP=$(kubectl get svc --namespace seldon ambassador -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')\n",
"\n",
" echo http://$SERVICE_IP:\n",
"\n"
]
}
],
"source": [
"!helm install stable/ambassador --name ambassador --set crds.keep=false"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Waiting for deployment \"ambassador\" rollout to finish: 0 of 3 updated replicas are available...\n",
"Waiting for deployment \"ambassador\" rollout to finish: 1 of 3 updated replicas are available...\n",
"Waiting for deployment \"ambassador\" rollout to finish: 2 of 3 updated replicas are available...\n",
"deployment \"ambassador\" successfully rolled out\n"
]
}
],
"source": [
"!kubectl rollout status deployment.apps/ambassador"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Port Forward to Ambassador\n",
"\n",
"```\n",
"kubectl port-forward $(kubectl get pods -n seldon -l app.kubernetes.io/name=ambassador -o jsonpath='{.items[0].metadata.name}') -n seldon 8003:8080\n",
"```"
"Follow the instructions to [Setup Cluster](../../seldon_core_setup.ipynb#Setup-Cluster) with [Ambassador Ingress](../../seldon_core_setup.ipynb#Ambassador) and [Install Seldon Core](../../seldon_core_setup.ipynb#Install-Seldon-Core)."
]
},
{
Expand Down Expand Up @@ -795,7 +449,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.7.5"
},
"varInspector": {
"cols": {
Expand Down
Loading