• k8s部署skywalking


    软件名称版本
    名称版本备注
    IP10.10.10.99centos7 2009
    kubespherev3.3.0
    kubernetesv1.22.10
    oap8.8.1
    ui8.8.1
    elasticsearch7.5.1

    创建单节点的集群环境

    export KKZONE=cn
    curl -sfL https://get-kk.kubesphere.io | VERSION=v2.2.1 sh -
    ./kk create cluster --with-kubernetes v1.22.10 --with-kubesphere v3.3.0

    一、克隆仓库代码

    git@github.com:apache/skywalking-kubernetes.git

    二、设置环境变量

    vim /etc/profile && source /etc/profile

    三、helm执行命令

    helm repo add ${REPO} https://apache.jfrog.io/artifactory/skywalking-helm
    
    
    helm install "${SKYWALKING_RELEASE_NAME}" ${REPO}/skywalking -n "${SKYWALKING_RELEASE_NAMESPACE}" \
      --set oap.image.tag=8.8.1 \
      --set oap.storageType=elasticsearch \
      --set ui.image.tag=8.8.1 \
      --set elasticsearch.imageTag=7.5.1 \
      --set oap.replicas=1 \
      --set oap.javaOpts=-Xms1g -Xmx1g \
      --set elasticsearch.minimumMasterNodes=1 \
      --set elasticsearch.esJavaOpts=-Xms1g -Xmx1g \
      --set elasticsearch.replicas=1
    

    四、或者使用values.yaml安装

     helm install "${SKYWALKING_RELEASE_NAME}" ${REPO}/skywalking -n "${SKYWALKING_RELEASE_NAMESPACE}" -f values.yaml
    

    values.yaml内容

    1. # Licensed to the Apache Software Foundation (ASF) under one or more
    2. # contributor license agreements. See the NOTICE file distributed with
    3. # this work for additional information regarding copyright ownership.
    4. # The ASF licenses this file to You under the Apache License, Version 2.0
    5. # (the "License"); you may not use this file except in compliance with
    6. # the License. You may obtain a copy of the License at
    7. #
    8. # http://www.apache.org/licenses/LICENSE-2.0
    9. #
    10. # Unless required by applicable law or agreed to in writing, software
    11. # distributed under the License is distributed on an "AS IS" BASIS,
    12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13. # See the License for the specific language governing permissions and
    14. # limitations under the License.
    15. # Default values for skywalking.
    16. # This is a YAML-formatted file.
    17. # Declare variables to be passed into your templates.
    18. serviceAccounts:
    19. oap:
    20. imagePullSecrets: []
    21. initContainer:
    22. image: busybox
    23. tag: '1.30'
    24. oap:
    25. name: oap
    26. # When 'dynamicConfigEnabled' set to true, enable oap dynamic configuration through k8s configmap,
    27. # Note: The default configmap data is empty, please refer to the detailed documentation (https://github.com/apache/skywalking/blob/master/docs/en/setup/backend/dynamic-config.md)
    28. # Sync period in seconds. Defaults to 60 seconds. env: SW_CONFIG_CONFIGMAP_PERIOD
    29. dynamicConfigEnabled: false
    30. image:
    31. repository: skywalking.docker.scarf.sh/apache/skywalking-oap-server
    32. tag: 8.8.1 # Must be set explicitly
    33. pullPolicy: IfNotPresent
    34. storageType: elasticsearch
    35. initEs: true # Whether need to initial ES
    36. ports:
    37. # add more ports here if you need, for example
    38. # zabbix: 10051
    39. grpc: 11800
    40. rest: 12800
    41. replicas: 1
    42. service:
    43. type: ClusterIP
    44. javaOpts: -Xmx1g -Xms1g
    45. antiAffinity: "soft"
    46. nodeAffinity: {}
    47. nodeSelector: {}
    48. tolerations: []
    49. resources:
    50. limits:
    51. cpu: 2
    52. memory: 2Gi
    53. requests:
    54. cpu: 2
    55. memory: 2Gi
    56. # podAnnotations:
    57. # example: oap-foo
    58. envoy:
    59. als:
    60. enabled: false
    61. # more envoy ALS ,please refer to https://github.com/apache/skywalking/blob/master/docs/en/setup/envoy/als_setting.md#observe-service-mesh-through-als
    62. istio:
    63. adapter:
    64. enabled: false
    65. env:
    66. # more env, please refer to https://hub.docker.com/r/apache/skywalking-oap-server
    67. # or https://github.com/apache/skywalking-docker/blob/master/6/6.4/oap/README.md#sw_telemetry
    68. ui:
    69. name: ui
    70. replicas: 1
    71. image:
    72. repository: skywalking.docker.scarf.sh/apache/skywalking-ui
    73. tag: 8.8.1 # Must be set explicitly
    74. pullPolicy: IfNotPresent
    75. # podAnnotations:
    76. # example: oap-foo
    77. nodeAffinity: {}
    78. nodeSelector: {}
    79. tolerations: []
    80. ingress:
    81. enabled: false
    82. annotations: {}
    83. # kubernetes.io/ingress.class: nginx
    84. # kubernetes.io/tls-acme: "true"
    85. path: /
    86. hosts: []
    87. # - skywalking.local
    88. tls: []
    89. # - secretName: skywalking-tls
    90. # hosts:
    91. # - skywalking.local
    92. service:
    93. type: ClusterIP
    94. # clusterIP: None
    95. externalPort: 80
    96. internalPort: 8080
    97. ## nodePort is the port on each node on which this service is exposed when type=NodePort
    98. ## Default: auto-allocated port if not specified. 30080 is just an example
    99. ##
    100. # nodePort: 30080
    101. ## External IP addresses of service
    102. ## Default: nil
    103. ##
    104. # externalIPs:
    105. # - 192.168.0.1
    106. #
    107. ## LoadBalancer IP if service.type is LoadBalancer
    108. ## Default: nil
    109. ##
    110. # loadBalancerIP: 10.2.2.2
    111. # Annotation example: setup ssl with aws cert when service.type is LoadBalancer
    112. # service.beta.kubernetes.io/aws-load-balancer-ssl-cert: arn:aws:acm:us-east-1:EXAMPLE_CERT
    113. annotations: {}
    114. ## Limit load balancer source ips to list of CIDRs (where available)
    115. # loadBalancerSourceRanges: []
    116. esInit:
    117. nodeAffinity: {}
    118. nodeSelector: {}
    119. tolerations: []
    120. elasticsearch:
    121. enabled: true
    122. config: # For users of an existing elasticsearch cluster,takes effect when `elasticsearch.enabled` is false
    123. port:
    124. http: 9200
    125. host: elasticsearch # es service on kubernetes or host
    126. user: "elastic" # [optional]
    127. password: "elastic" # [optional]
    128. clusterName: "elasticsearch"
    129. nodeGroup: "master"
    130. # The service that non master groups will try to connect to when joining the cluster
    131. # This should be set to clusterName + "-" + nodeGroup for your master group
    132. masterService: ""
    133. # Elasticsearch roles that will be applied to this nodeGroup
    134. # These will be set as environment variables. E.g. node.master=true
    135. roles:
    136. master: "true"
    137. ingest: "true"
    138. data: "true"
    139. replicas: 1
    140. minimumMasterNodes: 1
    141. esMajorVersion: ""
    142. # Allows you to add any config files in /usr/share/elasticsearch/config/
    143. # such as elasticsearch.yml and log4j2.properties
    144. esConfig: {}
    145. # elasticsearch.yml: |
    146. # key:
    147. # nestedkey: value
    148. # log4j2.properties: |
    149. # key = value
    150. # Extra environment variables to append to this nodeGroup
    151. # This will be appended to the current 'env:' key. You can use any of the kubernetes env
    152. # syntax here
    153. extraEnvs: []
    154. # - name: MY_ENVIRONMENT_VAR
    155. # value: the_value_goes_here
    156. # A list of secrets and their paths to mount inside the pod
    157. # This is useful for mounting certificates for security and for mounting
    158. # the X-Pack license
    159. secretMounts: []
    160. # - name: elastic-certificates
    161. # secretName: elastic-certificates
    162. # path: /usr/share/elasticsearch/config/certs
    163. image: "docker.elastic.co/elasticsearch/elasticsearch"
    164. imageTag: "7.5.1"
    165. imagePullPolicy: "IfNotPresent"
    166. podAnnotations: {}
    167. # iam.amazonaws.com/role: es-cluster
    168. # additionals labels
    169. labels: {}
    170. esJavaOpts: "-Xmx4g -Xms4g"
    171. resources:
    172. requests:
    173. cpu: "2000m"
    174. memory: "6Gi"
    175. limits:
    176. cpu: "2000m"
    177. memory: "6Gi"
    178. initResources:
    179. limits:
    180. cpu: "512"
    181. memory: "1024Mi"
    182. requests:
    183. cpu: "512m"
    184. memory: "1024Mi"
    185. sidecarResources:
    186. limits:
    187. cpu: "1000m"
    188. memory: "1048Mi"
    189. requests:
    190. cpu: "1000m"
    191. memory: "1048Mi"
    192. networkHost: "0.0.0.0"
    193. volumeClaimTemplate:
    194. accessModes: [ "ReadWriteOnce" ]
    195. resources:
    196. requests:
    197. storage: 50Gi
    198. rbac:
    199. create: false
    200. serviceAccountName: ""
    201. podSecurityPolicy:
    202. create: false
    203. name: ""
    204. spec:
    205. privileged: true
    206. fsGroup:
    207. rule: RunAsAny
    208. runAsUser:
    209. rule: RunAsAny
    210. seLinux:
    211. rule: RunAsAny
    212. supplementalGroups:
    213. rule: RunAsAny
    214. volumes:
    215. - secret
    216. - configMap
    217. - persistentVolumeClaim
    218. persistence:
    219. enabled: false
    220. annotations: {}
    221. extraVolumes: ""
    222. # - name: extras
    223. # emptyDir: {}
    224. extraVolumeMounts: ""
    225. # - name: extras
    226. # mountPath: /usr/share/extras
    227. # readOnly: true
    228. extraInitContainers: ""
    229. # - name: do-something
    230. # image: busybox
    231. # command: ['do', 'something']
    232. # This is the PriorityClass settings as defined in
    233. # https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#priorityclass
    234. priorityClassName: ""
    235. # By default this will make sure two pods don't end up on the same node
    236. # Changing this to a region would allow you to spread pods across regions
    237. antiAffinityTopologyKey: "kubernetes.io/hostname"
    238. # Hard means that by default pods will only be scheduled if there are enough nodes for them
    239. # and that they will never end up on the same node. Setting this to soft will do this "best effort"
    240. antiAffinity: "soft"
    241. # This is the node affinity settings as defined in
    242. # https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#node-affinity-beta-feature
    243. nodeAffinity: {}
    244. # The default is to deploy all pods serially. By setting this to parallel all pods are started at
    245. # the same time when bootstrapping the cluster
    246. podManagementPolicy: "Parallel"
    247. protocol: http
    248. httpPort: 9200
    249. transportPort: 9300
    250. service:
    251. labels: {}
    252. labelsHeadless: {}
    253. type: ClusterIP
    254. nodePort: ""
    255. annotations: {}
    256. httpPortName: http
    257. transportPortName: transport
    258. updateStrategy: RollingUpdate
    259. # This is the max unavailable setting for the pod disruption budget
    260. # The default value of 1 will make sure that kubernetes won't allow more than 1
    261. # of your pods to be unavailable during maintenance
    262. maxUnavailable: 1
    263. podSecurityContext:
    264. fsGroup: 1000
    265. runAsUser: 1000
    266. # The following value is deprecated,
    267. # please use the above podSecurityContext.fsGroup instead
    268. fsGroup: ""
    269. securityContext:
    270. capabilities:
    271. drop:
    272. - ALL
    273. #readOnlyRootFilesystem: true
    274. runAsNonRoot: true
    275. runAsUser: 1000
    276. # How long to wait for elasticsearch to stop gracefully
    277. terminationGracePeriod: 120
    278. sysctlVmMaxMapCount: 262144
    279. readinessProbe:
    280. failureThreshold: 3
    281. initialDelaySeconds: 10
    282. periodSeconds: 10
    283. successThreshold: 3
    284. timeoutSeconds: 5
    285. # https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.html#request-params wait_for_status
    286. clusterHealthCheckParams: "wait_for_status=green&timeout=1s"
    287. ## Use an alternate scheduler.
    288. ## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/
    289. ##
    290. schedulerName: ""
    291. imagePullSecrets: []
    292. nodeSelector: {}
    293. tolerations: []
    294. # Enabling this will publically expose your Elasticsearch instance.
    295. # Only enable this if you have security enabled on your cluster
    296. ingress:
    297. enabled: false
    298. annotations: {}
    299. # kubernetes.io/ingress.class: nginx
    300. # kubernetes.io/tls-acme: "true"
    301. path: /
    302. hosts:
    303. - chart-example.local
    304. tls: []
    305. # - secretName: chart-example-tls
    306. # hosts:
    307. # - chart-example.local
    308. nameOverride: ""
    309. fullnameOverride: ""
    310. # https://github.com/elastic/helm-charts/issues/63
    311. masterTerminationFix: true
    312. #没有执行权限
    313. #lifecycle:
    314. #preStop:
    315. #exec:
    316. #command: ["/bin/sh", "-c", "echo Hello from the postStart handler > /usr/share/message"]
    317. #postStart:
    318. #exec:
    319. #command: ["/bin/sh", "-c", "echo Hello from the postStart handler > /usr/share/message"]
    320. sysctlInitContainer:
    321. enabled: true
    322. keystore: []
    323. satellite:
    324. name: satellite
    325. replicas: 1
    326. enabled: false
    327. image:
    328. repository: skywalking.docker.scarf.sh/apache/skywalking-satellite
    329. tag: 8.8.1 # Must be set explicitly
    330. pullPolicy: IfNotPresent
    331. ports:
    332. grpc: 11800
    333. prometheus: 1234
    334. service:
    335. type: ClusterIP
    336. antiAffinity: "soft"
    337. nodeAffinity: {}
    338. nodeSelector: {}
    339. tolerations: []
    340. resources:
    341. limits:
    342. cpu: 1
    343. memory: 1Gi
    344. requests:
    345. cpu: 1
    346. memory: 1Gi
    347. podAnnotations:
    348. # example: oap-foo
    349. env:
    350. # more env, please refer to https://skywalking.apache.org/docs/skywalking-satellite/latest/en/setup/readme/#satellite_configyaml
    351. nameOverride: ""
    352. fullnameOverride: ""

    五、查看效果

     

  • 相关阅读:
    A股风格因子看板 (2023.11 第11期)
    新媒体运营,通过归因分析锁定下一个爆款 10万+
    Grafana 图表配置快速入门
    十年新起点,九号公司“三路出击”:顶流代言、博士后上任、全球化布局
    Esri美国个人许可购买指南
    java文件传输简单方法
    【计算机视觉 | 目标检测 | 图像分割】arxiv 计算机视觉关于目标检测和图像分割的学术速递(7 月 17 日论文合集)
    中科大郑烇、杨坚 《计算机网络》第三章: 传输层
    面经pc端项目
    【AI视野·今日NLP 自然语言处理论文速览 第六十四期】Fri, 27 Oct 2023
  • 原文地址:https://blog.csdn.net/TT1024167802/article/details/126634603