# service
apiVersion: v1
kind: Service
metadata:
  name: sun
spec:
  ports:
  - name: tcp-80-80
    port: 80
    protocol: TCP
    targetPort: 80
  selector:
    release: sun
  sessionAffinity: None
  type: ClusterIP

---
# deployment
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  labels:
    app: sun
    release: sun
  name: sun
spec:
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: sun
      release: sun
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: sun
        release: sun
    spec:
      containers:
      - command:
        - /bin/bash
        - -c
        - gunicorn sun.wsgi:application --bind=0.0.0.0:80 --workers=8 --worker-class=gevent
          --worker-connections=1024 --timeout 600
        image: ccr.ccs.tencentyun.com/gm-ai/like-sun:<IMAGE_TAG>
        imagePullPolicy: Always
        name: sun
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
      imagePullSecrets:
      - name: gm-secret
      restartPolicy: Always
