1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- ---
- # Kaniko builds images without docker
- #
- # Use 'kubectl create -f kaniko.yaml' to execute
- #
- # NOTES:
- # If this is your first kaniko, you need to add a token:
- # In gogs: User->Settings->Applications
- # kubectl create secret generic git-token --from-literal='GIT_TOKEN=<your-token>'
- #
- # You need to add credentials to the docker registry:
- # kubectl create secret docker-registry docker-regcred \
- # --docker-server=https://index.docker.io/v1/ \
- # --docker-username=<your-username> \
- # --docker-password=<your-password>
- apiVersion: batch/v1
- kind: Job
- metadata:
- name: kaniko-aws-backup
- spec:
- ttlSecondsAfterFinished: 100
- backoffLimit: 4
- template:
- spec:
- containers:
- - name: kaniko-aws-backup
- image: gcr.io/kaniko-project/executor:v1.9.1
- args:
- - "--dockerfile=./Dockerfile"
- - "--context=git://git.monkeybox.org/Containers/aws-backup#refs/heads/main"
- - "--destination=fdamstra/aws-backup:latest"
- env:
- - name: GIT_TOKEN
- valueFrom:
- secretKeyRef:
- name: git-token
- key: GIT_TOKEN
- volumeMounts:
- - name: docker-config
- mountPath: /kaniko/.docker/
- dnsPolicy: "None"
- dnsConfig:
- nameservers:
- - 10.42.42.239
- - 10.42.42.1
- searches:
- - default.svc.cluster.local
- - svc.cluster.local
- - cluster.local
- options:
- - name: ndots
- value: "2"
- - name: edns0
- - name: trust-ad
- restartPolicy: Never
- volumes:
- - name: docker-config
- secret:
- secretName: docker-regcred
- items:
- - key: .dockerconfigjson
- path: config.json
|