k8s集群配置搭建skywalking,依赖nacos及es7采用deployment资源,下面上配置

一、configmap资源

apiVersion: v1
data:
  CLUSTER: nacos
  SERVICE_NAME: test_oap
  CLUSTER_NACOS_HOST_PORT: 10.1.2.76:8848
  CLUSTER_NACOS_NAMESPACE: skywalking
  CLUSTER_NACOS_USERNAME: nacos
  CLUSTER_NACOS_PASSWORD: nacos
  CONFIG_NACOS_SERVER_ADDR: 10.1.2.76
  CONFIG_NACOS_SERVER_PORT: 8848
  CONFIG_NACOS_USERNAME: nacos
  CONFIG_NACOS_PASSWORD: nacos
  CORE_GRPC_PORT: "11800"
  CORE_REST_PORT: "12800"
  STORAGE: elasticsearch
  STORAGE_ES_CLUSTER_NODES: vpc-skywalking-es01-.ap-southeast-1.es.amazonaws.com:443
  STORAGE_ES_HTTP_PROTOCOL: https
  CONFIGURATION: nacos
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

 

posted on 2021-12-31 18:11  自然洒脱  阅读(1085)  评论(0编辑  收藏  举报