微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

k8s集群配置搭建skywalking

k8s集群配置搭建skywalking,采用deployment资源,下面上配置

一、configmap资源

apiVersion: v1
data:
  CLUSTER: nacos
  CLUSTER_NACOS_HOST_PORT: nacos1:8848,nacos2:8848,nacos3:8848
  CORE_GRPC_PORT: "11800"
  CORE_REST_PORT: "12800"
  STORAGE: elasticsearch
  STORAGE_ES_CLUSTER_NODES: es地址:端口
kind: ConfigMap
Metadata:
  name: skywalking-config
  namespace: default
configmap.yaml

二、service资源

apiVersion: v1
kind: Service
Metadata:
  labels:
    app: uplive-skywalking
  name: uplive-skywalking
  namespace: default
spec:
  ports:
  - name: http
    port: 12800
    protocol: TCP
    targetPort: 12800
  - name: grpc
    port: 11800
    protocol: TCP
    targetPort: 11800
  selector:
    app: uplive-skywalking
  type: ClusterIP

---
apiVersion: v1
kind: Service
Metadata:
  labels:
    app: uplive-skywalking-ui
  name: uplive-skywalking-ui
  namespace: default
spec:
  ports:
  - name: http
    port: 8080
    protocol: TCP
    targetPort: 8080
  selector:
    app: uplive-skywalking-ui
  type: ClusterIP
service.yaml

三、deployment资源

apiVersion: apps/v1
kind: Deployment
Metadata:
  labels:
    app: uplive-skywalking-ui
  name: uplive-skywalking-ui
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      app: uplive-skywalking-ui
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    Metadata:
      labels:
        app: uplive-skywalking-ui
    spec:
      containers:
      - env:
        - name: SW_OAP_ADDRESS
          value: uplive-skywalking:12800
        image: apache/skywalking-ui:8.8.1
        imagePullPolicy: IfNotPresent
        name: skywalking-ui
        ports:
        - containerPort: 8080
          name: http
          protocol: TCP
        resources:
          limits:
            cpu: "2"
            memory: 1Gi
          requests:
            cpu: "1"
            memory: 1Gi
        volumeMounts:
        - mountPath: /etc/localtime
          name: volume-localtimeGG
      dnsConfig:
        nameservers:
        - 169.254.20.10
        - 172.20.0.10
      dnsPolicy: None
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      volumes:
      - hostPath:
          path: /etc/localtime
          type: ""
        name: volume-localtime
skywalking-ui.yaml

apiVersion: apps/v1
kind: Deployment
Metadata:
  labels:
    app: uplive-skywalking
  name: uplive-skywalking
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      app: uplive-skywalking
  template:
    Metadata:
      labels:
        app: uplive-skywalking
    spec:
      containers:
      - envFrom:
        - configMapRef:
            name: skywalking-config
          prefix: SW_
        image: apache/skywalking-oap-server:8.8.1
        imagePullPolicy: IfNotPresent
        name: skywalking
        ports:
        - containerPort: 12800
          name: http
          protocol: TCP
        - containerPort: 11800
          name: grpc
          protocol: TCP
        resources:
          limits:
            cpu: 500m
            memory: 3Gi
          requests:
            cpu: 500m
            memory: 3Gi
        volumeMounts:
        - mountPath: /etc/localtime
          name: volume-localtime
      dnsConfig:
        nameservers:
        - 169.254.20.10
        - 172.20.0.10
      dnsPolicy: None
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      volumes:
      - hostPath:
          path: /etc/localtime
          type: ""
        name: volume-localtime
skywalking.yaml

 

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