---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: meet-bot
  namespace: meeting
  labels:
    app: meet-bot-dep
  annotations:
    flux.weave.works/automated: "true"
    flux.weave.works/tag.meet-bot: semver:~1.0
    flux.weave.works/tag.meet-explorer: semver:~1.0
spec:
  selector:
    matchLabels:
      app: meet-bot
  template:
    metadata:
      labels:
        app: meet-bot
    spec:
      containers:
      - name: meet-bot
        image: swr.ap-southeast-1.myhuaweicloud.com/opengauss/meetingbot:v1.0.2020031100
        imagePullPolicy: IfNotPresent
        env:
        - name: NICK
          valueFrom:
            configMapKeyRef:
              name: meetbot-config
              key: nick
        - name: IDENT
          valueFrom:
            configMapKeyRef:
              name: meetbot-config
              key: ident
        - name: USERNAME
          valueFrom:
            configMapKeyRef:
              name: meetbot-config
              key: username
        - name: IRC_PASSWORD
          valueFrom:
            secretKeyRef:
              name: meetbot-secret
              key: irc_password
        - name: IRC_CHANNELS
          valueFrom:
            configMapKeyRef:
              name: meetbot-config
              key: irc_channels
        - name: URL_INFO
          valueFrom:
            configMapKeyRef:
              name: meetbot-config
              key: url_info
        - name: LOG_URL_PREFIX
          valueFrom:
            configMapKeyRef:
              name: meetbot-config
              key: log_url_prefix
        - name: LOG_PATTERN
          valueFrom:
            configMapKeyRef:
              name: meetbot-config
              key: log_pattern
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        volumeMounts:
        - mountPath: /data
          name: data-volume
        - mountPath: /logs
          name: log-volume
      - name: meet-explorer
        image: swr.ap-southeast-1.myhuaweicloud.com/opensourceway/nginx:latest
        imagePullPolicy: IfNotPresent
        env:
        - name: NGINX_PORT
          value: "8080"
        ports:
        - containerPort: 8080
          name: http
          protocol: TCP
        - containerPort: 443
          name: https
          protocol: TCP
        volumeMounts:
        - mountPath: /usr/share/nginx/html
          name: data-volume
        - mountPath: /etc/nginx/nginx.conf
          name: nginx-config-vol
          subPath: nginx.conf
        - mountPath: /etc/nginx/ssl
          name: secret-volume
      volumes:
      - name: data-volume
        persistentVolumeClaim:
          claimName: meetbot-data-vol
      - name: log-volume
        persistentVolumeClaim:
          claimName: meetbot-log-vol
      - name: nginx-config-vol
        configMap:
          name: meetbot-config
      - name: secret-volume
        secret:
          secretName: meetbot-cert-secret
