certificate-check-upload.yaml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # An example Job to run a certificate check of OpenShift's internal
  2. # certificate status from within OpenShift.
  3. #
  4. # The generated reports are uploaded to a location in the master
  5. # hosts, using the playbook 'easy-mode-upload.yaml'.
  6. #
  7. # This example uses the openshift/openshift-ansible container image.
  8. # (see README_CONTAINER_IMAGE.md in the top level dir for more details).
  9. #
  10. # The following objects are xpected to be configured before the creation
  11. # of this Job:
  12. # - A ConfigMap named 'inventory' with a key named 'hosts' that
  13. # contains the the Ansible inventory file
  14. # - A Secret named 'sshkey' with a key named 'ssh-privatekey
  15. # that contains the ssh key to connect to the hosts
  16. # (see examples/README.md for more details)
  17. ---
  18. apiVersion: batch/v1
  19. kind: Job
  20. metadata:
  21. name: certificate-check
  22. spec:
  23. containers:
  24. - name: openshift-ansible
  25. image: openshift/openshift-ansible
  26. env:
  27. - name: PLAYBOOK_FILE
  28. value: playbooks/certificate_expiry/easy-mode-upload.yaml
  29. - name: INVENTORY_FILE
  30. value: /tmp/inventory/hosts # from configmap vol below
  31. - name: ANSIBLE_PRIVATE_KEY_FILE # from secret vol below
  32. value: /opt/app-root/src/.ssh/id_rsa/ssh-privatekey
  33. - name: CERT_EXPIRY_WARN_DAYS
  34. value: "45" # must be a string, don't forget the quotes
  35. volumeMounts:
  36. - name: sshkey
  37. mountPath: /opt/app-root/src/.ssh/id_rsa
  38. - name: inventory
  39. mountPath: /tmp/inventory
  40. volumes:
  41. - name: sshkey
  42. secret:
  43. secretName: sshkey
  44. - name: inventory
  45. configMap:
  46. name: inventory
  47. restartPolicy: Never