0

wanted to know if there's any tool that can validate an openshift deployment. Let's say you have a deploy configuration file with different features (secrets, routes, services, environment variables, etc) and I want to validate after the deployment has finished and the POD/s is/are created in Openshift, that all those things are there as requested on the file. Like a tool for QA.

thanks

Manu Q
  • 25
  • 1
  • 4

3 Answers3

0

Readiness probe are there which can execute http requests on the pod to confirm its availability. Also it can execute commands to confirm desired resources are available within the container. Readiness probe

ygbgames
  • 191
  • 9
  • Thanks for replying. Yes, that's correct, we could run the commands to make sure everything was applied. But the idea is to avoid from running those commands manually, and see if a solution might exist to check all those resources/features automatically. – Manu Q Feb 28 '19 at 19:19
  • yes, I'm using that already. But we are trying to achieve other check. A post deployment check for all the features not just readiness or liveness ones. – Manu Q Mar 11 '19 at 23:48
  • As far as i know we can perform application pre-validation in health check/ reediness probe and kubernetes will call to see if that passes. If all your checks are related to application then they can be performed in health check. Or is there something which cant be covered ?? In spring there is post construct which can help as well if only needed once – ygbgames Mar 13 '19 at 15:08
  • Those would work for app validation. But we are trying to validate the config not the app. Like to know if secrets, replicas, readiness, liveness, services, routes, split traffic configurations, etc, were successfully applied. I know that Openshift should "make sure" that using a deploy configuration file all of that it's been deployed, otherwise deployment should fail. But this comes from an external client req so was just wondering if a tool exists that can perform that post deployment check. Anyway, we went for a custom solution, comparing deploy config file and deployment after finished. – Manu Q Mar 15 '19 at 13:00
0

There is a particular flag --dry-run in Kubernetes for resource creation which performs basic syntax verification and template object schema validation without real object implementation, therefore you can do the test for all underlying objects defined in the deployment manifest file.

I think it is also feasible to achieve through OpenShift client:

$ oc create -f deployment-app.yaml --dry-run

or

$ oc apply -f deployment-app.yaml --dry-run

You can find some useful OpenShift client commands in Developer CLI Operations documentation page.

Nick_Kh
  • 5,089
  • 2
  • 10
  • 16
  • thank you. Yes thought about that options, but that would work if we are checking the deployment before it got deployed. From a QA perspective was thinking about any solution that can be used to check the deployment after it was successfully done. Like, instead of checking if routes were applied, and then check if persistent volume was applied, and so on, to do it someway automatically. – Manu Q Feb 28 '19 at 18:35
0

For one time validation, you can create a Job (OpenShift) with Init Container (OpenShift) that ensures that all deployment process is done, and then run test/shell script with sequence of kubectl/curl/other commands to ensure that every piece of deployment are in place and in desired state.

For continuous validation, you can create a CronJob (OpenShift) that will periodically create a test Job and report the result somewhere.

This answer can help you to create all that stuff.

Black_Bacardi
  • 324
  • 4
  • 10
VAS
  • 8,538
  • 1
  • 28
  • 39