Skip to content

Commit

Permalink
tweak redis and certmanager issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-funk committed Nov 20, 2023
1 parent d02241f commit eb77ba6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions codebundles/k8s-certmanager-healthcheck/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ The TaskSet requires initialization to import necessary secrets, services, and u

## TODO
- [ ] Add additional documentation.
- [ ] Add cert-manager operator namespace as config field and genrules
6 changes: 4 additions & 2 deletions codebundles/k8s-certmanager-healthcheck/runbook.robot
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Suite Setup Suite Initialization


*** Tasks ***
Get Namespace Certificate Summary
Get Namespace `${NAMESPACE}` Certificate Summary
[Documentation] Gets a list of certmanager certificates and summarize their information for review.
[Tags] tls certificates kubernetes objects expiration summary certmanager
${cert_info}= RW.CLI.Run Cli
Expand All @@ -31,12 +31,13 @@ Get Namespace Certificate Summary
... set_issue_actual=Certificates were found in the namespace ${NAMESPACE} that are past their renewal time and not renewed
... set_issue_title=Found certificates due for renewal in namespace ${NAMESPACE} that are not renewing
... set_issue_details=CertManager certificates not renewing: "$_stdout" - investigate CertManager.
... set_issue_next_steps=Check the health of the `cert-manager` deployment in the `cert-manager` namespace\nInspect `cert-manager` deployment logs for renewal errors in `cert-manager` namespace
... _line__raise_issue_if_contains=Namespace
RW.Core.Add Pre To Report Certificate Information:\n${cert_info.stdout}
${history}= RW.CLI.Pop Shell History
RW.Core.Add Pre To Report Commands Used: ${history}

Find Failed Certificate Requests and Identify Issues
Find Failed Certificate Requests and Identify Issues In Namespace `${NAMESPACE}`
[Documentation] Gets a list of failed certmanager certificates and summarize their issues.
[Tags] tls certificates kubernetes objects failed certificaterequest certmanager
${failed_certificaterequests}= RW.CLI.Run Cli
Expand All @@ -51,6 +52,7 @@ Find Failed Certificate Requests and Identify Issues
... set_issue_actual=Certificates are not ready in ${NAMESPACE}
... set_issue_title=Found failed certificates in namespace ${NAMESPACE}
... set_issue_details=CertManager certificates failed: "$_stdout" - investigate Issuers or ClusterIssuers.
... set_issue_next_steps=Check the health of the `cert-manager` deployment in `cert-manager` namespace\nInspect `cert-manager` deployment logs for renewal errors in `cert-manager` namespace
... _line__raise_issue_if_contains=-
RW.Core.Add Pre To Report Certificate Information:\n${failed_certificaterequests.stdout}
${history}= RW.CLI.Pop Shell History
Expand Down
7 changes: 5 additions & 2 deletions codebundles/k8s-redis-healthcheck/runbook.robot
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ Library Collections

Suite Setup Suite Initialization


*** Tasks ***
Ping Redis Workload
Ping `${DEPLOYMENT_NAME}` Redis Workload
[Documentation] Verifies that a PING can be peformed against the redis workload.
[Tags] redis cli ping pong alive probe ready
${rsp}= RW.CLI.Run Cli
Expand All @@ -30,12 +31,13 @@ Ping Redis Workload
... set_issue_actual=The Redis workload was unable to properly repond to the PING request
... set_issue_title=Redis PING Failed In Namespace ${NAMESPACE} For Redis Deployment ${DEPLOYMENT_NAME}
... set_issue_details=Found $_line in namespace ${NAMESPACE}\nCheck if the redis workload is healthy and available. Attempt to run a 'redis-cli PING' directly on the workload and verify the response which should be PONG.
... set_issue_next_steps=Check PVC health status in namespace ${NAMESPACE}
... _line__raise_issue_if_ncontains=PONG
RW.Core.Add Pre To Report Redis Response:\n${rsp.stdout}
${history}= RW.CLI.Pop Shell History
RW.Core.Add Pre To Report Commands Used: ${history}

Verify Redis Read Write Operation
Verify `${DEPLOYMENT_NAME}` Redis Read Write Operation
[Documentation] Attempts to perform a write and read operation on the redis workload, checking that a key can be set, incremented, and read from.
[Tags] redis cli increment health check read write
${set_op}= RW.CLI.Run Cli
Expand All @@ -60,6 +62,7 @@ Verify Redis Read Write Operation
... set_issue_actual=The redis workload failed to increment the key as expected.
... set_issue_title=Redis Read Write Operation Failure In Namespace ${NAMESPACE} For Redis Deployment ${DEPLOYMENT_NAME}
... set_issue_details=Found $_line in namespace ${NAMESPACE}\nCheck the PVC that the redis workload depends on and verify it's healthy. Try use 'redis-cli INCR ${REDIS_HEALTHCHECK_KEY}' yourself on the workload.
... set_issue_next_steps=Check PVC health status in namespace ${NAMESPACE}
... _line__raise_issue_if_neq=1
RW.Core.Add Pre To Report Redis Response For Key ${REDIS_HEALTHCHECK_KEY}:${get_op.stdout}
${history}= RW.CLI.Pop Shell History
Expand Down

0 comments on commit eb77ba6

Please sign in to comment.