Skip to content

Instantly share code, notes, and snippets.

@jmlrt
jmlrt / manage-es-token.js
Last active November 9, 2022 16:55
Node JS script to create an Elasticsearch token for Kibana and register it as a K8S secret
const https = require('https');
const fs = require('fs');
// Read environment variables
function getEnvVar(name) {
if (name in process.env) {
return process.env[name]
} else {
throw new Error(name + ' environment variable is missing')
}