{"id":25784656,"url":"https://github.com/jbris/kubernetes-kind-examples","last_synced_at":"2026-05-05T10:35:41.472Z","repository":{"id":278869925,"uuid":"925466265","full_name":"JBris/kubernetes-kind-examples","owner":"JBris","description":"Local test deployment of Kubernetes over Kind with Helm, the Argo ecosystem and others installed.","archived":false,"fork":false,"pushed_at":"2025-02-23T07:22:06.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-23T07:30:01.545Z","etag":null,"topics":["argo","argo-cd","argo-events","argo-rollouts","argo-workflow","argo-workflows","argocd","helm","helm-charts","k8s","kind","kuberay","kubernetes","nginx","ray","redis","sealed-secrets","tekton","volcano"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JBris.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-31T23:56:25.000Z","updated_at":"2025-02-23T07:23:03.000Z","dependencies_parsed_at":"2025-02-23T07:30:17.059Z","dependency_job_id":null,"html_url":"https://github.com/JBris/kubernetes-kind-examples","commit_stats":null,"previous_names":["jbris/openmetadata-helm-argocd","jbris/kubernetes-kind-examples"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JBris%2Fkubernetes-kind-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JBris%2Fkubernetes-kind-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JBris%2Fkubernetes-kind-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JBris%2Fkubernetes-kind-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JBris","download_url":"https://codeload.github.com/JBris/kubernetes-kind-examples/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240995561,"owners_count":19890763,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["argo","argo-cd","argo-events","argo-rollouts","argo-workflow","argo-workflows","argocd","helm","helm-charts","k8s","kind","kuberay","kubernetes","nginx","ray","redis","sealed-secrets","tekton","volcano"],"created_at":"2025-02-27T08:31:36.328Z","updated_at":"2026-05-05T10:35:41.463Z","avatar_url":"https://github.com/JBris.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kubernetes Kind Examples\n\nLocal testing environment for Kubernetes using Kind with Helm, the Argo ecosystem, and others installed.\n\n# Table of contents\n\n- [Kubernetes Kind Examples](#kubernetes-kind-examples)\n- [Table of contents](#table-of-contents)\n- [kubectl](#kubectl)\n- [helm](#helm)\n- [kind](#kind)\n- [k9s](#k9s)\n- [Kubernetes dashboard](#kubernetes-dashboard)\n- [Add storage classes](#add-storage-classes)\n- [Sealed Secrets](#sealed-secrets)\n- [ArgoCD](#argocd)\n  - [ArgoCD apps](#argocd-apps)\n- [Argo Workflows](#argo-workflows)\n- [Argo Events](#argo-events)\n- [Argo Rollouts](#argo-rollouts)\n- [NGINX Ingress Operator](#nginx-ingress-operator)\n- [Cert Manager](#cert-manager)\n- [Jenkins](#jenkins)\n- [Argo Rollouts with NGINX](#argo-rollouts-with-nginx)\n- [Test ML stack](#test-ml-stack)\n- [Volcano](#volcano)\n- [KubeRay](#kuberay)\n  - [Other examples](#other-examples)\n- [Tekton](#tekton)\n- [Redis](#redis)\n- [Knative](#knative)\n  - [Quickstart](#quickstart)\n  - [End to end](#end-to-end)\n  - [Send Review Comment to Broker](#send-review-comment-to-broker)\n- [Kubeflow](#kubeflow)\n  - [Standalone Installation](#standalone-installation)\n  - [KServe Installation](#kserve-installation)\n    - [Secure InferenceService with ServiceMesh](#secure-inferenceservice-with-servicemesh)\n    - [KServe test run](#kserve-test-run)\n- [KEDA](#keda)\n  - [Scaled object](#scaled-object)\n  - [Scaled job](#scaled-job)\n  \n# kubectl \n\n```\nsudo apt-get update\n# apt-transport-https may be a dummy package; if so, you can skip that package\nsudo apt-get install -y apt-transport-https ca-certificates curl gnupg\n\n# If the folder `/etc/apt/keyrings` does not exist, it should be created before the curl command, read the note below.\n# sudo mkdir -p -m 755 /etc/apt/keyrings\ncurl -fsSL https://pkgs.k8s.io/core:/stable:/v1.32/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg\nsudo chmod 644 /etc/apt/keyrings/kubernetes-apt-keyring.gpg # allow unprivileged APT programs to read this keyring\n\n# This overwrites any existing configuration in /etc/apt/sources.list.d/kubernetes.list\necho 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.32/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list\nsudo chmod 644 /etc/apt/sources.list.d/kubernetes.list   # helps tools such as command-not-found to work correctly\n\nsudo apt-get update\nsudo apt-get install -y kubectl\n```\n\n# helm\n\n```\ncurl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg \u003e /dev/null\nsudo apt-get install apt-transport-https --yes\necho \"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main\" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list\nsudo apt-get update\nsudo apt-get install helm\n```\n\n# kind\n\nInstall Docker first. Then...\n\n```\n# For AMD64 / x86_64\n[ $(uname -m) = x86_64 ] \u0026\u0026 curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.26.0/kind-linux-amd64\n# For ARM64\n[ $(uname -m) = aarch64 ] \u0026\u0026 curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.26.0/kind-linux-arm64\nchmod +x ./kind\nsudo mv ./kind /usr/local/bin/kind\n```\n\nTo create a cluster:\n\n```\nkind create cluster --name kind\n```\n\nTo delete a cluster:\n\n```\nkind delete cluster --name kind\n```\n\nList clusters:\n\n```\nkind get clusters\n```\n\n# k9s\n\nAdd k9s:\n\n```\nwget https://github.com/derailed/k9s/releases/download/v0.32.7/k9s_linux_amd64.deb \nsudo apt install ./k9s_linux_amd64.deb \nrm k9s_linux_amd64.deb\n\nk9s help\nk9s -n default\n```\n\n# Kubernetes dashboard\n\nAdd dashboard:\n\n```\nhelm repo add kubernetes-dashboard https://kubernetes.github.io/dashboard/\nhelm upgrade --install kubernetes-dashboard kubernetes-dashboard/kubernetes-dashboard --create-namespace --namespace kubernetes-dashboard\n\nkubectl apply -f deployment/dev/dashboard\nkubectl -n kubernetes-dashboard create token admin-user\n\nkubectl -n kubernetes-dashboard port-forward svc/kubernetes-dashboard-kong-proxy 8444:443\n```\n\nVisit localhost:8444 on your web browser.\n\n```\nxdg-open localhost:8444\n```\n\n# Add storage classes\n\nAdd local storage class:\n\n```\nkubectl apply -f deployment/dev/storage/local-storage-class.yaml \nkubectl apply -f deployment/dev/storage/local-storage-pv.yaml \n\nkubectl get sc\nkubectl get pv\n```\n\n# Sealed Secrets\n\nInstall Sealed Secrets:\n\n```\nhelm repo add sealed-secrets https://bitnami-labs.github.io/sealed-secrets\nhelm install sealed-secrets -n kube-system --set-string fullnameOverride=sealed-secrets-controller sealed-secrets/sealed-secrets\n\nKUBESEAL_VERSION='0.23.0'\ncurl -OL \"https://github.com/bitnami-labs/sealed-secrets/releases/download/v${KUBESEAL_VERSION:?}/kubeseal-${KUBESEAL_VERSION:?}-linux-amd64.tar.gz\"\ntar -xvzf kubeseal-${KUBESEAL_VERSION:?}-linux-amd64.tar.gz kubeseal\nsudo install -m 755 kubeseal /usr/local/bin/kubeseal\n```\n\n\nUsage example:\n\n```\necho -n bar | kubectl create secret generic mysecret --dry-run=client --from-file=foo=/dev/stdin -o json \u003emysecret.json\n\nkubeseal -f mysecret.json -w mysealedsecret.json\nkubectl create -f mysealedsecret.json\nkubectl get secret mysecret\n```\n\n# ArgoCD\n\nGet CLI:\n\n```\nVERSION=$(curl -L -s https://raw.githubusercontent.com/argoproj/argo-cd/stable/VERSION)\ncurl -sSL -o argocd-linux-amd64 https://github.com/argoproj/argo-cd/releases/download/v$VERSION/argocd-linux-amd64\nsudo install -m 555 argocd-linux-amd64 /usr/local/bin/argocd\nrm argocd-linux-amd64\n```\n\nThen deploy:\n\n```\nkubectl create namespace argocd\n\nkubectl get ns\n\nkubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml\n\nkubectl patch svc argocd-server -n argocd -p '{\"spec\": {\"type\": \"LoadBalancer\"}}'\nkubectl get svc -n argocd\n\n# Port forwarding\nkubectl port-forward -n argocd service/argocd-server 8443:443\n```\nGet admin password\n\n```\nargocd admin initial-password -n argocd\n```\n\nDefault username for ArgoCD is admin.\n\nVisit localhost:8443 on your web browser.\n\n```\nxdg-open localhost:8443\n```\n\n## ArgoCD apps\n\nCreating Apps Via CLI:\n\n```\nargocd login localhost:8443\n\nkubectl config set-context --current --namespace=argocd\nargocd app create guestbook --repo https://github.com/argoproj/argocd-example-apps.git --path guestbook --dest-server https://kubernetes.default.svc --dest-namespace default\n\nargocd app get guestbook\nargocd app sync guestbook\n```\n\nDeclarative approach:\n\n```\nkubectl apply -f deployment/dev/argo/kustomize-app.yaml \nkubectl apply -f deployment/dev/argo/kustomize-guestbook.yaml \nkubectl apply -f deployment/dev/argo/app-name.yaml \n\nkubectl create ns test1\nkubectl apply -f deployment/dev/argo/applicationset-dns.yaml \n```\n\nDeclarative approach with Helm\n\n```\nkubectl apply -f deployment/dev/argo/sealed-secrets.yaml\nkubectl apply -f deployment/dev/argo/nginx-helm.yaml\n```\n\nDirectory app:\n\n```\nkubectl apply -f deployment/dev/argo/guestbook.yaml\n```\n\nMultisource:\n\n```\nkubectl apply -f deployment/dev/argo/helm-multisource-yaml\n```\n\nFull example:\n\n```\nkubectl apply -f deployment/dev/argo/full-manifest.yaml \n```\n\nMultisource with NGINX:\n\n```\nkubectl apply -f deployment/dev/argo/nginx-multisource.yaml\n\nkubectl port-forward --namespace=ingress-nginx  service/nginx-multisource-ingress-nginx-controller 8080:80\n\ncurl -s -I -X GET localhost:8080 | grep -P \"X-.*: true\"\n```\n\n# Argo Workflows\n\nInstall Argo Workflows:\n\n```\nARGO_WORKFLOWS_VERSION=\"v3.6.4\"\nkubectl create namespace argo\nkubectl apply -n argo -f \"https://github.com/argoproj/argo-workflows/releases/download/${ARGO_WORKFLOWS_VERSION}/quick-start-minimal.yaml\"\n\n# Add CLI\nARGO_OS=\"linux\"\n\ncurl -sLO \"https://github.com/argoproj/argo-workflows/releases/download/v3.6.4/argo-$ARGO_OS-amd64.gz\"\ngunzip \"argo-$ARGO_OS-amd64.gz\"\nchmod +x \"argo-$ARGO_OS-amd64\"\nsudo mv \"./argo-$ARGO_OS-amd64\" /usr/local/bin/argo\nargo version\n```\n\nSubmit an example workflow:\n\n```\nargo submit -n argo --watch https://raw.githubusercontent.com/argoproj/argo-workflows/main/examples/hello-world.yaml\n\nargo list -n argo\nargo get -n argo @latest\nargo logs -n argo @latest\n```\n\nView the GUI:\n\n```\nkubectl -n argo port-forward service/argo-server 2746:2746\n```\n\nNavigate your browser to https://localhost:2746. Click + Submit New Workflow and then Edit using full workflow options. You can find an example workflow already in the text field. Press + Create to start the workflow\n\n# Argo Events\n\nInstall Argo Events:\n\n```\nkubectl create namespace argo-events\nkubectl apply -f https://raw.githubusercontent.com/argoproj/argo-events/stable/manifests/install.yaml\n# Install with a validating admission controller\nkubectl apply -f https://raw.githubusercontent.com/argoproj/argo-events/stable/manifests/install-validating-webhook.yaml\n\nkubectl apply -n argo-events -f https://raw.githubusercontent.com/argoproj/argo-events/stable/examples/eventbus/native.yaml\n\nkubectl apply -n argo-events -f https://raw.githubusercontent.com/argoproj/argo-events/stable/examples/event-sources/webhook.yaml\n\n # sensor rbac\nkubectl apply -n argo-events -f https://raw.githubusercontent.com/argoproj/argo-events/master/examples/rbac/sensor-rbac.yaml\n # workflow rbac\nkubectl apply -n argo-events -f https://raw.githubusercontent.com/argoproj/argo-events/master/examples/rbac/workflow-rbac.yaml\n\nkubectl apply -n argo-events -f https://raw.githubusercontent.com/argoproj/argo-events/stable/examples/sensors/webhook.yaml\n```\n\nSetup a sensor:\n\n```\nkubectl -n argo-events port-forward $(kubectl -n argo-events get pod -l eventsource-name=webhook -o name) 12000:12000 \u0026\n\nsleep 5\n\ncurl -d '{\"message\":\"this is my first webhook\"}' -H \"Content-Type: application/json\" -X POST http://localhost:12000/example\nkubectl -n argo-events get workflows | grep \"webhook\"\n```\n\n# Argo Rollouts\n\nAdd Argo Rollouts\n\n```\nkubectl create namespace argo-rollouts\nkubectl apply -n argo-rollouts -f https://github.com/argoproj/argo-rollouts/releases/latest/download/install.yaml\n\nkubectl apply -k https://github.com/argoproj/argo-rollouts/manifests/crds\\?ref\\=stable\n\n# Plugin install\ncurl -LO https://github.com/argoproj/argo-rollouts/releases/latest/download/kubectl-argo-rollouts-linux-amd64\nchmod +x ./kubectl-argo-rollouts-linux-amd64\nsudo mv ./kubectl-argo-rollouts-linux-amd64 /usr/local/bin/kubectl-argo-rollouts\nkubectl argo rollouts version\n```\n\nRun the demo:\n\n```\nkubectl apply -f https://raw.githubusercontent.com/argoproj/argo-rollouts/master/docs/getting-started/basic/rollout.yaml\nkubectl apply -f https://raw.githubusercontent.com/argoproj/argo-rollouts/master/docs/getting-started/basic/service.yaml\n\nkubectl argo rollouts get rollout rollouts-demo --watch\n```\n\nUpdate rollout:\n\n```\nkubectl argo rollouts set image rollouts-demo \\\n  rollouts-demo=argoproj/rollouts-demo:yellow\n\nkubectl argo rollouts get rollout rollouts-demo --watch\n```\n\nPromote rollout:\n\n```\nkubectl argo rollouts promote rollouts-demo\nkubectl argo rollouts get rollout rollouts-demo --watch\n```\n\nAbort rollout\n\n```\nkubectl argo rollouts set image rollouts-demo \\\n  rollouts-demo=argoproj/rollouts-demo:red\n\nkubectl argo rollouts abort rollouts-demo\n```\n\nSet rollout as healthy:\n\n```\nkubectl argo rollouts set image rollouts-demo \\\n  rollouts-demo=argoproj/rollouts-demo:yellow\n```\n\nView the dashboard:\n\n```\nkubectl argo rollouts dashboard\n```\n\n# NGINX Ingress Operator\n\nInstall NGINX using helm\n\n```\nhelm upgrade --install ingress-nginx ingress-nginx \\\n  --repo https://kubernetes.github.io/ingress-nginx \\\n  --namespace ingress-nginx --create-namespace\n```\n\nIf you want a full list of values that you can set, while installing with Helm, then run:\n\n```\nhelm show values ingress-nginx --repo https://kubernetes.github.io/ingress-nginx\n```\n\nTo check which ports are used by your installation of ingress-nginx, look at the output of:\n\n```\nkubectl -n ingress-nginx get pod -o yaml\n```\n\nGet pods in ingress-inginx namespace:\n\n```\nkubectl get pods --namespace=ingress-nginx\n```\n\nLet's create a simple web server and the associated service:\n\n```\nkubectl create deployment demo --image=httpd --port=80\nkubectl expose deployment demo\n```\n\nThen create an ingress resource. The following example uses a host that maps to localhost:\n\n```\nkubectl create ingress demo-localhost --class=nginx \\\n  --rule=\"demo.localdev.me/*=demo:80\"\n```\n\nNow, forward a local port to the ingress controller:\n\n```\nkubectl port-forward --namespace=ingress-nginx service/ingress-nginx-controller 8080:80\n```\n\nAccess localhost:8080\n\n```\ncurl --resolve demo.localdev.me:8080:127.0.0.1 http://demo.localdev.me:8080\n```\n\n# Cert Manager\n\nAdd Cert Manager:\n\n```\nkubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.17.0/cert-manager.yaml\n```\n\nAdd LetsEncrypt staging:\n\n```\nkubectl apply -f deployment/dev/certs/staging-issuer.yaml \nkubectl get issuer\n```\n\nAdd kuard test service, deployment, and ingress:\n\n```\nkubectl delete deployment kuard\nkubectl delete service kuard\nkubectl delete ingress kuard\n\nkubectl apply -f deployment/dev/kuard/kuard-deployment.yaml \nkubectl apply -f deployment/dev/kuard/kuard-service.yaml\nkubectl apply -f deployment/dev/kuard/kuard-ingress.yaml\n\nkubectl port-forward -n default service/kuard 9500:80\n```\n\nPing the endpoint:\n\n```\ncurl --resolve kuard.localdev.me:9500:127.0.0.1 http://kuard.localdev.me:9500\n```\n\n# Jenkins\n\nTest that Jenkins can be deployed:\n\n```\nhelm upgrade --install jenkins -n jenkins -f deployment/dev/jenkins/jenkins-values.yaml jenkinsci/jenkins --create-namespace\n\nkubectl port-forward -n jenkins service/jenkins 8080 \n```\n\nThis can be deployed using ArgoCD too:\n\n```\nkubectl delete ns jenkins\n\nargocd admin initial-password -n argocd\nargocd login localhost:8443\nkubectl config set-context --current --namespace=argocd\n\nkubectl apply -f deployment/dev/jenkins/jenkins-multisource.yaml \n```\n\n# Argo Rollouts with NGINX\n\nRun the following commands to deploy:\n\n* A Rollout\n* Two Services (stable and canary)\n* An Ingress\n\n```\nkubectl apply -f https://raw.githubusercontent.com/argoproj/argo-rollouts/master/docs/getting-started/nginx/rollout.yaml\nkubectl apply -f https://raw.githubusercontent.com/argoproj/argo-rollouts/master/docs/getting-started/nginx/services.yaml\nkubectl apply -f https://raw.githubusercontent.com/argoproj/argo-rollouts/master/docs/getting-started/nginx/ingress.yaml\n\nkubectl get ro\nkubectl get svc\nkubectl get ing\nkubectl argo rollouts get rollout rollouts-demo\n```\n\nUpdate the rollout:\n\n```\nkubectl argo rollouts set image rollouts-demo rollouts-demo=argoproj/rollouts-demo:yellow\nkubectl argo rollouts get rollout rollouts-demo\n```\n\n# Test ML stack\n\n```\nkubectl delete deployment ml-dev\nkubectl delete service ml-dev\nkubectl delete ingress ml-dev\nkubectl delete pvc vol-ml-prefect\n\nkubectl apply -f deployment/dev/ml/ml-deployment.yaml \nkubectl apply -f deployment/dev/ml/ml-service.yaml\nkubectl apply -f deployment/dev/ml/ml-ingress.yaml\nkubectl apply -f deployment/dev/ml/vol-ml-prefect.yaml\n\nkubectl port-forward -n default service/ml-dev 8025:8025 9001:9001 9000:9000 8978:8978 4200:4200 5432:5432\n```\n\n# Volcano\n\nAdd Volcano:\n\n```\nkubectl apply -f https://raw.githubusercontent.com/volcano-sh/volcano/master/installer/volcano-development.yaml\n```\n\nAdd a Volcano job and view results:\n\n```\nkubectl create -f deployment/dev/volcano/queue.yaml\nkubectl create -f deployment/dev/volcano/vcjob.yaml\n\nkubectl get vcjob job-1 -oyaml\nkubectl get podgroup\nkubectl get queue test -oyaml\n```\n\n# KubeRay\n\nAdd KubeRay:\n\n```\nhelm repo update\nhelm install kuberay-operator kuberay/kuberay-operator --version 1.3.0 --set batchScheduler.enabled=true\n\n# Add RayCluster\nkubectl apply -f https://raw.githubusercontent.com/ray-project/kuberay/v1.3.0/ray-operator/config/samples/ray-cluster.volcano-scheduler.yaml\nkubectl get pod -l ray.io/cluster=test-cluster-0\n\nkubectl delete raycluster --all\n```\n\nWith gang scheduling:\n\n```\nkubectl create -f - \u003c\u003cEOF\napiVersion: scheduling.volcano.sh/v1beta1\nkind: Queue\nmetadata:\n  name: kuberay-test-queue\nspec:\n  weight: 1\n  capability:\n    cpu: 4\n    memory: 6Gi\nEOF\n\nkubectl apply -f https://raw.githubusercontent.com/ray-project/kuberay/v1.3.0/ray-operator/config/samples/ray-cluster.volcano-scheduler-queue.yaml\n\nkubectl get podgroup ray-test-cluster-0-pg -o yaml\nkubectl get queue kuberay-test-queue -o yaml\n\nkubectl delete raycluster test-cluster-0\nkubectl delete queue kuberay-test-queue\n```\n\nUse KubeRay with Modin:\n\n```\nkubectl apply -f https://raw.githubusercontent.com/ray-project/kuberay/master/ray-operator/config/samples/ray-job.modin.yaml\n\nkubectl logs -l=job-name=rayjob-sample\n```\n\n## Other examples\n\nSetup (optional - may already be done)\n\n```\n# NVIDIA\nkubectl apply -f https://raw.githubusercontent.com/GoogleCloudPlatform/container-engine-accelerators/master/nvidia-driver-installer/cos/daemonset-preloaded.yaml\n\n# Install both CRDs and KubeRay operator.\nhelm repo add kuberay https://ray-project.github.io/kuberay-helm/\nhelm repo update\nhelm install kuberay-operator kuberay/kuberay-operator --version 1.3.0\n\n# Create a Ray cluster\n# kubectl apply -f https://raw.githubusercontent.com/ray-project/ray/master/doc/source/cluster/kubernetes/configs/ray-cluster.gpu.yaml\nkubectl apply -f deployment/dev/kuberay/ray-cluster.gpu.yaml\n\nkubectl port-forward services/raycluster-head-svc 8265 10001  \n```\n\nRun the Python scripts:\n\n```\npoetry install --no-root\npoetry shell\n\npython deployment/dev/kuberay/square_submit.py\n```\n\nRun the ResNet script:\n\n```\npython deployment/dev/kuberay/pytorch_training_e2e_submit.py\n```\n\nRunning scripts from Ray Client:\n\n```\ndocker compose run --rm -it ray_client python -c \"import ray; print('hello world')\"\ndocker compose run --rm -it ray_client python /kuberay/square_client.py\n```\n\n# Tekton\n\nAdd Tekton\n\n```\nkubectl apply -f https://storage.googleapis.com/tekton-releases/operator/latest/release.yaml\nkubectl get pods --namespace tekton-pipelines  \n\n# Install CLI\nsudo apt update;sudo apt install -y gnupg\nsudo mkdir -p /etc/apt/keyrings/\nsudo gpg --no-default-keyring --keyring /etc/apt/keyrings/tektoncd.gpg --keyserver keyserver.ubuntu.com --recv-keys 3EFE0E0A2F2F60AA\necho \"deb [signed-by=/etc/apt/keyrings/tektoncd.gpg] http://ppa.launchpad.net/tektoncd/cli/ubuntu eoan main\"|sudo tee /etc/apt/sources.list.d/tektoncd-ubuntu-cli.list\nsudo apt update \u0026\u0026 sudo apt install -y tektoncd-cli\n```\n\nCreate task:\n\n```\nkubectl apply -f deployment/dev/tekton/hello-world.yaml\nkubectl apply -f deployment/dev/tekton/hello-world-run.yaml\n\nkubectl get taskrun hello-task-run --watch\nkubectl logs --selector=tekton.dev/taskRun=hello-task-run\n```\n\nCreate a second task, and then create a pipeline:\n\n```\nkubectl apply -f deployment/dev/tekton/goodbye-world.yaml\nkubectl apply -f deployment/dev/tekton/hello-goodbye-pipeline.yaml\nkubectl apply -f deployment/dev/tekton/hello-goodbye-pipeline-run.yaml\n\nkubectl logs --selector=tekton.dev/pipelineRun=hello-goodbye-run\n```\n\nAdd triggers:\n\n```\nkubectl apply -f deployment/dev/tekton/trigger-template.yaml\nkubectl apply -f deployment/dev/tekton/trigger-binding.yaml \nkubectl apply -f deployment/dev/tekton/event-listener.yaml \nkubectl apply -f deployment/dev/tekton/rbac.yaml\n\nkubectl port-forward service/el-hello-listener 8080\n```\n\nTrigger run:\n\n```\ncurl -v \\\n   -H 'content-Type: application/json' \\\n   -d '{\"username\": \"Tekton\"}' \\\n   http://localhost:8080\n\nkubectl get pipelineruns\n```\n\n# Redis\n\nAdd Redis\n\n```\nkubectl apply -f deployment/dev/redis/redis-deployment.yaml \nkubectl apply -f deployment/dev/redis/redis-service.yaml \nkubectl apply -f deployment/dev/redis/redis-ingress.yaml\n\nkubectl port-forward service/redis 6379\n```\n\n# Knative\n\nAdd Knative:\n\n```\n# Serving\nkubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.17.0/serving-crds.yaml\nkubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.17.0/serving-core.yaml\nkubectl apply -f https://github.com/knative/net-kourier/releases/download/knative-v1.17.0/kourier.yaml\nkubectl patch configmap/config-network \\\n  --namespace knative-serving \\\n  --type merge \\\n  --patch '{\"data\":{\"ingress-class\":\"kourier.ingress.networking.knative.dev\"}}'\nkubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.17.0/serving-hpa.yaml\n\n# Eventing\nkubectl apply -f https://github.com/knative/eventing/releases/download/knative-v1.17.2/eventing-crds.yaml\nkubectl apply -f https://github.com/knative/eventing/releases/download/knative-v1.17.2/eventing-core.yaml\n# Kafka\nkubectl apply -f https://github.com/knative-extensions/eventing-kafka-broker/releases/download/knative-v1.17.1/eventing-kafka-controller.yaml\nkubectl apply -f https://github.com/knative-extensions/eventing-kafka-broker/releases/download/knative-v1.17.1/eventing-kafka-controller.yaml\nkubectl apply -f https://github.com/knative-extensions/eventing-kafka-broker/releases/download/knative-v1.17.1/eventing-kafka-controller.yaml\n\n# Configure magic DNS\nkubectl --namespace kourier-system get service kourier\nkubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.17.0/serving-default-domain.yaml\n\nkubectl get pods -n knative-serving\nkubectl get pods -n knative-eventing\n```\n\nAdd CLI tools:\n\n```\n# kn\nwget https://github.com/knative/client/releases/download/knative-v1.17.0/kn-linux-amd64\nsudo mv kn-linux-amd64 /usr/local/bin/kn\nsudo chmod +x /usr/local/bin/kn\n\nkn\n\n# func\nwget https://github.com/knative/func/releases/download/knative-v1.17.0/func_linux_amd64\nsudo mv func_linux_amd64 /usr/local/bin/func\nsudo chmod +x /usr/local/bin/func\n\nfunc version\n```\n\n## Quickstart\n\nCreate a hello() function:\n\n```\nfunc create -l go hello\n\nexport FUNC_REGISTRY=ghcr.io/... # You will need to change this\n\ncd hello\nfunc run --build\nfunc invoke\n```\n\nDeploy a Knative service:\n\n```\nkubectl create ns knative-operator\nkubectl apply -f deployment/dev/knative/hello.yaml\n\nkn service list\n\necho \"Accessing URL $(kn service describe hello -o url)\"\ncurl \"$(kn service describe hello -o url)\"\n\nkubectl get pod -l serving.knative.dev/service=hello -w\n```\n\nRevise the service:\n\n```\nkn service update hello \\\n--env TARGET=Knative\n\nkn revisions list\n\n# Split traffic\nkn service update hello \\\n--traffic hello-00001=50 \\\n--traffic @latest=50\nkn revisions list\n```\n\nCreate an event source:\n\n```\nkn service create cloudevents-player \\\n--image quay.io/ruben/cloudevents-player:latest\n\nkn source binding create ce-player-binding --subject \"Service:serving.knative.dev/v1:cloudevents-player\" --sink broker:example-broker\n```\n\nCreate trigger:\n\n```\nkn trigger create cloudevents-trigger --sink cloudevents-player  --broker example-broker\n```\n\n## End to end\n\n[View: https://knative.dev/docs/bookstore/page-0/welcome-knative-bookstore-tutorial/](https://knative.dev/docs/bookstore/page-0/welcome-knative-bookstore-tutorial/)\n\nClone repo and spin up front end:\n\n```\ngit clone https://github.com/knative/docs.git\n\ncd docs/code-samples/eventing/bookstore-sample-app/start\nkubectl apply -f frontend/config/100-front-end-deployment.yaml\nkubectl get pods\n\nkubectl port-forward svc/bookstore-frontend-svc 3000\n```\n\nNow the backend:\n\n```\ncd docs/code-samples/eventing/bookstore-sample-app/start\nkubectl apply -f node-server/config/100-deployment.yaml\nkubectl get pods\n\nkubectl port-forward svc/node-server-svc 8080:80\n```\n\n## Send Review Comment to Broker\n\n```\nkubectl apply -f deployment/dev/knative/200-broker.yaml \n\nkubectl get brokers\nkubectl describe broker bookstore-broker\n\nkubectl apply -f deployment/dev/knative/300-sinkbinding.yaml\nkubectl get sinkbindings\n\nkubectl apply -f deployment/dev/knative/100-event-display.yaml\nkubectl get pods\n\nkubectl apply -f deployment/dev/knative/200-log-trigger.yaml \nkubectl get triggers\n\nkubectl logs -l=app=event-display -f\n```\n\nCreate sentiment analysis function:\n\n```\n# func create -l python sentiment-analysis-app # See tutorial code\ncd sentiment-analysis-app\nfunc build -b=s2i -v\nfunc run -b=s2i -v\n\n# Simulate cloud event\ncd sentiment-analysis-app\nfunc invoke -f=cloudevent --data='{\"reviewText\": \"I love Knative so much\"}' --content-type=application/json --type=\"new-review-comment\" -v\n\nfunc deploy -b=s2i -v\n\nkubectl get kservice\nfunc invoke -f=cloudevent --data='{\"reviewText\":\"I love Knative so much\"}' -v\n```\n\nCreate a sequence:\n\n```\nkubectl apply -f deployment/dev/knative/100-create-sequence.yaml \nkubectl get sequences\n\nkubectl apply -f deployment/dev/knative/200-create-trigger.yaml \nkubectl get triggers\n```\n\nCreate a database:\n\n```\ncd docs/code-samples/eventing/bookstore-sample-app/start\nkubectl apply -f db-service\nkubectl get pods\n```\n\n# Kubeflow\n\n## Standalone Installation\n\nAdd Kubeflow\n\n```\n# Pipelines\nexport PIPELINE_VERSION=2.3.0\nkubectl apply -k \"github.com/kubeflow/pipelines/manifests/kustomize/cluster-scoped-resources?ref=$PIPELINE_VERSION\"\nkubectl wait --for condition=established --timeout=60s crd/applications.app.k8s.io\nkubectl apply -k \"github.com/kubeflow/pipelines/manifests/kustomize/env/dev?ref=$PIPELINE_VERSION\"\n\nkubectl port-forward -n kubeflow svc/ml-pipeline-ui 8080:80\n\n# Trainer\nkubectl apply --server-side -k \"https://github.com/kubeflow/trainer.git/manifests/overlays/manager?ref=master\"\nkubectl get pods -n kubeflow-system\nkubectl apply --server-side -k \"https://github.com/kubeflow/trainer.git/manifests/overlays/runtimes?ref=master\"\n\n# Katib\nkubectl apply -k \"github.com/kubeflow/katib.git/manifests/v1beta1/installs/katib-standalone?ref=v0.17.0\"\nkubectl apply -k \"github.com/kubeflow/katib.git/manifests/v1beta1/installs/katib-standalone?ref=master\"\n\n# Model registry\nMODEL_REGISTRY_VERSION=0.2.12\nkubectl apply -k \"https://github.com/kubeflow/model-registry/manifests/kustomize/options/csi?ref=v${MODEL_REGISTRY_VERSION}\"\n# Istio \n# kubectl apply -k \"https://github.com/kubeflow/model-registry/manifests/kustomize/options/istio?ref=v${MODEL_REGISTRY_VERSION}\"\nkubectl wait --for=condition=available -n kubeflow deployment/model-registry-deployment --timeout=1m\nkubectl port-forward svc/model-registry-service -n kubeflow 8081:8080\n# in another terminal:\ncurl -X 'GET' \\\n  'http://localhost:8081/api/model_registry/v1alpha3/registered_models?pageSize=100\u0026orderBy=ID\u0026sortOrder=DESC' \\\n  -H 'accept: application/json' | jq\n```\n\n## KServe Installation\n\nAdd KServe\n\n```\n# Knative (if not installed already)\nkubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.17.0/serving-crds.yaml\nkubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.17.0/serving-core.yaml\n\n# Istio\nkubectl apply -l knative.dev/crd-install=true -f https://github.com/knative/net-istio/releases/download/knative-v1.17.0/istio.yaml\nkubectl apply -f https://github.com/knative/net-istio/releases/download/knative-v1.17.0/istio.yaml\nkubectl apply -f https://github.com/knative/net-istio/releases/download/knative-v1.17.0/net-istio.yaml\nkubectl label namespace knative-serving istio-injection=enabled\nkubectl apply -f deployment/dev/knative/auth.yaml \nkubectl --namespace istio-system get service istio-ingressgateway\n\nkubectl get pods -n knative-serving\n\n# No DNS config (for dev environment)\nkubectl patch configmap/config-domain \\\n      --namespace knative-serving \\\n      --type merge \\\n      --patch '{\"data\":{\"example.com\":\"\"}}'\n\n# Cert Manager (if not installed already)\nkubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.17.0/cert-manager.yaml\nkubectl apply -f deployment/dev/certs/staging-issuer.yaml \nkubectl apply --server-side -f https://github.com/kserve/kserve/releases/download/v0.14.1/kserve.yaml\nkubectl apply --server-side -f https://github.com/kserve/kserve/releases/download/v0.14.1/kserve-cluster-resources.yaml\n```\n\n### Secure InferenceService with ServiceMesh\n\n```\nkubectl create namespace user1\nkubectl apply -f deployment/dev/kubeflow/peer-auth.yaml \n\nkubectl edit configmap/inferenceservice-config --namespace kserve\n\n# ingress : |- {\n#    \"disableIstioVirtualHost\": true # Add this flag to ingress section\n# }\n\nkubectl apply -f deployment/dev/kubeflow/gateway-patch.yaml\n# Sidecar injection\nkubectl label namespace user1 istio-injection=enabled --overwrite\n\n# Add inference service\nkubectl apply -f deployment/dev/kubeflow/sklearn-inference.yaml\n\n# Make inference\nkubectl apply -f deployment/dev/kubeflow/httpbin.yaml\n\nkubectl get pod -n user1\nkubectl exec -it httpbin-b56d8fdf-ss489 -c istio-proxy -n user1 -- curl -v sklearn-iris-predictor-default.user1.svc.cluster.local/v1/models/sklearn-iris # The podname will be different from httpbin-6484879498-qxqj8\nkubectl exec -it httpbin-6484879498-qxqj8 -c istio-proxy -n user1 -- curl -v sklearn-iris-burst-predictor-default.user1.svc.cluster.local/v1/models/sklearn-iris-burst # The podname will be different from httpbin-6484879498-qxqj8\n```\n\n### KServe test run\n\nPerform test run:\n\n```\nkubectl create namespace kserve-test\nkubectl apply -f deployment/dev/kubeflow/sklearn-inference-test.yaml \n\nkubectl get inferenceservices sklearn-iris -n kserve-test\nkubectl get svc istio-ingressgateway -n istio-system\n\n# Port forwarding for testing\nexport INGRESS_HOST=worker-node-address # Change me based off external IP from above command\nINGRESS_GATEWAY_SERVICE=$(kubectl get svc --namespace istio-system --selector=\"app=istio-ingressgateway\" --output jsonpath='{.items[0].metadata.name}')\nkubectl port-forward --namespace istio-system svc/${INGRESS_GATEWAY_SERVICE} 8080:80\n```\n\n# KEDA\n\nAdd KEDA:\n\n```\nhelm repo add kedacore https://kedacore.github.io/charts\nhelm repo update\nhelm install keda kedacore/keda --namespace keda --create-namespace\nhelm install http-add-on kedacore/keda-add-ons-http --namespace keda\n\nkubectl get pod -n keda\n```\n\nDeploy NGINX:\n\n```\nkubectl apply -f deployment/dev/keda/nginx-deployment.yaml\nkubectl apply -f deployment/dev/keda/nginx-service.yaml \n\nkubectl port-forward -n default service/nginx 8080:80\n```\n\n## Scaled object\n\nApply scaled object:\n\n```\nkubectl apply -f deployment/dev/keda/scaled-object.yaml\n\n# After event has been triggered\nkubectl get pod\nkubectl get deployment\n\n# After complete\nkubectl delete scaledobject nginx-deployment\n```\n\nApply scaled HTTP object:\n\n```\nkubectl apply -f deployment/dev/keda/scaled-object-http.yaml\nkubectl get svc -n keda\n\nkubectl port-forward svc/keda-add-ons-http-interceptor-proxy -n keda 32511:8080\ncurl localhost:32511 -H 'Host: myhost.com'\n```\n\n## Scaled job\n\nApply scaled job:\n\n```\nkubectl apply -f deployment/dev/keda/scaled-job.yaml\n\nkubectl get job\nkubectl get pod\n\n# After done\nkubectl delete scaledjob pi-job \n```\n\nGet metrics:\n\n```\nkubectl get --raw \"/apis/external.metrics.k8s.io/v1beta1\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbris%2Fkubernetes-kind-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjbris%2Fkubernetes-kind-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbris%2Fkubernetes-kind-examples/lists"}