sparse-intern-71089
12/01/2022, 4:31 PMworried-rain-74420
12/01/2022, 5:37 PMInterpolate
is the function you probably want.worried-rain-74420
12/01/2022, 5:37 PMcalm-iron-40008
12/01/2022, 5:56 PMnew k8s.yaml.ConfigFile(…
and its associated parameters. it seems Pulumi drops into an isolated virtual terminal session using my local kubectl
executable and its current ‘kube’ context.
The YAML that is executed, is executed as a raw YAML file. The Pulumi TypeScript environment, variables, and declarations (e.g. interpolation, dependsOn, etc) don’t seem to be valid in the ConfigFile
and ConfigGroup
custom resource…
I can write an edit for each of the cluster deployments, but that means I still need to revisit the source YAML files to ensure that I maintain operational version integrity.. I’d like to do this in a single step, even if it is initially more difficult.
Does that make any sense?worried-rain-74420
12/01/2022, 6:14 PMBy default, Pulumi will use a local kubeconfig if available, or one can be passed as a provider argument in the request.
With theFrom https://www.pulumi.com/registry/packages/kubernetes/installation-configuration/ So if you don't want to use kubectl, you can pass in a Kubernetesavailable, Pulumi communicates with the API Server using the official Kubernetes client-go library, just likekubeconfig
does.kubectl
provider
as a resource option and the HTTP API will be used instead.
IIRC ConfigFile is for raw YAML, and you can create instances of Deployment
, Service
, etc. if you need dynamic values.
If you really need to use ConfigFile with dynamic values, you can get a little crazy: in TypeScript, you can read in your YAML, parse it, template in your values, and write it out to disk again in a temporary file. Then, point your ConfigFile
resource to the temp file.worried-rain-74420
12/01/2022, 6:14 PMcalm-iron-40008
12/01/2022, 7:41 PMPulumi up
will revert… Now, granted… One should never do an up on a PROD environment… BUT. elimination of potential is also a goal…calm-iron-40008
12/01/2022, 7:49 PM// services
const Services = new k8s.yaml.ConfigGroup("platform-service", {
files: [ path.join("../common/yaml", "svc-*.yaml") ],
},{dependsOn: my_SecretCreds}
);
It doesn’t even honor the dependsOn
clause.
I’m just a lowly DevOps guy, trying to get our group’s code running polycloud. I’m just hoping for an undocumented feature or a workaround.
Should I just pull this out into its own project:stack and do it as YAML? The goal is to be portable across AWS, GCS, and DigitalOcean… where the client base is, essentially.