This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Cancel all pulp tasks that are just in a specifiedstate | |
tmpfile=/tmp/tasks | |
read -p "Enter task state to kill, e.g. Waiting: " ans | |
echo "" | |
if [ "${#ans}" -gt 0 ] | |
then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for x in $(oc get is -n openshift | awk 'NR>1 {print $1}'); do oc import-image $x; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"id":"59d1342e4a44ebbcc872e7e0","name":"Test Sheets Import","desc":"","descData":null,"closed":false,"idOrganization":"56a6de8804bc53cf596edb52","invited":false,"limits":{"boards":{"totalMembersPerBoard":{"status":"ok","disableAt":1520,"warnAt":1440}},"cards":{"openPerBoard":{"status":"ok","disableAt":4750,"warnAt":4500},"totalPerBoard":{"status":"ok","disableAt":1900000,"warnAt":1800000}},"checklists":{"perBoard":{"status":"ok","disableAt":15200,"warnAt":14400}},"labels":{"perBoard":{"status":"ok","disableAt":950,"warnAt":900}},"lists":{"openPerBoard":{"status":"ok","disableAt":475,"warnAt":450},"totalPerBoard":{"status":"ok","disableAt":2850,"warnAt":2700}}},"pinned":false,"starred":false,"url":"https://trello.com/b/WYOGQ9Bp/test-sheets-import","prefs":{"permissionLevel":"org","voting":"disabled","comments":"members","invitations":"members","selfJoin":true,"cardCovers":true,"cardAging":"regular","calendarFeedEnabled":false,"background":"59ce9baf279fa0f192701637","backgroundImage":"https://trello-background |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat restrict-microservices-all.yml | |
APIVersion: 0 | |
data: | |
networkaccesspolicies: | |
- action: Reject | |
logsEnabled: true | |
fallback: true | |
name: reject-microservice-fallback | |
object: | |
- - $namespace=/aporeto/gigaom/mct/gcp/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat isolate-default-k8s-ns.yml | |
APIVersion: 0 | |
data: | |
networkaccesspolicies: | |
- action: Reject | |
logsEnabled: true | |
fallback: true | |
name: isolate-default-namespace | |
object: | |
- - "@app:k8s:namespace=default" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl get pods --context=${CONTEXT} -n ${NAMESPACE} --field-selector=status.phase=Pending --no-headers -o json | jq -r '.items[] | "---\npod_name: \(.metadata.name)\nstatus: \(.status.phase // "N/A")\nmessage: \(.status.conditions[].message // "N/A")\nreason: \(.status.conditions[].reason // "N/A")\ncontainerStatus: \((.status.containerStatuses // [{}])[].state // "N/A")\ncontainerMessage: \((.status.containerStatuses // [{}])[].state?.waiting?.message // "N/A")\ncontainerReason: \((.status.containerStatuses // [{}])[].state?.waiting?.reason // "N/A")\n---\n"' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl get Kustomization.kustomize.toolkit.fluxcd.io -n ${NAMESPACE} --context ${CONTEXT} -o json | jq -r '.items[] | select (.status.conditions[] | select(.type == "Ready" and .status == "False")) | "---\nKustomization Name: \(.metadata.name)\n\nReady Status: \(.status.conditions[] | select(.type == "Ready") | "\n ready: \(.status)\n message: \(.message)\n reason: \(.reason)\n last_transition_time: \(.lastTransitionTime)")\n\nReconcile Status:\(.status.conditions[] | select(.type == "Reconciling") |"\n reconciling: \(.status)\n message: \(.message)")\n---\n"' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl get certificaterequests.cert-manager.io --context=${CONTEXT} -n ${NAMESPACE} -o json | jq -r '.items[] | select(.status.conditions[] | select(.type == "Ready" and .status != "True")) | {certRequest: .metadata.name, certificate: (.metadata.ownerReferences[].name), issuer: .spec.issuerRef.name, readyStatus: (.status.conditions[] | select(.type == "Ready")).status, readyMessage: (.status.conditions[] | select(.type == "Ready")).message, approvedStatus: (.status.conditions[] | select(.type == "Approved")).status, approvedMessage: (.status.conditions[] | select(.type == "Approved")).message} | "---\nCertificateRequest: \(.certRequest)", "Certificate: \(.certificate)", "Issuer: \(.issuer)", "Ready Status: \(.readyStatus)", "Ready Message: \(.readyMessage)", "Approved Status: \(.approvedStatus)", "Approved Message: \(.approvedMessage)"' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace="${NAMESPACE}"; context="${CONTEXT}"; for ingress in $(kubectl get ingress -n "$namespace" --context "$context" -ojsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}'); do echo "Ingress: $ingress"; health_status="NA"; services=(); backend_services=$(kubectl get ingress "$ingress" -n "$namespace" --context "$context" -ojsonpath='{range .spec.rules[*].http.paths[*]}{.backend.service.name}{"|"}{.backend.service.port.number}{"\n"}{end}'); while IFS='|' read -r service port; do if [ -n "$service" ] && [ -n "$port" ]; then echo "Backend Service: $service, Port: $port"; service_exists=$(kubectl get service "$service" -n "$namespace" --context "$context" -ojsonpath='{.metadata.name}'); if [ -z "$service_exists" ]; then health_status="Unhealthy"; echo "Validation: Service $service does not exist"; else endpoint_pods=$(kubectl get endpoints "$service" -n "$namespace" --context "$context" -ojsonpath='{range .subsets[*].addresses[*]}- Pod Name: {.targetRef.name}\n Pod IP: {.ip}\n{end}'); if [ -z "$endpoint_p |
OlderNewer