2022-04-03:k8s安装srs,yaml如何写?

2022-04-03 22:31:50 浏览数 (1)

2022-04-03:k8s安装srs,yaml如何写?

答案2022-04-03:

yaml如下:

代码语言:yaml复制
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: srs
  name: srs
  namespace: moonfdd
spec:
  replicas: 1
  selector:
    matchLabels:
      app: srs
  template:
    metadata:
      labels:
        app: srs
    spec:
      containers:
        - image: ossrs/srs
          imagePullPolicy: IfNotPresent
          name: srs
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: srs
  name: srs
  namespace: moonfdd
spec:
  ports:
    - name: rtmp
      port: 1935
      protocol: TCP
      targetPort: 1935
      nodePort: 11935
    - name: console
      port: 1985
      protocol: TCP
      targetPort: 1985
      nodePort: 11985
    - name: stream
      port: 8080
      protocol: TCP
      targetPort: 8080
      nodePort: 18080
  selector:
    app: srs
  type: NodePort

结果如下:

在这里插入图片描述在这里插入图片描述
在这里插入图片描述在这里插入图片描述

0 人点赞