kaniko-aws-backup.yaml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. ---
  2. # Kaniko builds images without docker
  3. #
  4. # Use 'kubectl create -f kaniko.yaml' to execute
  5. #
  6. # NOTES:
  7. # If this is your first kaniko, you need to add a token:
  8. # In gogs: User->Settings->Applications
  9. # kubectl create secret generic git-token --from-literal='GIT_TOKEN=<your-token>'
  10. #
  11. # You need to add credentials to the docker registry:
  12. # kubectl create secret docker-registry docker-regcred \
  13. # --docker-server=https://index.docker.io/v1/ \
  14. # --docker-username=<your-username> \
  15. # --docker-password=<your-password>
  16. apiVersion: batch/v1
  17. kind: Job
  18. metadata:
  19. name: kaniko-aws-backup
  20. spec:
  21. ttlSecondsAfterFinished: 100
  22. backoffLimit: 4
  23. template:
  24. spec:
  25. containers:
  26. - name: kaniko-aws-backup
  27. image: gcr.io/kaniko-project/executor:v1.9.1
  28. args:
  29. - "--dockerfile=./Dockerfile"
  30. - "--context=git://git.monkeybox.org/Containers/aws-backup#refs/heads/main"
  31. - "--destination=fdamstra/aws-backup:latest"
  32. env:
  33. - name: GIT_TOKEN
  34. valueFrom:
  35. secretKeyRef:
  36. name: git-token
  37. key: GIT_TOKEN
  38. volumeMounts:
  39. - name: docker-config
  40. mountPath: /kaniko/.docker/
  41. dnsPolicy: "None"
  42. dnsConfig:
  43. nameservers:
  44. - 10.42.42.239
  45. - 10.42.42.1
  46. searches:
  47. - default.svc.cluster.local
  48. - svc.cluster.local
  49. - cluster.local
  50. options:
  51. - name: ndots
  52. value: "2"
  53. - name: edns0
  54. - name: trust-ad
  55. restartPolicy: Never
  56. volumes:
  57. - name: docker-config
  58. secret:
  59. secretName: docker-regcred
  60. items:
  61. - key: .dockerconfigjson
  62. path: config.json