Does anybody know how I can update the `default` ...
# kubernetes
c
Does anybody know how I can update the
default
namespace with labels and annotations using Pulumi? When I'm using https://www.pulumi.com/registry/packages/kubernetes/api-docs/yaml/configfile/ I'm getting the following error:
Copy code
error: update failed

  kubernetes:core/v1:Namespace (default):
    error: resource default was not successfully created by the Kubernetes API server : namespaces "default" already exists
p
i think you will need to adopt your pre-existing "default" namespace into pulumi first
<https://www.pulumi.com/docs/guides/adopting/import/>
then once that resource exists in your pulumi stack you will be able to modify it
c
ah, so an
import
like Terraform, makes sense
p
im presuming you dont create your cluster with pulumi initially ?
something like this python pseudocode :
Copy code
default_namespace = k8s.core.v1.Namespace("default", opts=pulumi.ResourceOptions(provider=k8s_provider), metadata=k8s.meta.v1.ObjectMetaArgs(name="default"),import_='default')
or you can just do the same via cli then on your pulumi up you can add your metadata . . . depends on your orchestration needs
c
thanks!