https://pulumi.com logo
#kubernetes
Title
# kubernetes
p

purple-plumber-90981

05/06/2021, 5:31 AM
what is the right way to write an inline k8s config file yaml ? in
<https://www.pulumi.com/docs/reference/pkg/kubernetes/yaml/configfile/>
it describes the option of
Using a literal string containing YAML, or a list of such strings:
and i was expecting a k8s.ConfigFile(“myconfig”, config=“”"<inline yaml>“”") but cant see anything like that, only
file=
ok i tried it as a ConfigGroup (which does have an inline yaml arg) like so :-
Copy code
crossplane_provider = k8s.ConfigGroup("aws-controller-provider",
        yaml=f'''
apiVersion: <http://pkg.crossplane.io/v1alpha1|pkg.crossplane.io/v1alpha1>
kind: ControllerConfig
metadata:
  name: aws-config
  annotations:
    <http://eks.amazonaws.com/role-arn|eks.amazonaws.com/role-arn>: arn:aws:iam::{itplat_defaults.current_account_id}:role/provider-aws
spec:
  podSecurityContext:
    fsGroup: 2000
---
apiVersion: <http://pkg.crossplane.io/v1|pkg.crossplane.io/v1>
kind: Provider
metadata:
  name: provider-aws
spec:
  package: crossplane/provider-aws:alpha
  controllerConfigRef:
    name: aws-config
        ''')
but that barfed with :-
Copy code
Exception: invoke of kubernetes:yaml:decode failed: invocation of kubernetes:yaml:decode returned an error: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal string into Go value of type map[string]interface {}
    error: an unhandled error occurred: Program exited with non-zero exit code: 1
ok i have it, the yaml= has to be a sequence, though doc reads like it can be a string or a sequence
it only works like yaml=[‘’'<my_yaml’’']
31 Views