kubesphere-installer.yaml

官网地址:kubectl apply -f https://github.com/kubesphere/ks-installer/releases/download/v3.0.0/kubesphere-installer.yaml

  1. ---
  2. apiVersion: apiextensions.k8s.io/v1beta1
  3. kind: CustomResourceDefinition
  4. metadata:
  5. name: clusterconfigurations.installer.kubesphere.io
  6. spec:
  7. group: installer.kubesphere.io
  8. versions:
  9. - name: v1alpha1
  10. served: true
  11. storage: true
  12. scope: Namespaced
  13. names:
  14. plural: clusterconfigurations
  15. singular: clusterconfiguration
  16. kind: ClusterConfiguration
  17. shortNames:
  18. - cc
  19. ---
  20. apiVersion: v1
  21. kind: Namespace
  22. metadata:
  23. name: kubesphere-system
  24. ---
  25. apiVersion: v1
  26. kind: ServiceAccount
  27. metadata:
  28. name: ks-installer
  29. namespace: kubesphere-system
  30. ---
  31. apiVersion: rbac.authorization.k8s.io/v1
  32. kind: ClusterRole
  33. metadata:
  34. name: ks-installer
  35. rules:
  36. - apiGroups:
  37. - ""
  38. resources:
  39. - '*'
  40. verbs:
  41. - '*'
  42. - apiGroups:
  43. - apps
  44. resources:
  45. - '*'
  46. verbs:
  47. - '*'
  48. - apiGroups:
  49. - extensions
  50. resources:
  51. - '*'
  52. verbs:
  53. - '*'
  54. - apiGroups:
  55. - batch
  56. resources:
  57. - '*'
  58. verbs:
  59. - '*'
  60. - apiGroups:
  61. - rbac.authorization.k8s.io
  62. resources:
  63. - '*'
  64. verbs:
  65. - '*'
  66. - apiGroups:
  67. - apiregistration.k8s.io
  68. resources:
  69. - '*'
  70. verbs:
  71. - '*'
  72. - apiGroups:
  73. - apiextensions.k8s.io
  74. resources:
  75. - '*'
  76. verbs:
  77. - '*'
  78. - apiGroups:
  79. - tenant.kubesphere.io
  80. resources:
  81. - '*'
  82. verbs:
  83. - '*'
  84. - apiGroups:
  85. - certificates.k8s.io
  86. resources:
  87. - '*'
  88. verbs:
  89. - '*'
  90. - apiGroups:
  91. - devops.kubesphere.io
  92. resources:
  93. - '*'
  94. verbs:
  95. - '*'
  96. - apiGroups:
  97. - monitoring.coreos.com
  98. resources:
  99. - '*'
  100. verbs:
  101. - '*'
  102. - apiGroups:
  103. - logging.kubesphere.io
  104. resources:
  105. - '*'
  106. verbs:
  107. - '*'
  108. - apiGroups:
  109. - jaegertracing.io
  110. resources:
  111. - '*'
  112. verbs:
  113. - '*'
  114. - apiGroups:
  115. - storage.k8s.io
  116. resources:
  117. - '*'
  118. verbs:
  119. - '*'
  120. - apiGroups:
  121. - admissionregistration.k8s.io
  122. resources:
  123. - '*'
  124. verbs:
  125. - '*'
  126. - apiGroups:
  127. - policy
  128. resources:
  129. - '*'
  130. verbs:
  131. - '*'
  132. - apiGroups:
  133. - autoscaling
  134. resources:
  135. - '*'
  136. verbs:
  137. - '*'
  138. - apiGroups:
  139. - networking.istio.io
  140. resources:
  141. - '*'
  142. verbs:
  143. - '*'
  144. - apiGroups:
  145. - config.istio.io
  146. resources:
  147. - '*'
  148. verbs:
  149. - '*'
  150. - apiGroups:
  151. - iam.kubesphere.io
  152. resources:
  153. - '*'
  154. verbs:
  155. - '*'
  156. - apiGroups:
  157. - notification.kubesphere.io
  158. resources:
  159. - '*'
  160. verbs:
  161. - '*'
  162. - apiGroups:
  163. - auditing.kubesphere.io
  164. resources:
  165. - '*'
  166. verbs:
  167. - '*'
  168. - apiGroups:
  169. - events.kubesphere.io
  170. resources:
  171. - '*'
  172. verbs:
  173. - '*'
  174. - apiGroups:
  175. - core.kubefed.io
  176. resources:
  177. - '*'
  178. verbs:
  179. - '*'
  180. - apiGroups:
  181. - installer.kubesphere.io
  182. resources:
  183. - '*'
  184. verbs:
  185. - '*'
  186. - apiGroups:
  187. - storage.kubesphere.io
  188. resources:
  189. - '*'
  190. verbs:
  191. - '*'
  192. ---
  193. kind: ClusterRoleBinding
  194. apiVersion: rbac.authorization.k8s.io/v1
  195. metadata:
  196. name: ks-installer
  197. subjects:
  198. - kind: ServiceAccount
  199. name: ks-installer
  200. namespace: kubesphere-system
  201. roleRef:
  202. kind: ClusterRole
  203. name: ks-installer
  204. apiGroup: rbac.authorization.k8s.io
  205. ---
  206. apiVersion: apps/v1
  207. kind: Deployment
  208. metadata:
  209. name: ks-installer
  210. namespace: kubesphere-system
  211. labels:
  212. app: ks-install
  213. spec:
  214. replicas: 1
  215. selector:
  216. matchLabels:
  217. app: ks-install
  218. template:
  219. metadata:
  220. labels:
  221. app: ks-install
  222. spec:
  223. serviceAccountName: ks-installer
  224. containers:
  225. - name: installer
  226. image: kubesphere/ks-installer:v3.0.0
  227. imagePullPolicy: "Always"
  228. volumeMounts:
  229. - mountPath: /etc/localtime
  230. name: host-time
  231. volumes:
  232. - hostPath:
  233. path: /etc/localtime
  234. type: ""
  235. name: host-time

