利用Kube Eagle监控Kubernetes集群资源

安装helm helm是Kubernetes集群的npm。 下载脚本add_helm.sh 脚本内容如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 #!/usr/bin/env bash echo "install helm" # installs helm with bash commands for easier command line integration curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash # add a service account within a namespace to segregate tiller kubectl --namespace kube-system create sa tiller # create a cluster role binding for tiller kubectl create clusterrolebinding tiller \ --clusterrole cluster-admin \ --serviceaccount=kube-system:tiller echo "initialize helm" # initialized helm within the tiller service account helm init --service-account tiller # updates the repos for Helm repo integration helm repo update echo "verify helm" # verify that helm is installed in the cluster kubectl get deploy,svc tiller-deploy -n kube-system 执行脚本安装helm 1 sh add_helm.sh 安装kube-eagle 主要体验一下helm使用(刚开始我都是自己手动安装Prometheus)。 ...

March 9, 2019

安装与应用Prometheus监控Kubernetes集群

安装Prometheus RBAC设置,获取创建集群角色权限 1 2 3 4 ACCOUNT=$(gcloud info --format='value(config.account)') kubectl create clusterrolebinding owner-cluster-admin-binding \ --clusterrole cluster-admin \ --user $ACCOUNT 注意:如果集群部署在google cloud上需要先执行这一步。 创建Namespace 1 kubectl create namespace monitoring 创建角色 脚本内容如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRole metadata: name: prometheus rules: - apiGroups: [""] resources: - nodes - nodes/proxy - services - endpoints - pods verbs: ["get", "list", "watch"] - apiGroups: - extensions resources: - ingresses verbs: ["get", "list", "watch"] - nonResourceURLs: ["/metrics"] verbs: ["get"] --- apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRoleBinding metadata: name: prometheus roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: prometheus subjects: - kind: ServiceAccount name: default namespace: monitoring 执行创建角色脚本: ...

October 17, 2018

基于Gitlab+Kubernetes实现CI/CD

要求 基本技术栈要求如下: Golang Docker GitLab Kubernetes 具体原因参考关于技术选型的思考 步骤 创建Kubernetes集群 自己搭建集群也可以,但是投入生产不建议使用。这里直接使用google cloud(调研几家发现G家这方面技术积累最深,生态完整)。 ...

October 16, 2018