跳转到内容
主菜单
主菜单
移至侧栏
隐藏
规范/协议
协议
算法
JVM
多线程/并发
存储
AI
深度学习
工具箱
最近更改
文章分类
全部文章
WHY42
搜索
搜索
外观
登录
个人工具
登录
欢迎来到Riguz的小站!这是一个私人wiki,用来记录一些我的笔记。
查看“︁Knative installation”︁的源代码
页面
讨论
大陆简体
阅读
查看源代码
查看历史
工具
工具
移至侧栏
隐藏
操作
阅读
查看源代码
查看历史
常规
链入页面
相关更改
页面信息
外观
移至侧栏
隐藏
←
Knative installation
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
= Minikube = == Container Runtime== <syntaxhighlight lang="java"> # podman does not work!!!, use docker instead # sudo apt-get -y install podman source /etc/os-release echo $UBUNTU_CODENAME sudo apt-get update sudo apt-get install ca-certificates curl gnupg sudo install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg sudo chmod a+r /etc/apt/keyrings/docker.gpg # Add the repository to Apt sources: echo \ "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ "$(. /etc/os-release && echo "$UBUNTU_CODENAME")" stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin sudo usermod -aG docker $USER sudo systemctl enable docker.service sudo systemctl enable containerd.service # use this if docker group is not present: # newgrp docker # groups </syntaxhighlight> See: * https://docs.docker.com/engine/install/ubuntu/ * https://github.com/kubernetes/minikube/issues/17389 == Install Minikube == Mac: <syntaxhighlight lang="bash"> curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-arm64 sudo install minikube-darwin-arm64 /usr/local/bin/minikube </syntaxhighlight> Ubuntu: <syntaxhighlight lang="bash"> curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 sudo install minikube-linux-amd64 /usr/local/bin/minikube minikube config set rootless true </syntaxhighlight> == Start Minikube == If use docker: <syntaxhighlight lang="bash"> # Ubuntu: # sudo usermod -aG docker $USER && newgrp docker minikube start --cpus=4 --memory=4096 --addons=ingress --kubernetes-version=1.29.2 </syntaxhighlight> For podman(does not work): <syntaxhighlight lang="bash"> sudo chmod +w /etc/sudoers # add this line to the END of the file riguz ALL=(ALL) NOPASSWD: ALL sudo chmod -w /etc/sudoers # To test: # sudo -n -k podman version minikube start --cpus=4 --memory=4096 --addons=ingress --container-runtime=containerd </syntaxhighlight> Install Kubectl(Ubuntu): <syntaxhighlight lang="bash"> curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl </syntaxhighlight> = Knative = <syntaxhighlight lang="bash"> kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.13.1/serving-crds.yaml kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.13.1/serving-core.yaml kubectl apply -f https://github.com/knative/eventing/releases/download/knative-v1.13.2/eventing-crds.yaml kubectl apply -f https://github.com/knative/eventing/releases/download/knative-v1.13.2/eventing-core.yaml kubectl apply -f https://github.com/knative/eventing/releases/download/knative-v1.13.2/in-memory-channel.yaml kubectl apply -f https://github.com/knative/eventing/releases/download/knative-v1.13.2/mt-channel-broker.yaml kubectl apply -f https://github.com/knative-extensions/eventing-kafka-broker/releases/download/knative-v1.13.4/eventing-kafka-controller.yaml kubectl apply -f https://github.com/knative-extensions/eventing-kafka-broker/releases/download/knative-v1.13.4/eventing-kafka-broker.yaml kubectl apply -f https://github.com/knative/net-kourier/releases/download/knative-v1.13.0/kourier.yaml kubectl patch configmap/config-network \ --namespace knative-serving \ --type merge \ --patch '{"data":{"ingress-class":"kourier.ingress.networking.knative.dev"}}' kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.13.1/serving-default-domain.yaml kubectl --namespace kourier-system get service kourier NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE kourier LoadBalancer 10.45.2.31 35.192.171.57 80:32515/TCP,443:31010/TCP 4m31s </syntaxhighlight> = CLI = <syntaxhighlight lang="java"> wget https://github.com/knative/client/releases/download/knative-v1.11.0/kn-darwin-arm64 sudo install kn-darwin-arm64 /usr/local/bin/kn wget https://github.com/knative/func/releases/download/knative-v1.11.0/func_darwin_arm64 sudo install func_darwin_arm64 /usr/local/bin/func </syntaxhighlight> = Post settings = <syntaxhighlight lang="java"> minikube tunnel minikube addons enable registry kubectl port-forward --namespace kube-system service/registry 5000:80 docker run --rm -it --network=host alpine ash -c "apk add socat && socat TCP-LISTEN:5000,reuseaddr,fork TCP:$(minikube ip):5000" kubectl -n knative-serving edit configmap config-deployment # add data: registries-skipping-tag-resolving: "localhost:5000" </syntaxhighlight> = Test create func = <syntaxhighlight lang="bash"> func create -l node helloworld cd helloworld func build > localhost:5000/helloworld $ func build A registry for function images is required. For example, 'docker.io/tigerteam'. ? Registry for function images: localhost:5000/helloworld Note: building a function the first time will take longer than subsequent builds 🙌 Function built: localhost:5000/helloworld/helloworld:latest $ func deploy function up-to-date. Force rebuild with --build ✅ Function deployed in namespace "default" and exposed at URL: http://helloworld.default.127.0.0.1.sslip.io </syntaxhighlight> == Access from host network== <syntaxhighlight lang="bash"> kubectl port-forward --namespace kourier-system service/kourier 8080:80 --address 0.0.0.0 sudo ufw enable 8080 </syntaxhighlight> Then, access the service: <syntaxhighlight lang="bash"> curl -H "Host: helloworld.default.10.111.190.244.sslip.io" http://10.226.21.75:8080 </syntaxhighlight> = Tekton (Not Required) = <syntaxhighlight lang="java"> kubectl apply -f https://storage.googleapis.com/tekton-releases/pipeline/previous/v0.47.3/release.yaml kubectl apply -f https://storage.googleapis.com/tekton-releases/triggers/previous/v0.24.1/release.yaml kubectl apply -f https://storage.googleapis.com/tekton-releases/triggers/previous/v0.24.1/interceptors.yaml kubectl apply -f https://storage.googleapis.com/tekton-releases/dashboard/previous/v0.37.0/release.yaml </syntaxhighlight> <syntaxhighlight lang="java"> *.func.riguz.com 35.192.171.57 kubectl patch configmap/config-domain \ --namespace knative-serving \ --type merge \ --patch '{"data":{"func.riguz.com":""}}' </syntaxhighlight> [[Category:Linux/Unix]] [[Category:Kubernetes]] [[Category:Knative]]
返回
Knative installation
。
搜索
搜索
查看“︁Knative installation”︁的源代码
添加话题