kubectl get --raw /api/v1/namespaces/argocd/pods/argocd-server-75db8b479f-fpc48:8083/proxy/metrics | grep argocd_info
# HELP argocd_info ArgoCD version information
# TYPE argocd_info gauge
argocd_info{version="v2.14.9+38985bd"} 1
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
-- Note: pods that aren't part of a deployment will be summed up together | |
-- I _think_ this gives total cost per pod......... | |
-- Ref: https://docs.aws.amazon.com/cur/latest/userguide/example-split-cost-allocation-data.html | |
SELECT | |
ELEMENT_AT(resource_tags, 'aws_eks_cluster_name') AS eks_cluster, | |
ELEMENT_AT(resource_tags, 'aws_eks_namespace') AS namespace, | |
ELEMENT_AT(resource_tags, 'aws_eks_deployment') AS deployment, | |
ROUND(SUM(split_line_item_split_cost), 2) AS split_cost, | |
ROUND(SUM(split_line_item_unused_cost), 2) AS split_unused_cost, | |
ROUND(SUM(split_line_item_split_cost) + SUM(split_line_item_unused_cost), 2) as total_cost |
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
emulate -RL zsh | |
setopt err_return warn_create_global | |
local API_RESOURCE="$1" | |
local ctx | |
local kind | |
if [[ -z "$API_RESOURCE" ]]; then | |
print "Usage: kubectl_search_api_resources <API_RESOURCE>" >&2 | |
print "Will search for the api resources that match the regex API_RESOURCE in all clusters and all namespaces" >&2 |
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 no -o json | |
| from json | |
| get items | |
| select status.images status.nodeInfo.architecture | |
| rename images arch | |
| flatten | |
| update images.names { |in| | |
if ($in | length) > 1 { | |
$in | filter { $in !~ @sha } | |
} else { |
In nushell, you can generate a changelog on the fly with the following:
gh release list --json name
| from json
| get name
| par-each --keep-order { |name|
gh release view $name --json name,body,author
| from json
| $"# ($in.name) by ($in.author.login)\n\n($in.body)"
I encountered an issue with a Redis StatefulSet in our staging environment where the pods were stuck in a crashloop. The root cause was a full Persistent Volume Claim (PVC) that had run out of space. Since this was cache data in a staging environment, I needed to clear the /data
folder to resolve the issue.
The challenge was that I couldn't exec into the pod directly because the Redis container was continuously crashlooping, making standard troubleshooting approaches impossible.
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
aws ecr describe-repositories | from json | get repositories.repositoryName | |
| sort | |
| each { |repo| | |
let scanOnPush = (aws ecr batch-get-repository-scanning-configuration --repository-names $repo | |
| from json | |
| get scanningConfigurations | |
| first | |
| get scanOnPush | |
) | |
print $"Repository: ($repo), Scanning on push: ($scanOnPush)" |
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
-- Example of using coroutines with slow IO operations in Neovim. | |
-- It shows how to run coroutines sequentially and in "parallel". | |
-- The word "parallel" is in quotes because Lua coroutines are not actually | |
-- running in parallel, but the IO operations that they start are. | |
-- The coroutines are paused and resumed as the IO operations complete. | |
-- To run this example, put this file somewhere and do `:luafile path/to/coroutines.lua` in nvim. | |
local co = coroutine | |
vim.cmd "new" |
fleetctl user create --name 'Gitops User' \
--password "$(cat /dev/urandom | tr -cd '[:graph:]' | head -c 32)" \
--email [email protected] \
--api-only \
--global-role admin
NewerOlder