Skip to content

Instantly share code, notes, and snippets.

@dpkirchner
dpkirchner / gist:42f97f6d6df57fc552009743944fe779
Created June 25, 2021 19:27
execProviderConfig example
{
"execProviderConfig": {
"apiVersion": "client.authentication.k8s.io/v1beta1",
"args": [
"-c",
"import urllib.request, json, datetime; obj = json.loads(urllib.request.urlopen(urllib.request.Request(\"http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token\", headers={\"Metadata-Flavor\":\"Google\"})).read()); delta = datetime.timedelta(seconds=int(obj[\"expires_in\"])); out = {\"apiVersion\":\"client.authentication.k8s.io/v1beta1\",\"kind\":\"ExecCredential\",\"status\":{\"token\":obj[\"access_token\"],\"expirationTimestamp\":(delta + datetime.datetime.utcnow()).strftime(\"%Y-%m-%dT%H:%M:%SZ\")}}; print(json.dumps(out))"
],
"command": "/usr/bin/python3"
},
"tlsClientConfig": {
const dgraph = require('dgraph-js');
const clientStubs = [
new dgraph.DgraphClientStub('127.0.0.1:9080'),
];
const client = new dgraph.DgraphClient(...clientStubs);
const cleanup = async () => {
const txn = client.newTxn();
2021-08-20T15:58:28.856-0700 [DEBUG] provider.terraform-provider-kubernetes: POST /api/v1/namespaces/default/persistentvolumeclaims HTTP/1.1
2021-08-20T15:58:28.856-0700 [DEBUG] provider.terraform-provider-kubernetes: Host: 35.x.y.z
2021-08-20T15:58:28.856-0700 [DEBUG] provider.terraform-provider-kubernetes: User-Agent: HashiCorp/1.0 Terraform/1.0.5
2021-08-20T15:58:28.856-0700 [DEBUG] provider.terraform-provider-kubernetes: Content-Length: 274
2021-08-20T15:58:28.856-0700 [DEBUG] provider.terraform-provider-kubernetes: Accept: application/json, */*
2021-08-20T15:58:28.856-0700 [DEBUG] provider.terraform-provider-kubernetes: Authorization: Bearer XYZ
2021-08-20T15:58:28.856-0700 [DEBUG] provider.terraform-provider-kubernetes: Content-Type: application/json
2021-08-20T15:58:28.856-0700 [DEBUG] provider.terraform-provider-kubernetes: Accept-Encoding: gzip
2021-08-20T15:58:28.856-0700 [DEBUG] provider.terraform-provider-kubernetes:
2021-08-20T15:58:28.856-0700 [DEBUG] provider.terraform-provider-kubernetes: {
type: object
properties:
type:
type: string
default: a