Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws java eks example fails #1280

Closed
nagkumar opened this issue Sep 13, 2022 · 2 comments
Closed

aws java eks example fails #1280

nagkumar opened this issue Sep 13, 2022 · 2 comments
Assignees
Labels
area/examples kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed

Comments

@nagkumar
Copy link

nagkumar commented Sep 13, 2022

What happened?

pulumi:pulumi:Stack (eks-dev):
warning: aws:ec2/getSubnetIds:getSubnetIds verification warning: The aws_subnet_ids data source has been deprecated and will be removed in a future version. Use the aws_subnets data source instead.
error: update failed
error: Running program PID: 14548 failed with an unhandled exception:
io.grpc.StatusRuntimeException: UNAVAILABLE: error reading from server: read tcp 127.0.0.1:50869->127.0.0.1:50868: use of closed network connection
at io.grpc.Status.asRuntimeException(Status.java:535)
at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:533)
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:553)
at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:68)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:739)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:718)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)

aws:eks:Cluster (my-cluster-eksCluster):
error: 1 error occurred:
* error creating EKS Cluster (my-cluster-eksCluster-a70c5ba): InvalidParameterException: Subnets specified must be in at least two different AZs
{
RespMetadata: {
StatusCode: 400,
RequestID: "f884d926-564b-4cb2-ab80-0f7ffb4e1b6a"
},
ClusterName: "my-cluster-eksCluster-a70c5ba",
Message_: "Subnets specified must be in at least two different AZs"
}

Resources:
+ 15 created

Duration: 34s

Steps to reproduce

run this example https://github.com/pulumi/examples/tree/master/aws-java-eks-minimal with pulumi update

Expected Behavior

It should create aws cluster

Actual Behavior

Gives errors

Output of pulumi about

G:\DWork\osource\cloudc\devops\pulumi\java\aws\eks>pulumi about
CLI
Version 3.39.3
Go Version go1.19.1
Go Compiler gc

Plugins
NAME VERSION
aws 5.11.0
eks 0.37.1
java unknown
kubernetes 3.20.5

Host
OS Microsoft Windows 10 Pro
Version 10.0.19045 Build 19045
Arch x86_64

This project is written in java: executable='d:\Apps\Dev\langs\java\jdk\17.x\bin\java.exe' version='java 17.0.2 2022-01-18 LTS
Java(TM) SE Runtime Environment (build 17.0.2+8-LTS-86)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.2+8-LTS-86, mixed mode, sharing)' java='d:\Apps\Dev\langs\java\jdk\17.x\bin\java.exe' javac='17.0.2'

Current Stack: dev

