---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: http-endpoint
    service: http-endpoint
  name: http-endpoint
  namespace: prd
spec:
  ports:
    - name: http
      port: 8080
      protocol: TCP
      targetPort: 8080
  selector:
    app: http-endpoint
  type: ClusterIP
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: http-endpoint
  namespace: prd
  labels:
    account: http-endpoint
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: http-endpoint
    version: v1
  name: http-endpoint-v1
  namespace: prd
spec:
  replicas: 1
  selector:
    matchLabels:
      app: http-endpoint
      version: v1
  template:
    metadata:
      labels:
        app: http-endpoint
        version: v1
    spec:
      serviceAccountName: http-endpoint
      containers:
      - env:
        - name: PATH
          value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/sbin:/opt/go-example
        - name: LANG
          value: zh_CN.UTF-8
        - name: VERSION
          value: v1
        image: ccr.ccs.tencentyun.com/wanpinghui/http-endpoint:1583722708
        name: http-endpoint
        ports:
        - containerPort: 8080
          protocol: TCP
          name: http-api
        workingDir: /opt/go-example
      initContainers:
      - image: busybox
        command:
        - sh
        - -c
        - echo 65535 > /proc/sys/net/core/somaxconn
        imagePullPolicy: Always
        name: setsysctl
        securityContext:
          privileged: true
      imagePullSecrets:
      - name: qcloudregistrykey
      - name: tencenthubkey
#---
#apiVersion: apps/v1
#kind: Deployment
#metadata:
#  labels:
#    app: http-endpoint
#    version: v2
#  name: http-endpoint-v2
#  namespace: prd
#spec:
#  replicas: 1
#  selector:
#    matchLabels:
#      app: http-endpoint
#      version: v2
#  template:
#    metadata:
#      labels:
#        app: http-endpoint
#        version: v2
#    spec:
#      serviceAccountName: http-endpoint
#      containers:
#      - env:
#        - name: PATH
#          value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/sbin:/opt/go-example
#        - name: LANG
#          value: zh_CN.UTF-8
#        - name: VERSION
#          value: v2
#        image: ccr.ccs.tencentyun.com/wanpinghui/http-endpoint:1583722730
#        name: http-endpoint
#        ports:
#        - containerPort: 8080
#          protocol: TCP
#          name: http-api
#        workingDir: /opt/go-example
#      initContainers:
#      - image: busybox
#        command:
#        - sh
#        - -c
#        - echo 65535 > /proc/sys/net/core/somaxconn
#        imagePullPolicy: Always
#        name: setsysctl
#        securityContext:
#          privileged: true
#      imagePullSecrets:
#      - name: qcloudregistrykey
#      - name: tencenthubkey