Skip to content

Commit

Permalink
Fix certificate check Job examples
Browse files Browse the repository at this point in the history
The example Job specifications were wrong (they had a Pod spec instead).
Also fixing a tabs-vs-spaces problem in examples/README.md.
  • Loading branch information
codificat committed Apr 26, 2017
1 parent 5f49e91 commit 24ca8f9
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 68 deletions.
26 changes: 13 additions & 13 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,19 @@ To run these examples we prepare the inventory and ssh keys as in the other exam

Additionally we allocate a `PersistentVolumeClaim` to store the reports:

oc create -f - <<PVC
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: certcheck-reports
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
PVC
oc create -f - <<PVC
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: certcheck-reports
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
PVC

With that we can run the `Job` once:

Expand Down
56 changes: 31 additions & 25 deletions examples/certificate-check-upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,34 @@ kind: Job
metadata:
name: certificate-check
spec:
containers:
- name: openshift-ansible
image: openshift/openshift-ansible
env:
- name: PLAYBOOK_FILE
value: playbooks/certificate_expiry/easy-mode-upload.yaml
- name: INVENTORY_FILE
value: /tmp/inventory/hosts # from configmap vol below
- name: ANSIBLE_PRIVATE_KEY_FILE # from secret vol below
value: /opt/app-root/src/.ssh/id_rsa/ssh-privatekey
- name: CERT_EXPIRY_WARN_DAYS
value: "45" # must be a string, don't forget the quotes
volumeMounts:
- name: sshkey
mountPath: /opt/app-root/src/.ssh/id_rsa
- name: inventory
mountPath: /tmp/inventory
volumes:
- name: sshkey
secret:
secretName: sshkey
- name: inventory
configMap:
name: inventory
restartPolicy: Never
parallelism: 1
completions: 1
template:
metadata:
name: certificate-check
spec:
containers:
- name: openshift-ansible
image: openshift/openshift-ansible
env:
- name: PLAYBOOK_FILE
value: playbooks/certificate_expiry/easy-mode-upload.yaml
- name: INVENTORY_FILE
value: /tmp/inventory/hosts # from configmap vol below
- name: ANSIBLE_PRIVATE_KEY_FILE # from secret vol below
value: /opt/app-root/src/.ssh/id_rsa/ssh-privatekey
- name: CERT_EXPIRY_WARN_DAYS
value: "45" # must be a string, don't forget the quotes
volumeMounts:
- name: sshkey
mountPath: /opt/app-root/src/.ssh/id_rsa
- name: inventory
mountPath: /tmp/inventory
volumes:
- name: sshkey
secret:
secretName: sshkey
- name: inventory
configMap:
name: inventory
restartPolicy: Never
66 changes: 36 additions & 30 deletions examples/certificate-check-volume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,39 @@ kind: Job
metadata:
name: certificate-check
spec:
containers:
- name: openshift-ansible
image: openshift/openshift-ansible
env:
- name: PLAYBOOK_FILE
value: playbooks/certificate_expiry/html_and_json_timestamp.yaml
- name: INVENTORY_FILE
value: /tmp/inventory/hosts # from configmap vol below
- name: ANSIBLE_PRIVATE_KEY_FILE # from secret vol below
value: /opt/app-root/src/.ssh/id_rsa/ssh-privatekey
- name: CERT_EXPIRY_WARN_DAYS
value: "45" # must be a string, don't forget the quotes
volumeMounts:
- name: sshkey
mountPath: /opt/app-root/src/.ssh/id_rsa
- name: inventory
mountPath: /tmp/inventory
- name: reports
mountPath: /var/lib/certcheck
volumes:
- name: sshkey
secret:
secretName: sshkey
- name: inventory
configMap:
name: inventory
- name: reports
persistentVolumeClaim:
claimName: certcheck-reports
restartPolicy: Never
parallelism: 1
completions: 1
template:
metadata:
name: certificate-check
spec:
containers:
- name: openshift-ansible
image: openshift/openshift-ansible
env:
- name: PLAYBOOK_FILE
value: playbooks/certificate_expiry/html_and_json_timestamp.yaml
- name: INVENTORY_FILE
value: /tmp/inventory/hosts # from configmap vol below
- name: ANSIBLE_PRIVATE_KEY_FILE # from secret vol below
value: /opt/app-root/src/.ssh/id_rsa/ssh-privatekey
- name: CERT_EXPIRY_WARN_DAYS
value: "45" # must be a string, don't forget the quotes
volumeMounts:
- name: sshkey
mountPath: /opt/app-root/src/.ssh/id_rsa
- name: inventory
mountPath: /tmp/inventory
- name: reports
mountPath: /var/lib/certcheck
volumes:
- name: sshkey
secret:
secretName: sshkey
- name: inventory
configMap:
name: inventory
- name: reports
persistentVolumeClaim:
claimName: certcheck-reports
restartPolicy: Never

0 comments on commit 24ca8f9

Please sign in to comment.