apiVersion: v1
kind: Service
metadata:
  name: rpuppy
  namespace: {{ .Release.Namespace }}
spec:
  type: ClusterIP
  selector:
    app: rpuppy
  ports:
  - name: http
    port: {{ .Values.port }}
    targetPort: http
    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: http
          containerPort: {{ .Values.port }}
          protocol: TCP
        command:
        - /usr/bin/rpuppy
        - --port={{ .Values.port }}
        resources:
          requests:
            memory: "10Mi"
            cpu: "10m"
          limits:
            memory: "20Mi"
            cpu: "100m"
      tolerations:
      - key: "pcloud"
        operator: "Equal"
        value: "role"
        effect: "NoSchedule"