TYPE URN
pulumi:providers:aws urn:pulumi:dev::eks::pulumi:providers:aws::default_5_11_0
pulumi:pulumi:Stack urn:pulumi:dev::eks::pulumi:pulumi:Stack::eks-dev
pulumi:providers:eks urn:pulumi:dev::eks::pulumi:providers:eks::default_0_37_1
eks:index:Cluster urn:pulumi:dev::eks::eks:index:Cluster::my-cluster
pulumi:providers:aws urn:pulumi:dev::eks::pulumi:providers:aws::default_4_38_1
eks:index:ServiceRole urn:pulumi:dev::eks::eks:index:Cluster$eks:index:ServiceRole::my-cluster-instanceRole
eks:index:ServiceRole urn:pulumi:dev::eks::eks:index:Cluster$eks:index:ServiceRole::my-cluster-eksRole
pulumi:providers:eks urn:pulumi:dev::eks::pulumi:providers:eks::default
eks:index:RandomSuffix urn:pulumi:dev::eks::eks:index:Cluster$eks:index:RandomSuffix::my-cluster-cfnStackName
aws:ec2/securityGroup:SecurityGroup urn:pulumi:dev::eks::eks:index:Cluster$aws:ec2/securityGroup:SecurityGroup::my-cluster-eksClusterSecurityGroup
aws:ec2/securityGroupRule:SecurityGroupRule urn:pulumi:dev::eks::eks:index:Cluster$aws:ec2/securityGroupRule:SecurityGroupRule::my-cluster-eksClusterInternetEgressRule
aws:iam/role:Role urn:pulumi:dev::eks::eks:index:Cluster$eks:index:ServiceRole$aws:iam/role:Role::my-cluster-instanceRole-role
aws:iam/role:Role urn:pulumi:dev::eks::eks:index:Cluster$eks:index:ServiceRole$aws:iam/role:Role::my-cluster-eksRole-role
aws:iam/rolePolicyAttachment:RolePolicyAttachment urn:pulumi:dev::eks::eks:index:Cluster$eks:index:ServiceRole$aws:iam/rolePolicyAttachment:RolePolicyAttachment::my-cluster-instanceRole-e1b295bd
aws:iam/rolePolicyAttachment:RolePolicyAttachment urn:pulumi:dev::eks::eks:index:Cluster$eks:index:ServiceRole$aws:iam/rolePolicyAttachment:RolePolicyAttachment::my-cluster-instanceRole-3eb088f2
aws:iam/rolePolicyAttachment:RolePolicyAttachment urn:pulumi:dev::eks::eks:index:Cluster$eks:index:ServiceRole$aws:iam/rolePolicyAttachment:RolePolicyAttachment::my-cluster-instanceRole-03516f97
aws:iam/rolePolicyAttachment:RolePolicyAttachment urn:pulumi:dev::eks::eks:index:Cluster$eks:index:ServiceRole$aws:iam/rolePolicyAttachment:RolePolicyAttachment::my-cluster-eksRole-90eb1c99
aws:iam/rolePolicyAttachment:RolePolicyAttachment urn:pulumi:dev::eks::eks:index:Cluster$eks:index:ServiceRole$aws:iam/rolePolicyAttachment:RolePolicyAttachment::my-cluster-eksRole-4b490823
aws:iam/instanceProfile:InstanceProfile urn:pulumi:dev::eks::eks:index:Cluster$aws:iam/instanceProfile:InstanceProfile::my-cluster-instanceProfile

Found no pending operations associated with dev

Backend
Name pulumi.com
URL https://app.pulumi.com/nagkumar
User nagkumar
Organizations nagkumar, tejasoft

No dependencies found

Pulumi locates its logs in C:\Users\RAJANA~1\AppData\Local\Temp 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).

@nagkumar nagkumar added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Sep 13, 2022
@dixler dixler added area/examples and removed needs-triage Needs attention from the triage team labels Sep 13, 2022
@t0yv0 t0yv0 added this to the 0.78 milestone Sep 13, 2022
@t0yv0
Copy link
Member

t0yv0 commented Sep 13, 2022

