From b2fd9d100a55a556abe89b6eb9e82602b275308b Mon Sep 17 00:00:00 2001 From: Shahab Dogar Date: Sat, 22 Nov 2025 23:20:15 +0500 Subject: [PATCH] feat: 1PasswordOperator | add to k8s operators stack --- k8s-operators/1password/index.ts | 48 ++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 k8s-operators/1password/index.ts diff --git a/k8s-operators/1password/index.ts b/k8s-operators/1password/index.ts new file mode 100644 index 0000000..a9e02ff --- /dev/null +++ b/k8s-operators/1password/index.ts @@ -0,0 +1,48 @@ +import * as fs from "fs"; +import * as path from "path"; +import { HelmProvider } from "@cdktf/provider-helm/lib/provider"; +import { Release } from "@cdktf/provider-helm/lib/release"; +import { Construct } from "constructs"; + +type OnePasswordOptions = { + provider: HelmProvider; + name: string; +}; + +export class OnePassword extends Construct { + constructor(scope: Construct, id: string, options: OnePasswordOptions) { + super(scope, id); + + const { provider } = options; + + new Release(this, "onepassword-operator", { + provider, + name: "onepassword-operator", + chart: "connect", + repository: "https://1password.github.io/connect-helm-charts/", + namespace: "1password", + createNamespace: true, + set: [ + { + name: "operator.create", + value: "true", + }, + ], + setSensitive: [ + { + name: "operator.token.value", + value: process.env.OP_CONNECT_TOKEN!, + }, + { + name: "connect.credentials_base64", + value: btoa( + fs.readFileSync( + path.join(__dirname, "1password-credentials.json"), + "utf-8", + ), + ), + }, + ], + }); + } +}