cluster-configuration.yaml

官网地址:kubectl apply -f https://github.com/kubesphere/ks-installer/releases/download/v3.0.0/cluster-configuration.yaml

---
apiVersion: installer.kubesphere.io/v1alpha1
kind: ClusterConfiguration
metadata:
  name: ks-installer
  namespace: kubesphere-system
  labels:
    version: v3.0.0
spec:
  persistence:
    storageClass: ""        # If there is not a default StorageClass in your cluster, you need to specify an existing StorageClass here.
  authentication:
    jwtSecret: ""           # Keep the jwtSecret consistent with the host cluster. Retrive the jwtSecret by executing "kubectl -n kubesphere-system get cm kubesphere-config -o yaml | grep -v "apiVersion" | grep jwtSecret" on the host cluster.
  etcd:
    monitoring: true       # Whether to enable etcd monitoring dashboard installation. You have to create a secret for etcd before you enable it.
    endpointIps: 192.168.148.100  # etcd cluster EndpointIps, it can be a bunch of IPs here.
    port: 2379              # etcd port
    tlsEnable: true
  common:
    mysqlVolumeSize: 20Gi # MySQL PVC size.
    minioVolumeSize: 20Gi # Minio PVC size.
    etcdVolumeSize: 20Gi  # etcd PVC size.
    openldapVolumeSize: 2Gi   # openldap PVC size.
    redisVolumSize: 2Gi # Redis PVC size.
    es:   # Storage backend for logging, events and auditing.
      # elasticsearchMasterReplicas: 1   # total number of master nodes, it's not allowed to use even number
      # elasticsearchDataReplicas: 1     # total number of data nodes.
      elasticsearchMasterVolumeSize: 4Gi   # Volume size of Elasticsearch master nodes.
      elasticsearchDataVolumeSize: 20Gi    # Volume size of Elasticsearch data nodes.
      logMaxAge: 7                     # Log retention time in built-in Elasticsearch, it is 7 days by default.
      elkPrefix: logstash              # The string making up index names. The index name will be formatted as ks-<elk_prefix>-log.
  console:
    enableMultiLogin: true  # enable/disable multiple sing on, it allows an account can be used by different users at the same time.
    port: 30880
  alerting:                # (CPU: 0.3 Core, Memory: 300 MiB) Whether to install KubeSphere alerting system. It enables Users to customize alerting policies to send messages to receivers in time with different time intervals and alerting levels to choose from.
    enabled: false
  auditing:                # Whether to install KubeSphere audit log system. It provides a security-relevant chronological set of records,recording the sequence of activities happened in platform, initiated by different tenants.
    enabled: false
  devops:                  # (CPU: 0.47 Core, Memory: 8.6 G) Whether to install KubeSphere DevOps System. It provides out-of-box CI/CD system based on Jenkins, and automated workflow tools including Source-to-Image & Binary-to-Image.
    enabled: false
    jenkinsMemoryLim: 2Gi      # Jenkins memory limit.
    jenkinsMemoryReq: 1500Mi   # Jenkins memory request.
    jenkinsVolumeSize: 8Gi     # Jenkins volume size.
    jenkinsJavaOpts_Xms: 512m  # The following three fields are JVM parameters.
    jenkinsJavaOpts_Xmx: 512m
    jenkinsJavaOpts_MaxRAM: 2g
  events:                  # Whether to install KubeSphere events system. It provides a graphical web console for Kubernetes Events exporting, filtering and alerting in multi-tenant Kubernetes clusters.
    enabled: false
    ruler:
      enabled: true
      replicas: 2
  logging:                 # (CPU: 57 m, Memory: 2.76 G) Whether to install KubeSphere logging system. Flexible logging functions are provided for log query, collection and management in a unified console. Additional log collectors can be added, such as Elasticsearch, Kafka and Fluentd.
    enabled: false
    logsidecarReplicas: 2
  metrics_server:                    # (CPU: 56 m, Memory: 44.35 MiB) Whether to install metrics-server. IT enables HPA (Horizontal Pod Autoscaler).
    enabled: false
  monitoring:
    # prometheusReplicas: 1            # Prometheus replicas are responsible for monitoring different segments of data source and provide high availability as well.
    prometheusMemoryRequest: 400Mi   # Prometheus request memory.
    prometheusVolumeSize: 20Gi       # Prometheus PVC size.
    # alertmanagerReplicas: 1          # AlertManager Replicas.
  multicluster:
    clusterRole: none  # host | member | none  # You can install a solo cluster, or specify it as the role of host or member cluster.
  networkpolicy:       # Network policies allow network isolation within the same cluster, which means firewalls can be set up between certain instances (Pods).
    # Make sure that the CNI network plugin used by the cluster supports NetworkPolicy. There are a number of CNI network plugins that support NetworkPolicy, including Calico, Cilium, Kube-router, Romana and Weave Net.
    enabled: false
  notification:        # Email Notification support for the legacy alerting system, should be enabled/disabled together with the above alerting option.
    enabled: false
  openpitrix:          # (2 Core, 3.6 G) Whether to install KubeSphere Application Store. It provides an application store for Helm-based applications, and offer application lifecycle management.
    enabled: false
  servicemesh:         # (0.3 Core, 300 MiB) Whether to install KubeSphere Service Mesh (Istio-based). It provides fine-grained traffic management, observability and tracing, and offer visualization for traffic topology.
    enabled: false

image.png

解决etcd监控证书找不到问题(prometheus-k8s-X)

kubectl -n kubesphere-monitoring-system create secret generic kube-etcd-client-certs  --from-file=etcd-client-ca.crt=/etc/kubernetes/pki/etcd/ca.crt  --from-file=etcd-client.crt=/etc/kubernetes/pki/apiserver-etcd-client.crt  --from-file=etcd-client.key=/etc/kubernetes/pki/apiserver-etcd-client.key

//查看证书位置
ps -ef|grep kube-apiserver
--etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt 
--etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt 
--etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key
## kube-etcd-client-certs