k8s 入门浅谈
k8s入门浅谈
k8s 入门浅谈
在信息化已经成熟的今天,软件的部署 运维 开发不在拘泥以部署在物理机上,物理机已经不能满足现在开发的扩容,运维,迁移等一系列问题,云计算的最佳落地方案 :k8s dockers落地。
一线大厂已经把所有基础服务都上了云,可想 将来不懂云原生不懂k8s多少落后
flink 部署基础命令
./bin/kubernetes-session.sh
-Dkubernetes.namespace=flink-cluster
-Dkubernetes.jobmanager.service-account=flink
-Dkubernetes.cluster-id=flink-session
-Dtaskmanager.memory.process.size=8192m
-Dkubernetes.rest-service.exposed.type=NodePort
-Dkubernetes.taskmanager.cpu=2
-Dtaskmanager.numberOfTaskSlots=4
-Dresourcemanager.taskmanager-timeout=3600000
bin/flink run -d -e kubernetes-session
-Dkubernetes.jobmanager.service-account=flink
-Dkubernetes.rest-service.exposed.type=NodePort
-Dkubernetes.cluster-id=flink-session
-Dkubernetes.namespace=flink-cluster
jobjar/flink-mysql-bi.jar
------------application-------------------
docker build -t flink-mysql-bi-test /data/k8s/flink-1.13.1
docker tag flink-mysql-bi-test dulangmaster/flink-mysql-bi-test
docker push dulangmaster/flink-mysql-bi-test
kubectl get pod,svc,deployment -n flink-cluster -o wide
bin/flink run-application
–target kubernetes-application
-Dkubernetes.namespace=flink-cluster
-Dkubernetes.cluster-id=flink-bi-application
-Dkubernetes.jobmanager.service-account=flink
-Dkubernetes.rest-service.exposed.type=NodePort
-Dkubernetes.container.image=dulangmaster/flink-mysql-bi-test
local:///opt/flink/usrlib/flink-mysql-bi.jar
--------hosts域名-------------------
CoreDNS
该命名空间下
hosts {
172.30.200.21 kubenode1
172.30.200.22 kubenode2
172.30.200.23 kubenode3
fallthrough
}
删除在运行CoreDNS 相关pod(Deployments 会重新创建)
修改位置
如果在其它命名空间需要域名映射则需要把coredns重新创建
dashboard账号密码修改
总体我还是喜欢这个工具 提示日志比较全
1备份
cp /etc/kubernetes/manifests/kube-apiserver.yaml
2
echo “admin,admin,1” > /etc/kubernetes/pki/basic_auth_file
3
vim /etc/kubernetes/manifests/kube-apiserver.yaml
- –token-auth-file=/etc/kubernetes/pki/basic_auth_file
4 为admin用户绑定权限
kubectl create clusterrolebinding login-on-dashboard-with-cluster-admin --clusterrole=cluster-admin --user=admin
5
kubectl edit deploy kubernetes-dashboard -n kubernetes-dashboard
加入这行
6 加入权限
kubectl create clusterrolebinding test:anonymous --clusterrole=cluster-admin --user=system:anonymous
参考 https://blog.csdn.net/seven_xu_/article/details/117929834
pvc pengding
/etc/kubernetes/manifests/kube-apiserver.yaml
- –feature-gates=RemoveSelfLink=false
更多推荐
所有评论(0)