java系统找不到指定文件怎么解决
292
2022-09-11
k8s-监控组件:heaper部署
ansible搭建k8s参考:/etc/ansible/manifests/dns/kube-dns/heapstercd /etc/ansible/manifests/dns/kube-dns/heapster
2.导入镜像及上传到本地harbor仓库
docker load -i heapster-amd64_v1.5.1.tar && \docker load -i heapster-grafana-amd64-v4.4.3.tar && \docker load -i heapster-influxdb-amd64_v1.3.3.tardocker tag 4129aa919411 harbor.gesila.com/k8s/heapster-amd64:v1.5.1 && \docker tag 8cb3de219af7 harbor.gesila.com/k8s/heapster-grafana-amd64:v4.4.3 && \docker tag 1315f002663c harbor.gesila.com/k8s/heapster-influxdb-amd64:v1.3.3docker push harbor.gesila.com/k8s/heapster-amd64:v1.5.1 && \docker push harbor.gesila.com/k8s/heapster-grafana-amd64:v4.4.3 && \docker push harbor.gesila.com/k8s/heapster-influxdb-amd64:v1.3.3
3.修改配置文件镜像源
vim grafana.yaml-name: grafana images: harbor.gesila.com/k8s/heapster-grafana-amd64:v4.4.3vim heapster.yaml-name: heapster images: harbor.gesila.com/k8s/heapster-amd64:v1.5.1vim influxdb.yaml-name: influxdb images: harbor.gesila.com/k8s/heapster-influxdb-amd64:v1.3.3
4.构建
root@k8s-master:/etc/ansible/manifests/dns/kube-dns/heapster# kubectl apply -f .deployment.extensions/monitoring-grafana createdservice/monitoring-grafana createdserviceaccount/heapster createdclusterrolebinding.rbac.authorization.k8s.io/heapster createddeployment.extensions/heapster createdservice/heapster createddeployment.extensions/monitoring-influxdb createdservice/monitoring-influxdb created
5.查看
root@k8s-master:/etc/ansible/manifests/dns/kube-dns/heapster# kubectl get pods -n kube-system NAME READY STATUS RESTARTS AGEcalico-kube-controllers-64dfd5bf4c-q94ls 1/1 Running 0 3h18mcalico-node-9ccdk 2/2 Running 2 23hcalico-node-k297m 2/2 Running 4 23hcalico-node-w6m6p 2/2 Running 10 23hheapster-7689489d99-dlz5s 1/1 Running 0 20skube-dns-5744cc9dff-rxgjk 3/3 Running 0 45mkubernetes-dashboard-7b5f5b777c-s7djw 1/1 Running 0 3h18mmonitoring-grafana-6949dd99d6-4dcdq 1/1 Running 0 21smonitoring-influxdb-7cb4988b9c-ktqgz 1/1 Running 0 21s
root@k8s-master:/etc/ansible/manifests/dns/kube-dns/heapster# kubectl cluster-infoKubernetes master is running at is running at is running at is running at is running at further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
6.文件
6.1.grafana.yaml
---apiVersion: extensions/v1beta1kind: Deploymentmetadata: name: monitoring-grafana namespace: kube-systemspec: replicas: 1 template: metadata: labels: task: monitoring k8s-app: grafana spec: containers: - name: grafana image: harbor.gesila.com/k8s/heapster-grafana-amd64:v4.4.3 imagePullPolicy: Always ports: - containerPort: 3000 protocol: TCP volumeMounts: - mountPath: /var name: grafana-storage env: - name: INFLUXDB_HOST value: monitoring-influxdb - name: GF_SERVER_HTTP_PORT value: "3000" # The following env variables are required to make Grafana accessible via # the kubernetes api-server proxy. On production clusters, we recommend # removing these env variables, setup auth for grafana, and expose the grafana # service using a LoadBalancer or a public IP. - name: GF_AUTH_BASIC_ENABLED value: "false" - name: GF_AUTH_ANONYMOUS_ENABLED value: "true" - name: GF_AUTH_ANONYMOUS_ORG_ROLE value: Admin - name: GF_SERVER_ROOT_URL # If you're only using the API Server proxy, set this value instead: value: /api/v1/namespaces/kube-system/services/monitoring-grafana/proxy/ #value: / volumes: - name: grafana-storage emptyDir: {}---apiVersion: v1kind: Servicemetadata: labels: # For use as a Cluster add-on ( # If you are NOT using this as an addon, you should comment out this line. kubernetes.io/cluster-service: 'true' kubernetes.io/name: monitoring-grafana name: monitoring-grafana namespace: kube-systemspec: # In a production setup, we recommend accessing Grafana through an external Loadbalancer # or through a public IP. # type: LoadBalancer # You could also use NodePort to expose the service at a randomly-generated port # type: NodePort ports: - port: 80 targetPort: 3000 selector: k8s-app: grafana
6.2.heapster.yaml
---apiVersion: v1kind: ServiceAccountmetadata: name: heapster namespace: kube-system---apiVersion: rbac.authorization.k8s.io/v1kind: ClusterRoleBindingmetadata: name: heapstersubjects: - kind: ServiceAccount name: heapster namespace: kube-systemroleRef: kind: ClusterRole name: system:heapster apiGroup: rbac.authorization.k8s.io---apiVersion: extensions/v1beta1kind: Deploymentmetadata: name: heapster namespace: kube-systemspec: replicas: 1 template: metadata: labels: task: monitoring k8s-app: heapster spec: serviceAccountName: heapster containers: - name: heapster image: harbor.gesila.com/k8s/heapster-amd64:v1.5.1 imagePullPolicy: Always command: - /heapster - --source=kubernetes: - --sink=influxdb:v1kind: Servicemetadata: labels: task: monitoring # For use as a Cluster add-on ( # If you are NOT using this as an addon, you should comment out this line. #kubernetes.io/cluster-service: 'true' kubernetes.io/name: Heapster name: heapster namespace: kube-systemspec: ports: - port: 80 targetPort: 8082 selector: k8s-app: heapster
6.3.influxdb.yaml
apiVersion: extensions/v1beta1kind: Deploymentmetadata: name: monitoring-influxdb namespace: kube-systemspec: replicas: 1 template: metadata: labels: task: monitoring k8s-app: influxdb spec: containers: - name: influxdb image: harbor.gesila.com/k8s/heapster-influxdb-amd64:v1.3.3 volumeMounts: - mountPath: /data name: influxdb-storage volumes: - name: influxdb-storage emptyDir: {}---apiVersion: v1kind: Servicemetadata: labels: task: monitoring # For use as a Cluster add-on ( # If you are NOT using this as an addon, you should comment out this line. kubernetes.io/cluster-service: 'true' kubernetes.io/name: monitoring-influxdb name: monitoring-influxdb namespace: kube-systemspec: ports: - port: 8086 targetPort: 8086 selector: k8s-app: influxdb
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~