网站首页 文章专栏 Skywalking k8s deployment的yaml文件编写
apiVersion: apps/v1 kind: Deployment metadata: annotations: description: skywalking-oap-server labels: app: skywalking-oap-server name: skywalking-oap-server namespace: logging spec: progressDeadlineSeconds: 600 replicas: 1 selector: matchLabels: app: skywalking-oap-server strategy: rollingUpdate: maxSurge: 1 maxUnavailable: 0 type: RollingUpdate template: metadata: creationTimestamp: null labels: app: skywalking-oap-server spec: containers: - env: - name: SW_STORAGE value: elasticsearch7 - name: SW_NAMESPACE value: docker-cluster - name: SW_STORAGE_ES_CLUSTER_NODES value: | elasticsearch.logging:9200 image: apache/skywalking-oap-server:8.5.0-es7 imagePullPolicy: IfNotPresent name: skywalking-oap-server resources: limits: cpu: "2" memory: 4Gi securityContext: privileged: false restartPolicy: Always --- apiVersion: v1 kind: Service metadata: labels: app: skywalking name: skywalking namespace: logging spec: ports: - name: http port: 12800 protocol: TCP targetPort: 12800 - name: grpc port: 11800 protocol: TCP targetPort: 11800 selector: app: skywalking-oap-server type: ClusterIP --- apiVersion: apps/v1 kind: Deployment metadata: labels: app: skyui name: skyui namespace: logging spec: replicas: 1 selector: matchLabels: app: skyui strategy: rollingUpdate: maxSurge: 1 maxUnavailable: 0 type: RollingUpdate template: metadata: labels: app: skyui spec: containers: - env: - name: SW_OAP_ADDRESS value: skywalking:12800 - name: SW_TIMEOUT value: "20000" image: apache/skywalking-ui:8.5.0 imagePullPolicy: Always name: skyui resources: limits: cpu: "2" memory: 2Gi --- apiVersion: v1 kind: Service metadata: labels: app: skyui name: skyui namespace: logging spec: ports: - name: http-admin port: 8080 protocol: TCP targetPort: 8080 selector: app: skyui type: ClusterIP下
下面是ingress.yaml
apiVersion: extensions/v1beta1 kind: Ingress metadata: name: skyui namespace: logging spec: rules: - host: skyui.mydomain.com http: paths: - backend: serviceName: skyui servicePort: 8080
使用 kubectl -n logging apply -f deployment_service.yaml 创建。
一切OK后。
访问 http://skyui.mydomain
即可访问 skywalking ui 页面