https://pulumi.com logo
#golang
Title
# golang
v

victorious-architect-78054

10/02/2023, 7:46 AM
Hello, noob question here, why this is working
Copy code
// Create a kubernetes cluster
devEksCluster, err := eks.NewCluster(ctx, "rh-eks-dev", &eks.ClusterArgs{
    VpcId:              eksVpcId,
    Fargate:            pulumi.Bool(true),
    CreateOidcProvider: pulumi.Bool(true),
    // Public subnets will be used for load balancers
    PublicSubnetIds: pulumi.StringArrayInput(pulumi.StringArray{publicSubnetId1, publicSubnetId2, publicSubnetId3}),
    // Private subnets will be used for cluster nodes
    PrivateSubnetIds: pulumi.StringArrayInput(pulumi.StringArray{privateSubnetId1, privateSubnetId2, privateSubnetId3}),
})

if err != nil {
    return err
}

eksClusterName := devEksCluster.EksCluster.Name()
ctx.Export("eksClusterName", eksClusterName)
ctx.Export("kubeconfig", devEksCluster.Kubeconfig)
eksProvider, err := kubernetes.NewProvider(ctx, "eks-provider", &kubernetes.ProviderArgs{
    Kubeconfig: devEksCluster.KubeconfigJson,
})
and this not
Copy code
// Create a kubernetes cluster
devEksCluster, err := eks.NewCluster(ctx, "rh-eks-dev", &eks.ClusterArgs{
    VpcId:              eksVpcId,
    Fargate:            pulumi.Bool(true),
    CreateOidcProvider: pulumi.Bool(true),
    // Public subnets will be used for load balancers
    PublicSubnetIds: pulumi.StringArrayInput(pulumi.StringArray{publicSubnetId1, publicSubnetId2, publicSubnetId3}),
    // Private subnets will be used for cluster nodes
    PrivateSubnetIds: pulumi.StringArrayInput(pulumi.StringArray{privateSubnetId1, privateSubnetId2, privateSubnetId3}),
})

if err != nil {
    return err
}
		clusterOidcProviderIssuer := devEksCluster.Core.OidcProvider().Url()
		eksClusterName := devEksCluster.EksCluster.Name()

		ctx.Export("eksClusterName", eksClusterName)
		ctx.Export("kubeconfig", devEksCluster.Kubeconfig)
		ctx.Export("clusterOidcProviderIssuer", clusterOidcProviderIssuer)

		eksProvider, err := kubernetes.NewProvider(ctx, "eks-provider", &kubernetes.ProviderArgs{
			Kubeconfig: devEksCluster.KubeconfigJson,
		})
why i'm getting this error
Copy code
waiting for RPCs: expected a kubernetes.Provider, got a resource of type kubernetes.Provider
finally I got a solution it's look like,
Copy code
"<http://github.com/pulumi/pulumi-eks/sdk/go/eks|github.com/pulumi/pulumi-eks/sdk/go/eks>"
"<http://github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes|github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes>"
should not be used together
4 Views