apiVersion: v1
kind: Pod
metadata:
  namespace: dev
  name: test-build
spec:
  restartPolicy: Never
  volumes:
  - name: maven
    projected:
      sources:
      - secret:
          name: maven-settings
      - configMap:
          name: maven-settings
  - name: npm
    configMap:
      name: npm-config
  - name: home
    emptyDir:
      medium: ""
  - name: workspace
    emptyDir:
      medium: ""
  - name: tmp
    hostPath:
      path: "/var/tmp"
  - name: registry
    secret:
      secretName: registry-cred
      items:
      - key: .dockerconfigjson
        path: "config.json"
  imagePullSecrets:
  - name: registry-cred
  containers:
  - name: kaniko
    volumeMounts:
    - mountPath: "/home/jenkins/agent"
      name: workspace
    - mountPath: "/kaniko/.docker"
      name: registry
    - mountPath: "/var/tmp"
      name: tmp
    image: gcr.io/kaniko-project/executor:debug
    imagePullPolicy: Always
    resources:
      requests:
        cpu: 10m
        memory: 64Mi
      limits:
        cpu: 100m
        memory: 80Mi
    workingDir: "/home/jenkins/agent"
    command:
    - "/busybox/cat"
    tty: true
  - name: maven
    securityContext:
      capabilities:
        add:
        - "SYS_ADMIN"
    volumeMounts:
    - mountPath: "/home/jenkins/agent"
      name: workspace
    - mountPath: "/home/build"
      name: home
    - mountPath: "/home/build/.m2"
      name: maven
    - mountPath: "/home/build/.npmrc"
      name: npm
      subPath: .npmrc
    - mountPath: "/var/tmp"
      name: tmp
    image: registry.dev.yashkov.org/yashkov/maven:3.8.3.3
    imagePullPolicy: Always
    resources:
      requests:
        memory: 1024Mi
        cpu: 100m
      limits:
        memory: 1200Mi
        cpu: 500m
    env:
    - name: JAVA_TOOL_OPTIONS
      value: "-XX:MaxRAMPercentage=15"
    workingDir: "/home/jenkins/agent"
    command:
    - "/bin/cat"
    tty: true
