pulumi / pulumi-kubernetes

A Pulumi resource provider for Kubernetes to manage API resources and workloads in running clusters
https://www.pulumi.com/docs/reference/clouds/kubernetes/
Apache License 2.0
407 stars 117 forks source link

Get and Import are not documented #2835

Open jkodroff opened 8 months ago

jkodroff commented 8 months ago

What happened?

The static get() function and import syntax are not documented. This makes it tricky for a new user to figure out a relatively simple use case like using k8s.yaml.ConfigFile to create a Service and then grabbing the url from the LoadBalancer.

Example

https://www.pulumi.com/registry/packages/kubernetes/api-docs/core/v1/service/

Output of pulumi about

CLI          
Version      3.105.0
Go Version   go1.21.6
Go Compiler  gc

Plugins
NAME        VERSION
aws         6.22.2
awsx        2.5.0
docker      4.5.1
docker      3.6.1
eks         2.2.1
kubernetes  4.7.1
nodejs      unknown

Host     
OS       darwin
Version  14.3.1
Arch     arm64

This project is written in nodejs: executable='/opt/homebrew/bin/node' version='v21.2.0'

Current Stack: jkodrofftest/k8s-modules-scratchpad/dev

TYPE                                                 URN
pulumi:pulumi:Stack                                  urn:pulumi:dev::k8s-modules-scratchpad::pulumi:pulumi:Stack::k8s-modules-scratchpad-dev
eks:index:Cluster                                    urn:pulumi:dev::k8s-modules-scratchpad::eks:index:Cluster::eks-cluster
pulumi:providers:aws                                 urn:pulumi:dev::k8s-modules-scratchpad::pulumi:providers:aws::default_6_22_2
eks:index:ServiceRole                                urn:pulumi:dev::k8s-modules-scratchpad::eks:index:Cluster$eks:index:ServiceRole::eks-cluster-instanceRole
eks:index:ServiceRole                                urn:pulumi:dev::k8s-modules-scratchpad::eks:index:Cluster$eks:index:ServiceRole::eks-cluster-eksRole
pulumi:providers:awsx                                urn:pulumi:dev::k8s-modules-scratchpad::pulumi:providers:awsx::default_2_5_0
awsx:ec2:Vpc                                         urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc::eks-vpc
pulumi:providers:eks                                 urn:pulumi:dev::k8s-modules-scratchpad::pulumi:providers:eks::default
eks:index:RandomSuffix                               urn:pulumi:dev::k8s-modules-scratchpad::eks:index:Cluster$eks:index:RandomSuffix::eks-cluster-cfnStackName
aws:iam/role:Role                                    urn:pulumi:dev::k8s-modules-scratchpad::eks:index:Cluster$eks:index:ServiceRole$aws:iam/role:Role::eks-cluster-eksRole-role
pulumi:providers:aws                                 urn:pulumi:dev::k8s-modules-scratchpad::pulumi:providers:aws::default_6_9_0
aws:iam/role:Role                                    urn:pulumi:dev::k8s-modules-scratchpad::eks:index:Cluster$eks:index:ServiceRole$aws:iam/role:Role::eks-cluster-instanceRole-role
aws:iam/rolePolicyAttachment:RolePolicyAttachment    urn:pulumi:dev::k8s-modules-scratchpad::eks:index:Cluster$eks:index:ServiceRole$aws:iam/rolePolicyAttachment:RolePolicyAttachment::eks-cluster-eksRole-4b490823
aws:iam/rolePolicyAttachment:RolePolicyAttachment    urn:pulumi:dev::k8s-modules-scratchpad::eks:index:Cluster$eks:index:ServiceRole$aws:iam/rolePolicyAttachment:RolePolicyAttachment::eks-cluster-instanceRole-3eb088f2
aws:iam/rolePolicyAttachment:RolePolicyAttachment    urn:pulumi:dev::k8s-modules-scratchpad::eks:index:Cluster$eks:index:ServiceRole$aws:iam/rolePolicyAttachment:RolePolicyAttachment::eks-cluster-instanceRole-e1b295bd
aws:iam/rolePolicyAttachment:RolePolicyAttachment    urn:pulumi:dev::k8s-modules-scratchpad::eks:index:Cluster$eks:index:ServiceRole$aws:iam/rolePolicyAttachment:RolePolicyAttachment::eks-cluster-instanceRole-03516f97
aws:ec2/vpc:Vpc                                      urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc::eks-vpc
aws:iam/instanceProfile:InstanceProfile              urn:pulumi:dev::k8s-modules-scratchpad::eks:index:Cluster$aws:iam/instanceProfile:InstanceProfile::eks-cluster-instanceProfile
aws:ec2/subnet:Subnet                                urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet::eks-vpc-public-2
aws:ec2/subnet:Subnet                                urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet::eks-vpc-private-2
aws:ec2/subnet:Subnet                                urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet::eks-vpc-private-1
aws:ec2/subnet:Subnet                                urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet::eks-vpc-public-1
aws:ec2/internetGateway:InternetGateway              urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/internetGateway:InternetGateway::eks-vpc
aws:ec2/subnet:Subnet                                urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet::eks-vpc-private-3
aws:ec2/subnet:Subnet                                urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet::eks-vpc-public-3
aws:ec2/routeTable:RouteTable                        urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet$aws:ec2/routeTable:RouteTable::eks-vpc-public-2
aws:ec2/eip:Eip                                      urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet$aws:ec2/eip:Eip::eks-vpc-2
aws:ec2/routeTable:RouteTable                        urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet$aws:ec2/routeTable:RouteTable::eks-vpc-private-2
aws:ec2/routeTable:RouteTable                        urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet$aws:ec2/routeTable:RouteTable::eks-vpc-private-1
aws:ec2/routeTable:RouteTable                        urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet$aws:ec2/routeTable:RouteTable::eks-vpc-public-1
aws:ec2/eip:Eip                                      urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet$aws:ec2/eip:Eip::eks-vpc-1
aws:ec2/routeTable:RouteTable                        urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet$aws:ec2/routeTable:RouteTable::eks-vpc-private-3
aws:ec2/eip:Eip                                      urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet$aws:ec2/eip:Eip::eks-vpc-3
aws:ec2/routeTable:RouteTable                        urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet$aws:ec2/routeTable:RouteTable::eks-vpc-public-3
aws:ec2/routeTableAssociation:RouteTableAssociation  urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet$aws:ec2/routeTable:RouteTable$aws:ec2/routeTableAssociation:RouteTableAssociation::eks-vpc-public-2
aws:ec2/route:Route                                  urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet$aws:ec2/routeTable:RouteTable$aws:ec2/route:Route::eks-vpc-public-2
aws:ec2/natGateway:NatGateway                        urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet$aws:ec2/natGateway:NatGateway::eks-vpc-2
aws:ec2/routeTableAssociation:RouteTableAssociation  urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet$aws:ec2/routeTable:RouteTable$aws:ec2/routeTableAssociation:RouteTableAssociation::eks-vpc-private-2
aws:ec2/routeTableAssociation:RouteTableAssociation  urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet$aws:ec2/routeTable:RouteTable$aws:ec2/routeTableAssociation:RouteTableAssociation::eks-vpc-private-1
aws:ec2/routeTableAssociation:RouteTableAssociation  urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet$aws:ec2/routeTable:RouteTable$aws:ec2/routeTableAssociation:RouteTableAssociation::eks-vpc-public-1
aws:ec2/route:Route                                  urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet$aws:ec2/routeTable:RouteTable$aws:ec2/route:Route::eks-vpc-public-1
aws:ec2/natGateway:NatGateway                        urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet$aws:ec2/natGateway:NatGateway::eks-vpc-1
aws:ec2/routeTableAssociation:RouteTableAssociation  urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet$aws:ec2/routeTable:RouteTable$aws:ec2/routeTableAssociation:RouteTableAssociation::eks-vpc-private-3
aws:ec2/natGateway:NatGateway                        urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet$aws:ec2/natGateway:NatGateway::eks-vpc-3
aws:ec2/routeTableAssociation:RouteTableAssociation  urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet$aws:ec2/routeTable:RouteTable$aws:ec2/routeTableAssociation:RouteTableAssociation::eks-vpc-public-3
aws:ec2/route:Route                                  urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet$aws:ec2/routeTable:RouteTable$aws:ec2/route:Route::eks-vpc-public-3
aws:ec2/route:Route                                  urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet$aws:ec2/routeTable:RouteTable$aws:ec2/route:Route::eks-vpc-private-2
aws:ec2/route:Route                                  urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet$aws:ec2/routeTable:RouteTable$aws:ec2/route:Route::eks-vpc-private-1
aws:ec2/route:Route                                  urn:pulumi:dev::k8s-modules-scratchpad::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet$aws:ec2/routeTable:RouteTable$aws:ec2/route:Route::eks-vpc-private-3
pulumi:providers:pulumi                              urn:pulumi:dev::k8s-modules-scratchpad::pulumi:providers:pulumi::default
aws:ec2/securityGroup:SecurityGroup                  urn:pulumi:dev::k8s-modules-scratchpad::eks:index:Cluster$aws:ec2/securityGroup:SecurityGroup::eks-cluster-eksClusterSecurityGroup
aws:ec2/securityGroupRule:SecurityGroupRule          urn:pulumi:dev::k8s-modules-scratchpad::eks:index:Cluster$aws:ec2/securityGroupRule:SecurityGroupRule::eks-cluster-eksClusterInternetEgressRule
aws:eks/cluster:Cluster                              urn:pulumi:dev::k8s-modules-scratchpad::eks:index:Cluster$aws:eks/cluster:Cluster::eks-cluster-eksCluster
aws:ec2/securityGroup:SecurityGroup                  urn:pulumi:dev::k8s-modules-scratchpad::eks:index:Cluster$aws:ec2/securityGroup:SecurityGroup::eks-cluster-nodeSecurityGroup
aws:ec2/securityGroupRule:SecurityGroupRule          urn:pulumi:dev::k8s-modules-scratchpad::eks:index:Cluster$aws:ec2/securityGroupRule:SecurityGroupRule::eks-cluster-eksExtApiServerClusterIngressRule
aws:ec2/securityGroupRule:SecurityGroupRule          urn:pulumi:dev::k8s-modules-scratchpad::eks:index:Cluster$aws:ec2/securityGroupRule:SecurityGroupRule::eks-cluster-eksNodeIngressRule
aws:ec2/securityGroupRule:SecurityGroupRule          urn:pulumi:dev::k8s-modules-scratchpad::eks:index:Cluster$aws:ec2/securityGroupRule:SecurityGroupRule::eks-cluster-eksNodeClusterIngressRule
aws:ec2/securityGroupRule:SecurityGroupRule          urn:pulumi:dev::k8s-modules-scratchpad::eks:index:Cluster$aws:ec2/securityGroupRule:SecurityGroupRule::eks-cluster-eksClusterIngressRule
aws:ec2/securityGroupRule:SecurityGroupRule          urn:pulumi:dev::k8s-modules-scratchpad::eks:index:Cluster$aws:ec2/securityGroupRule:SecurityGroupRule::eks-cluster-eksNodeInternetEgressRule
pulumi:providers:kubernetes                          urn:pulumi:dev::k8s-modules-scratchpad::eks:index:Cluster$pulumi:providers:kubernetes::eks-cluster-eks-k8s
eks:index:VpcCni                                     urn:pulumi:dev::k8s-modules-scratchpad::eks:index:Cluster$eks:index:VpcCni::eks-cluster-vpc-cni
kubernetes:core/v1:ConfigMap                         urn:pulumi:dev::k8s-modules-scratchpad::eks:index:Cluster$kubernetes:core/v1:ConfigMap::eks-cluster-nodeAccess
aws:ec2/launchConfiguration:LaunchConfiguration      urn:pulumi:dev::k8s-modules-scratchpad::eks:index:Cluster$aws:ec2/launchConfiguration:LaunchConfiguration::eks-cluster-nodeLaunchConfiguration
aws:cloudformation/stack:Stack                       urn:pulumi:dev::k8s-modules-scratchpad::eks:index:Cluster$aws:cloudformation/stack:Stack::eks-cluster-nodes
pulumi:providers:kubernetes                          urn:pulumi:dev::k8s-modules-scratchpad::eks:index:Cluster$pulumi:providers:kubernetes::eks-cluster-provider
pulumi:providers:kubernetes                          urn:pulumi:dev::k8s-modules-scratchpad::pulumi:providers:kubernetes::k8s-provider
kubernetes:yaml:ConfigFile                           urn:pulumi:dev::k8s-modules-scratchpad::kubernetes:yaml:ConfigFile::configfile--config-file
kubernetes:apps/v1:Deployment                        urn:pulumi:dev::k8s-modules-scratchpad::kubernetes:yaml:ConfigFile$kubernetes:apps/v1:Deployment::configfile--nginx-deployment
kubernetes:core/v1:Service                           urn:pulumi:dev::k8s-modules-scratchpad::kubernetes:yaml:ConfigFile$kubernetes:core/v1:Service::configfile--nginx-service

Found no pending operations associated with dev

Backend        
Name           pulumi.com
URL            https://app.pulumi.com/josh-pulumi-corp
User           josh-pulumi-corp
Organizations  josh-pulumi-corp, pulumi-gitlab-demo2, jkodrofftest, policy-as-code-on-aws-20240214, zephyr, pulumi
Token type     personal

Dependencies:
NAME                VERSION
@pulumi/eks         2.2.1
@pulumi/kubernetes  4.7.1
@pulumi/pulumi      3.106.0
@types/node         18.19.17
typescript          4.9.5
@pulumi/awsx        2.5.0

Pulumi locates its logs in /var/folders/5m/4n1x3f8151s35wc80w06z5k80000gn/T/ by default

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

jkodroff commented 8 months ago

Not clear to me whether #1390 is talking about the same thing. If so, prefer the way this issue is worded as it'll be more apparent to a user what the actual issue is, rather than the technical solution.