Skip to content

Instantly share code, notes, and snippets.

View goblain's full-sized avatar

Radek Pieczonka goblain

View GitHub Profile

Keybase proof

I hereby claim:

  • I am goblain on github.
  • I am goblain (https://keybase.io/goblain) on keybase.
  • I have a public key ASAn0H-Y4F326aYZlapaQZd83RNPAsdLtLM99VGfo-iKvgo

To claim this, I am signing this object:

@goblain
goblain / get-endpoints.sh
Created December 9, 2016 09:48
bash script to fetch service endpoints list as comma separated string from kubernetes api
# bash script to fetch service endpoints list as comma separated string from kubernetes api
# example will list kube-dns endpoints
export NAMESPACE=kube-system
export SERVICE=kube-dns
curl -s --header "Authorization: Bearer `cat /var/run/secrets/kubernetes.io/serviceaccount/token`" -k https://kubernetes.default/api/v1/namespaces/$NAMESPACE/endpoints/$SERVICE | jq '.subsets | map(.addresses) | reduce .[] as $item ([];. + $item) | map(.ip) | join(",")'
@goblain
goblain / cleanup.sh
Last active November 10, 2015 09:44
S3 cleanup based on timeslots
#!/bin/bash
##
## Gradual cleanup of S3 stored backups
## by Radek 'Goblin' Pieczonka <goblin@pentex.pl>
##
## Configure with environment variables
## - S3BUCKET
## - S3PATH
## Files need to be named YYYYMMDDHHmm.tgz
## TODO: support for moving to glacier for long term backup storage