kind: ConfigMap
apiVersion: v1
metadata:
  name: gretl
  labels:
    app: gretl-platform
    role: jenkins-slave
data:
  template: |-
    <org.csanchez.jenkins.plugins.kubernetes.PodTemplate>
      <inheritFrom></inheritFrom>
      <name>gretl</name>
      <instanceCap>4</instanceCap>
      <idleMinutes>0</idleMinutes>
      <label>gretl</label>
      <serviceAccount>jenkins</serviceAccount>
      <nodeSelector></nodeSelector>
      <containers>
        <org.csanchez.jenkins.plugins.kubernetes.ContainerTemplate>
          <name>jnlp</name>
          <image>jenkins-agent:latest</image>
          <privileged>false</privileged>
          <alwaysPullImage>false</alwaysPullImage>
          <workingDir>/tmp</workingDir>
          <command></command>
          <args>${computer.jnlpmac} ${computer.name}</args>
          <ttyEnabled>false</ttyEnabled>
          <envVars/>
        </org.csanchez.jenkins.plugins.kubernetes.ContainerTemplate>
        <org.csanchez.jenkins.plugins.kubernetes.ContainerTemplate>
          <name>gretl</name>
          <image>gretl:latest</image>
          <privileged>false</privileged>
          <alwaysPullImage>false</alwaysPullImage>
          <workingDir>/tmp</workingDir>
          <command>sleep</command>
          <args>24h</args>
          <ttyEnabled>false</ttyEnabled>
          <envVars>
            <org.csanchez.jenkins.plugins.kubernetes.model.KeyValueEnvVar>
              <key>HOME</key>
              <value>/home/gradle</value>
            </org.csanchez.jenkins.plugins.kubernetes.model.KeyValueEnvVar>
            <org.csanchez.jenkins.plugins.kubernetes.model.KeyValueEnvVar>
              <key>GRADLE_OPTS</key>
              <value>-Xmx1024m</value>
            </org.csanchez.jenkins.plugins.kubernetes.model.KeyValueEnvVar>
          </envVars>
        </org.csanchez.jenkins.plugins.kubernetes.ContainerTemplate>
      </containers>
      <envVars/>
      <annotations/>
      <imagePullSecrets/>
      <nodeProperties/>
      <yaml>
    spec:
      containers:
      - name: jnlp
        resources:
          requests:
            cpu: 200m
            memory: 256Mi
          limits:
            cpu: "1"
            memory: 512Mi
      - name: gretl
        resources:
          requests:
            cpu: 200m
            memory: 1Gi
          limits:
            cpu: "1"
            memory: 3.5Gi
        envFrom:
          - configMapRef:
              name: gretl-resources
          - secretRef:
              name: gretl-secrets
      </yaml>
    </org.csanchez.jenkins.plugins.kubernetes.PodTemplate>
