Skip to content

Instantly share code, notes, and snippets.

@ethanfrogers
Created May 7, 2019 12:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ethanfrogers/7e213399814a1d2ef493c7d14a092587 to your computer and use it in GitHub Desktop.
Save ethanfrogers/7e213399814a1d2ef493c7d14a092587 to your computer and use it in GitHub Desktop.
Kaniko Job spec
apiVersion: batch/v1
kind: Job
metadata:
name: kaniko-builder
spec:
backoffLimit: 0
template:
spec:
restartPolicy: Never
initContainers:
- name: git
image: alpine/git
env:
- name: BRANCH
value: master
- name: REPO
value: https://github.com/armory-io/demo-api
command: [git, clone, --single-branch, --branch, $(BRANCH), $(REPO), /workspace]
volumeMounts:
- name: workspace
mountPath: /workspace
containers:
- name: kaniko
image: gcr.io/kaniko-project/executor:latest
env:
- name: DOCKERFILE
value: Dockerfile
- name: CONTEXT
value: dir://workspace
- name: DESTINATION
value: armory-io/loadtesting
args:
- "--dockerfile=$(DOCKERFILE)"
- "--context=$(CONTEXT)"
- "--destination=$(DESTINATION)"
volumeMounts:
- name: workspace
mountPath: /workspace
- name: docker-config
mountPath: /kaniko/.docker
volumes:
- name: workspace
emptyDir: {}
- name: docker-config
secret:
secretName: docker-creds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment