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: defaultconfigmap.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: ClusterIPservice.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-localtimeskywalking-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-localtimeskywalking.yaml