# Copyright 2019 TeamTalk Remix Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: teamtalk-ng-msfs
  labels:
    app: teamtalk-ng
    component: msfs
spec:
  selector:
    matchLabels:
      app: teamtalk-ng
      component: msfs
  template:
    metadata:
      labels:
        app: teamtalk-ng
        component: msfs
    spec:
      securityContext:
        runAsNonRoot: true
        fsGroup: 0
      containers:
      - name: msfs
        image: docker.io/rayson/teamtalk-ng:latest
        args:
        - msfs
        workingDir: /var/local/teamtalk-ng
        resources:
          requests:
            memory: "64Mi"
            cpu: "100m"
          limits:
            memory: "128Mi"
            cpu: "500m"
        ports:
        - containerPort: 8700
          name: msfs-client
        volumeMounts:
        - name: teamtalk-ng-msfs-cm
          mountPath: /var/local/teamtalk-ng
        - name: teamtalk-ng-msfs-data
          mountPath: /var/lib/teamtalk-ng/msfs
      volumes:
      - name: teamtalk-ng-msfs-cm
        configMap:
          name: teamtalk-ng-msfs
      - name: teamtalk-ng-msfs-data
        persistentVolumeClaim:
          claimName: teamtalk-ng-msfs-data
