https://pulumi.com logo
#general
Title
# general
h

helpful-baker-3769

08/16/2023, 2:38 AM
hello, I'm using pulumi kubernetes operator, how do I access value of a secret in
Program
CR? I have this in my `Stack`:
Copy code
---
apiVersion: <http://pulumi.com/v1|pulumi.com/v1>
kind: Stack
metadata:
  name: github
spec:
  stack: budimanjojo/github
  programRef:
    name: github
  destroyOnFinalize: true
  envRefs:
    GITHUB_OWNER:
      type: Literal
      literal:
        value: budimanjojo
    GITHUB_TOKEN:
      type: Secret
      secret:
        name: github-secret
        key: GITHUB_TOKEN
    PULUMI_ACCESS_TOKEN:
      type: Secret
      secret:
        name: github-secret
        key: PULUMI_ACCESS_TOKEN
  secretsRef:
    test_secret:
      type: Secret
      secret:
        name: github-secret
        key: test_secret
in my
Program
, I want to access the
test_secret
but I got this error:
resource "test_secret" not found
. Here's the Program:
Copy code
---
apiVersion: <http://pulumi.com/v1|pulumi.com/v1>
kind: Program
metadata:
  name: github
program:
  resources:
    exampleVariable:
      type: github:ActionsSecret
      properties:
        repository: pulumi-testing
        secretName: test_secret
        encryptedValue: ${test_secret}
s

straight-fireman-55591

08/16/2023, 8:03 AM
There is pulumi operator? Good to know.
h

helpful-baker-3769

08/16/2023, 8:05 AM
yes there is, can't get it to work though 😞 Maybe it's better to use a fluxRepository or git repo as source because I can't get the
Program
CR to work
s

straight-fireman-55591

08/16/2023, 8:07 AM
can you give me eli5 of how it works? I assume it waits for stack resource in kubernetes and if you create one it will deploy/update whatever is there right ?
h

helpful-baker-3769

08/16/2023, 8:19 AM
https://github.com/pulumi/pulumi-kubernetes-operator it can create a stack for you or u can give it an existing stack and it will update whenever u update something in the project (I hope)
s

straight-fireman-55591

08/16/2023, 8:20 AM
cool
6 Views