Thank you for reporting the failure of this example! I've dug a little deeper and there are a few underlying issues in Pulumi that our team started addressing.

  1. com.pulumi:pulumi 0.6.0 was just released and should shortly arrive at Maven Central (https://search.maven.org/artifact/com.pulumi/pulumi) though as of the writing of this it has not propagated yet; it contains an important bugfix to make the example pass preview

  2. There is a warning due to the example using a deprecated API. I got past the warning in Fix aws-java-eks-minimal example #1281

warning: aws:ec2/getSubnetIds:getSubnetIds verification warning: The aws_subnet_ids data source has been deprecated and will be removed in a future version. Use the aws_subnets data source instead.
  1. There is a problem with the example assuming 2+ subnets in default VPC in different AZs. I've tried to work around this but a bit further work is needed to make sure the example provisions its own subnets instead of trying to find them in the user environment

  2. Even with the workaround I currently get blocked on Please release 0.4.x series to Maven Central pulumi-eks#778 - it looks like a new release of com.pulumi:eks is needed at least at version 0.4.0 to be compatible with recent kubectl and aws cli versions

I'd like to return to fixing this example once it is unblocked via pulumi/pulumi-eks#778

@lukehoban lukehoban modified the milestones: 0.78, 0.79 Oct 6, 2022
@mikhailshilkov mikhailshilkov removed this from the 0.79 milestone Oct 25, 2022
@t0yv0
Copy link
Member

t0yv0 commented Jan 29, 2025

Previewing update (test-aws-java-eks-minimal-2)

View in Browser (Ctrl+O): https://app.pulumi.com/anton-pulumi-corp/eks-minimal/test-aws-java-eks-minimal-2/previews/649fbcc9-e244-4965-a565-b5293d3d4b4c

     Type                                   Name                                          Plan       
 +   pulumi:pulumi:Stack                    eks-minimal-test-aws-java-eks-minimal-2       create     
 +   └─ eks:index:Cluster                   my-cluster                                    create     
 +      ├─ eks:index:ServiceRole            my-cluster-eksRole                            create     
 +      │  ├─ aws:iam:Role                  my-cluster-eksRole-role                       create     
 +      │  └─ aws:iam:RolePolicyAttachment  my-cluster-eksRole-4b490823                   create     
 +      ├─ aws:ec2:SecurityGroupRule        my-cluster-eksClusterInternetEgressRule       create     
 +      ├─ aws:ec2:SecurityGroup            my-cluster-eksClusterSecurityGroup            create     
 +      ├─ eks:index:ServiceRole            my-cluster-instanceRole                       create     
 +      │  ├─ aws:iam:Role                  my-cluster-instanceRole-role                  create     
 +      │  ├─ aws:iam:RolePolicyAttachment  my-cluster-instanceRole-3eb088f2              create     
 +      │  ├─ aws:iam:RolePolicyAttachment  my-cluster-instanceRole-e1b295bd              create     
 +      │  └─ aws:iam:RolePolicyAttachment  my-cluster-instanceRole-03516f97              create     
 +      ├─ aws:eks:Cluster                  my-cluster-eksCluster                         create     
 +      ├─ aws:iam:InstanceProfile          my-cluster-instanceProfile                    create     
 +      ├─ aws:eks:Addon                    my-cluster-coredns                            create     
 +      ├─ pulumi:providers:kubernetes      my-cluster-eks-k8s                            create     
 +      ├─ aws:eks:Addon                    my-cluster-kube-proxy                         create     
 +      ├─ kubernetes:core/v1:ConfigMap     my-cluster-nodeAccess                         create     
 +      ├─ aws:ec2:SecurityGroupRule        my-cluster-eksExtApiServerClusterIngressRule  create     
 +      ├─ aws:eks:AccessEntry              my-cluster-defaultNodeGroupInstanceRole       create     
 +      ├─ aws:ec2:SecurityGroup            my-cluster-nodeSecurityGroup                  create     
 +      ├─ aws:ec2:SecurityGroupRule        my-cluster-eksNodeIngressRule                 create     
 +      ├─ eks:index:VpcCniAddon            my-cluster-vpc-cni                            create     
 +      │  └─ aws:eks:Addon                 my-cluster-vpc-cni                            create     
 +      ├─ aws:ec2:SecurityGroupRule        my-cluster-eksClusterIngressRule              create     
 +      ├─ aws:autoscaling:Group            my-cluster                                    create     
 +      ├─ aws:ec2:LaunchTemplate           my-cluster-launchTemplate                     create     
 +      ├─ aws:ec2:SecurityGroupRule        my-cluster-eksNodeClusterIngressRule          create     
 +      └─ aws:ec2:SecurityGroupRule        my-cluster-eksNodeInternetEgressRule          create     

Outputs:
    kubeconfig     : output<string>
    subnetIdsOutput: "subnet-43f43a1e,subnet-c7d926bf"
    vpcIdOutput    : "vpc-4b82e033"

Resources:
    + 29 to create

Apologies for following up late, but the example should work now.

@t0yv0 t0yv0 added the resolution/fixed This issue was fixed label Jan 29, 2025
@t0yv0 t0yv0 closed this as completed Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/examples kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Projects
None yet
Development

No branches or pull requests

5 participants