apiVersion: v1
kind: Service
metadata:
  name: rpuppy
  namespace: {{ .Release.Namespace }}
spec:
  type: ClusterIP
  selector:
    app: rpuppy
  ports:
  - name: {{ .Values.portName }}
    port: 80
    targetPort: {{ .Values.portName }}
    protocol: TCP
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: rpuppy
  namespace: {{ .Release.Namespace }}
spec:
  selector:
    matchLabels:
      app: rpuppy
  replicas: 1
  template:
    metadata:
      labels:
        app: rpuppy
    spec:
      containers:
      - name: rpuppy
        image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
        imagePullPolicy: {{ .Values.image.pullPolicy }}
        ports:
        - name: {{ .Values.portName }}
          containerPort: 8080
          protocol: TCP
        command:
        - rpuppy
        - --port=8080
        resources:
          requests:
            memory: "10Mi"
            cpu: "10m"
          limits:
            memory: "20Mi"
            cpu: "100m"
      tolerations:
      - key: "pcloud"
        operator: "Equal"
        value: "role"
        effect: "NoSchedule"
