Skip to content

Instantly share code, notes, and snippets.

Created Sep 10, 2021
What would you like to do?
Create the `data` part of a kubernetes opaque secret from an ENV file
require "base64"
require "dotenv"
require "yaml"
if ARGV.empty?
puts "Usage: #{__FILE__} <env file>"
exit 1
file = ARGV[0]
env = Dotenv.parse(file)
puts { |key, value| [key, Base64.encode64(value).strip] }.to_h.to_yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment