小玩一下,之前有弄过Linux集群部署版,太麻烦了,没Mac用起来舒服
安装K8S
准备
1 2 3 4 5 6 7 8 9 10
| Docker Desktop Preference->Kubernetes->Enable Kubernetes
版本说明 docker desktop: 4.9.0 docker engine: 20.10.16 docker compose: 1.29.2 kubernetes: 1.24.0
基本这样操作之后,K8S就已经起来了
|
扩展安装
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| https://github.com/AliyunContainerService/k8s-for-docker-desktop 下载 kube-system-default.yaml kubernetes-dashboard.yaml ingress-nginx-controller.yaml
kubectl config use-context docker-desktop kubectl cluster-info kubectl get nodes
kubectl apply -f *.yaml
kubectl proxy =-=这一步是真简单,之前弄这几步搞死人
TOKEN=$(kubectl -n kube-system describe secret default| awk '$1=="token:"{print $2}') kubectl config set-credentials docker-desktop --token="${TOKEN}" echo $TOKEN 复制输出的TOKEN http://127.0.0.1:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/
|
Flink Kubernetes Operator安装
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| kubectl create -f https://github.com/jetstack/cert-manager/releases/download/v1.7.1/cert-manager.yaml
helm repo add flink-operator-repo https://downloads.apache.org/flink/flink-kubernetes-operator-0.1.0/
helm install flink-kubernetes-operator flink-operator-repo/flink-kubernetes-operator --set webhook.create=false --set image.repository=apache/flink-kubernetes-operator
webhook.create和image.repository还是得配的,不然按官网步骤下来铁报错
kubectl create -f https://raw.githubusercontent.com/apache/flink-kubernetes-operator/release-0.1/examples/basic.yaml 这个是直接执行的flink包下example的StateMachineExample示例代码
kubectl logs -f deploy/basic-example
公开Flink DashBoard kubectl port-forward svc/basic-example-rest 8081
http://localhost:8081
删除 kubectl delete flinkdeployment/basic-example
|