Skip to content

Instantly share code, notes, and snippets.

@eladtamary
eladtamary / tag_untagged_csi_volumes.sh
Last active November 2, 2021 11:47
This script is used tag AWS volumes that were created by Kubernetes CSI external provisioner. In each execution, the script will tag all AWS volumes that are un-tagged using the tags of the attached instance. This is a workaround until it will be implemented by the external-provisioner natively. See related issue: https://github.com/kubernetes-c…
#!/usr/bin/env bash
echo "$(date) - started to tag untagged CSI volumes"
untagged_csi_volumes=$(aws --profile my-aws-profile --output json ec2 describe-volumes \
--query 'Volumes[?!not_null(Tags[?Key == `Environment`].Value)] | []')
for volume in $(echo "${untagged_csi_volumes}" | jq -r '.[] | @base64'); do
volume_id=$(echo "$volume" | base64 --decode | jq -r '.VolumeId')
@eladtamary
eladtamary / Dockerfile
Created December 22, 2018 21:18
Adding pgAudit to the official PostgreSQL docker image
FROM postgres:9.6.8
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
ca-certificates \
build-essential \
postgresql-server-dev-${PG_MAJOR} \
libssl-dev \
libkrb5-dev
RUN mkdir -p /tmp/pgaudit && cd /tmp/pgaudit && curl -L https://github.com/pgaudit/pgaudit/archive/1.1.1.tar.gz | tar xz --strip 1