K8S部署Skywalking

步骤

  1. 安装es7
    《docker安装ElasticSearch7》
  2. 下载aop镜像
    https://hub.docker.com/r/apache/skywalking-oap-server
    docker run --name oap --restart=always -e TZ=Asia/Shanghai --link es7:es7 -d -e SW_STORAGE=elasticsearch7 -e SW_STORAGE_ES_CLUSTER_NODES=es7:9200 apache/skywalking-oap-server:8.9.1
    
  3. 下载ui镜像
    https://hub.docker.com/r/apache/skywalking-ui
    docker run --name oap-ui --restart=always -e TZ=Asia/Shanghai -d -e SW_OAP_ADDRESS=http://oap:12800 apache/skywalking-ui
    

OAP部署

service:

apiVersion: v1
kind: Service
metadata:
  name: oap
  namespace: skywalking-test
  labels:
    service: oap
spec:
  ports:
    - port: 12800
      name: rest
    - port: 11800
      name: grpc
  selector:
    app: oap

deployment:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: oap
  namespace: skywalking-test
spec:
  replicas: 1
  selector:
    matchLabels:
      app: oap
      release: skywalking
  template:
    metadata:
      labels:
        app: oap
        release: skywalking
    spec:
      containers:
        - name: oap
          image: apache/skywalking-oap-server:8.9.1
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 11800
              name: grpc
            - containerPort: 12800
              name: rest

UI部署

service:

apiVersion: v1
kind: Service
metadata:
  name: skywalking-ui
  namespace: skywalking-test
  labels:
    service: skywalking-ui
spec:
  ports:
    - port: 8080
      name: page
      nodePort: 31234
  type: NodePort
  selector:
    app: akywalking-ui

deployment:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: skywalking-ui
  namespace: ihuaben-test
  labels:
    app: skywalking-ui
spec:
  replicas: 1
  selector:
    matchLabels:
      app: skywalking-ui
  template:
    metadata:
      labels:
        app: skywalking-ui
    spec:
      containers:
        - name: skywalking-ui
          image: apache/skywalking-ui
          ports:
            - containerPort: 8080
              name: page
          env:
            - name: SW_OAP_ADDRESS
              value: oap:12800

创建完成这四个配置文件:
K8S部署Skywalking_第1张图片

执行:

kubectl apply -f .

查看pod
在这里插入图片描述

你可能感兴趣的:(笔记,docker,kubernetes,apache)