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

Add ipMode field #2557

Open
wants to merge 5 commits into
base: v3-major-release
Choose a base branch
from
Open

Conversation

sheneska
Copy link
Contributor

@sheneska sheneska commented Jul 22, 2024

Description

Fixes #2471

In this test, we are leveraging skipIfNoLoadBalancersAvailable to ensure it only runs in environments that support Kubernetes LoadBalancer services. This is necessary because common local environments, such as kind and minikube, do not natively support LoadBalancer services without additional configuration or external cloud provider integrations.

Acceptance tests

  • Have you added an acceptance test for the functionality being added?
  • Have you run the acceptance tests on this branch?

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccXXX'

...
jaylon.mcshan@jaylon issue-testing % kubectl get svc test-lb -o yaml

apiVersion: v1
kind: Service
metadata:
  creationTimestamp: "2024-11-29T14:58:08Z"
  name: test-lb
  namespace: default
  resourceVersion: "57005"
  uid: d1894d2e-c6be-46b0-bfd5-76d39152c278
spec:
  allocateLoadBalancerNodePorts: true
  clusterIP: 10.96.43.23
  clusterIPs:
  - 10.96.43.23
  externalTrafficPolicy: Cluster
  internalTrafficPolicy: Cluster
  ipFamilies:
  - IPv4
  ipFamilyPolicy: SingleStack
  ports:
  - nodePort: 30142
    port: 80
    protocol: TCP
    targetPort: 80
  selector:
    app: test-app
  sessionAffinity: None
  type: LoadBalancer
status:
  loadBalancer:
    ingress:
    - ip: 192.168.1.100
      ipMode: VIP

Release Note

Release note for CHANGELOG:

...

References

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

@sheneska sheneska requested a review from a team as a code owner July 22, 2024 21:27
@sheneska sheneska marked this pull request as draft July 22, 2024 21:36
@BBBmau BBBmau added the blocked label Aug 14, 2024
@BBBmau BBBmau added this to the v2.23.0 milestone Aug 14, 2024
@BBBmau BBBmau modified the milestones: v2.33.0, v3.0.0 Aug 29, 2024
@JaylonmcShan03 JaylonmcShan03 force-pushed the add-loadbalancer-status-support branch from fb06733 to 27608ca Compare November 19, 2024 00:51
@JaylonmcShan03 JaylonmcShan03 changed the base branch from main to v3-major-release November 19, 2024 00:51
@github-actions github-actions bot added size/M and removed size/S labels Nov 20, 2024
@JaylonmcShan03 JaylonmcShan03 self-assigned this Nov 29, 2024
@github-actions github-actions bot added size/XL and removed size/M labels Dec 3, 2024
@JaylonmcShan03 JaylonmcShan03 marked this pull request as ready for review January 7, 2025 15:54
@JaylonmcShan03 JaylonmcShan03 requested a review from a team as a code owner January 7, 2025 15:54
Copy link
Contributor

@BBBmau BBBmau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks like it needs to be rebased. a field shouldn't have this big of a red diff.

@JaylonmcShan03 JaylonmcShan03 force-pushed the add-loadbalancer-status-support branch from 3c2eaee to 0641690 Compare January 9, 2025 02:06
@JaylonmcShan03 JaylonmcShan03 force-pushed the add-loadbalancer-status-support branch from 0641690 to 2df5186 Compare January 13, 2025 18:55
@github-actions github-actions bot added size/M and removed size/XL labels Jan 13, 2025
@BBBmau
Copy link
Contributor

BBBmau commented Jan 13, 2025

The golang linter error isn't related to this PR. just ran the GHA on v3-major-release branch and it's failing on that. We'll need to see why that is, potentially it could be resolved by having the v3-major-release branch be rebased onto main.

GHA: https://github.com/hashicorp/terraform-provider-kubernetes/actions/runs/12756331934/job/35554244472

cc: @JaylonmcShan03

@BBBmau
Copy link
Contributor

BBBmau commented Jan 13, 2025

Be sure to include a changelog-entry also

Copy link
Contributor

@BBBmau BBBmau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like we need to check the configuration a bit more to understand what's necessary. I set up a node pool in gke to test this and ran into a context-deadline. Looking at the logs it appears that it's in constant limbo with status being set to null:

  tf_http_res_body=
  | {"kind":"Service","apiVersion":"v1","metadata":{"name":"tf-acc-test-1509728476215865051","namespace":"default","uid":"28a0f40e-fe34-416f-a4e4-2b954d2aaa1e","resourceVersion":"43078","creationTimestamp":"2025-01-25T08:24:41Z","annotations":{"cloud.google.com/neg":"{\"ingress\":true}"},"finalizers":["service.kubernetes.io/load-balancer-cleanup"],"managedFields":[{"manager":"HashiCorp","operation":"Update","apiVersion":"v1","time":"2025-01-25T08:24:41Z","fieldsType":"FieldsV1","fieldsV1":{"f:spec":{"f:allocateLoadBalancerNodePorts":{},"f:externalTrafficPolicy":{},"f:internalTrafficPolicy":{},"f:ports":{".":{},"k:{\"port\":80,\"protocol\":\"TCP\"}":{".":{},"f:port":{},"f:protocol":{},"f:targetPort":{}}},"f:sessionAffinity":{},"f:type":{}}}},{"manager":"cloud-controller-manager","operation":"Update","apiVersion":"v1","time":"2025-01-25T08:24:41Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:finalizers":{".":{},"v:\"service.kubernetes.io/load-balancer-cleanup\"":{}}}},"subresource":"status"}]},"spec":{"ports":[{"protocol":"TCP","port":80,"targetPort":8080,"nodePort":32270}],"clusterIP":"34.118.229.5","clusterIPs":["34.118.229.5"],"type":"LoadBalancer","sessionAffinity":"None","externalTrafficPolicy":"Cluster","ipFamilies":["IPv4"],"ipFamilyPolicy":"SingleStack","allocateLoadBalancerNodePorts":true,"internalTrafficPolicy":"Cluster"},"status":{"loadBalancer":{}}}
   X-Kubernetes-Pf-Prioritylevel-Uid=7418f017-37b7-48b1-b8a7-b8a9f77074f5 Content-Type=application/json tf_http_op_type=response tf_http_res_version=HTTP/2.0 Content-Length=1386 Audit-Id=8704bc16-3d75-4f5f-a1a2-ba7c61e3a9e2 tf_http_trans_id=eb537360-8d14-c456-83ea-8121e872812c tf_http_res_status_reason="200 OK" X-Kubernetes-Pf-Flowschema-Uid=6a9e5560-b2fc-4d6e-a8eb-fd5f318cf508 Cache-Control="no-cache, private" tf_http_res_status_code=200 Date="Sat, 25 Jan 2025 08:33:21 GMT"
2025/01/25 00:33:21 [INFO] Received service status: v1.ServiceStatus{LoadBalancer:v1.LoadBalancerStatus{Ingress:[]v1.LoadBalancerIngress(nil)}, Conditions:[]v1.Condition(nil)}
2025-01-25T00:33:31.929-0800 [DEBUG] kubernetes.Kubernetes: Sending HTTP Request: new_logger_warning="This log was generated by a subsystem logger that wasn't created before being used. Use tflog.NewSubsystem to create this logger before it is used." tf_http_trans_id=a3e4b890-bd71-306e-1998-08d3f42252da tf_http_req_version=HTTP/1.1 tf_http_req_method=GET Accept-Encoding=gzip tf_http_req_body="" Host=35.202.66.46 tf_http_op_type=request Authorization="Bearer  <TOKEN>" tf_http_req_uri=/api/v1/namespaces/default/services/tf-acc-test-1509728476215865051 User-Agent="HashiCorp/1.0 Terraform/1.11.0-beta1" Accept="application/json, */*"
2025-01-25T00:33:32.005-0800 [DEBUG] kubernetes.Kubernetes: Received HTTP Response: new_logger_warning="This log was generated by a subsystem logger that wasn't created before being used. Use tflog.NewSubsystem to create this logger before it is used." tf_http_res_version=HTTP/2.0 tf_http_res_status_code=200 Content-Type=application/json tf_http_res_status_reason="200 OK" Cache-Control="no-cache, private" Date="Sat, 25 Jan 2025 08:33:32 GMT" X-Kubernetes-Pf-Flowschema-Uid=6a9e5560-b2fc-4d6e-a8eb-fd5f318cf508 Content-Length=1386
  tf_http_res_body=
  | {"kind":"Service","apiVersion":"v1","metadata":{"name":"tf-acc-test-1509728476215865051","namespace":"default","uid":"28a0f40e-fe34-416f-a4e4-2b954d2aaa1e","resourceVersion":"43078","creationTimestamp":"2025-01-25T08:24:41Z","annotations":{"cloud.google.com/neg":"{\"ingress\":true}"},"finalizers":["service.kubernetes.io/load-balancer-cleanup"],"managedFields":[{"manager":"HashiCorp","operation":"Update","apiVersion":"v1","time":"2025-01-25T08:24:41Z","fieldsType":"FieldsV1","fieldsV1":{"f:spec":{"f:allocateLoadBalancerNodePorts":{},"f:externalTrafficPolicy":{},"f:internalTrafficPolicy":{},"f:ports":{".":{},"k:{\"port\":80,\"protocol\":\"TCP\"}":{".":{},"f:port":{},"f:protocol":{},"f:targetPort":{}}},"f:sessionAffinity":{},"f:type":{}}}},{"manager":"cloud-controller-manager","operation":"Update","apiVersion":"v1","time":"2025-01-25T08:24:41Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:finalizers":{".":{},"v:\"service.kubernetes.io/load-balancer-cleanup\"":{}}}},"subresource":"status"}]},"spec":{"ports":[{"protocol":"TCP","port":80,"targetPort":8080,"nodePort":32270}],"clusterIP":"34.118.229.5","clusterIPs":["34.118.229.5"],"type":"LoadBalancer","sessionAffinity":"None","externalTrafficPolicy":"Cluster","ipFamilies":["IPv4"],"ipFamilyPolicy":"SingleStack","allocateLoadBalancerNodePorts":true,"internalTrafficPolicy":"Cluster"},"status":{"loadBalancer":{}}}
   X-Kubernetes-Pf-Prioritylevel-Uid=7418f017-37b7-48b1-b8a7-b8a9f77074f5 tf_http_trans_id=a3e4b890-bd71-306e-1998-08d3f42252da Audit-Id=6e37c046-ce6d-410d-aa86-2b6614951816 tf_http_op_type=response
2025/01/25 00:33:32 [INFO] Received service status: v1.ServiceStatus{LoadBalancer:v1.LoadBalancerStatus{Ingress:[]v1.LoadBalancerIngress(nil)}, Conditions:[]v1.Condition(nil)}
2025-01-25T00:33:42.007-0800 [DEBUG] kubernetes.Kubernetes: Sending HTTP Request: new_logger_warning="This log was generated by a subsystem logger that wasn't created before being used. Use tflog.NewSubsystem to create this logger before it is used." tf_http_trans_id=edc318a9-5e9b-2e5d-2e03-55607f75f6c2 tf_http_req_uri=/api/v1/namespaces/default/services/tf-acc-test-1509728476215865051 tf_http_req_version=HTTP/1.1 Host=35.202.66.46 tf_http_req_method=GET Accept="application/json, */*" User-Agent="HashiCorp/1.0 Terraform/1.11.0-beta1" tf_http_op_type=request Accept-Encoding=gzip Authorization="Bearer <TOKEN>" tf_http_req_body=""
2025-01-25T00:33:42.084-0800 [DEBUG] kubernetes.Kubernetes: Received HTTP Response: new_logger_warning="This log was generated by a subsystem logger that wasn't created before being used. Use tflog.NewSubsystem to create this logger before it is used." Content-Type=application/json tf_http_res_version=HTTP/2.0 tf_http_op_type=response
  tf_http_res_body=
  | {"kind":"Service","apiVersion":"v1","metadata":{"name":"tf-acc-test-1509728476215865051","namespace":"default","uid":"28a0f40e-fe34-416f-a4e4-2b954d2aaa1e","resourceVersion":"43078","creationTimestamp":"2025-01-25T08:24:41Z","annotations":{"cloud.google.com/neg":"{\"ingress\":true}"},"finalizers":["service.kubernetes.io/load-balancer-cleanup"],"managedFields":[{"manager":"HashiCorp","operation":"Update","apiVersion":"v1","time":"2025-01-25T08:24:41Z","fieldsType":"FieldsV1","fieldsV1":{"f:spec":{"f:allocateLoadBalancerNodePorts":{},"f:externalTrafficPolicy":{},"f:internalTrafficPolicy":{},"f:ports":{".":{},"k:{\"port\":80,\"protocol\":\"TCP\"}":{".":{},"f:port":{},"f:protocol":{},"f:targetPort":{}}},"f:sessionAffinity":{},"f:type":{}}}},{"manager":"cloud-controller-manager","operation":"Update","apiVersion":"v1","time":"2025-01-25T08:24:41Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:finalizers":{".":{},"v:\"service.kubernetes.io/load-balancer-cleanup\"":{}}}},"subresource":"status"}]},"spec":{"ports":[{"protocol":"TCP","port":80,"targetPort":8080,"nodePort":32270}],"clusterIP":"34.118.229.5","clusterIPs":["34.118.229.5"],"type":"LoadBalancer","sessionAffinity":"None","externalTrafficPolicy":"Cluster","ipFamilies":["IPv4"],"ipFamilyPolicy":"SingleStack","allocateLoadBalancerNodePorts":true,"internalTrafficPolicy":"Cluster"},"status":{"loadBalancer":{}}}
   Audit-Id=773339f1-43fa-40c9-949d-4b806eb3aea0 Content-Length=1386 tf_http_trans_id=edc318a9-5e9b-2e5d-2e03-55607f75f6c2 X-Kubernetes-Pf-Prioritylevel-Uid=7418f017-37b7-48b1-b8a7-b8a9f77074f5 tf_http_res_status_code=200 Date="Sat, 25 Jan 2025 08:33:42 GMT" tf_http_res_status_reason="200 OK" X-Kubernetes-Pf-Flowschema-Uid=6a9e5560-b2fc-4d6e-a8eb-fd5f318cf508 Cache-Control="no-cache, private"
2025/01/25 00:33:42 [INFO] Received service status: v1.ServiceStatus{LoadBalancer:v1.LoadBalancerStatus{Ingress:[]v1.LoadBalancerIngress(nil)}, Conditions:[]v1.Condition(nil)}
2025-01-25T00:33:52.087-0800 [DEBUG] kubernetes.Kubernetes: Sending HTTP Request: new_logger_warning="This log was generated by a subsystem logger that wasn't created before being used. Use tflog.NewSubsystem to create this logger before it is used." tf_http_req_method=GET Accept-Encoding=gzip tf_http_req_version=HTTP/1.1 tf_http_req_uri=/api/v1/namespaces/default/services/tf-acc-test-1509728476215865051 Authorization="Bearer  <TOKEN>" tf_http_trans_id=1270a6a4-1ab8-a3f5-d50e-3d8097b24b43 tf_http_op_type=request User-Agent="HashiCorp/1.0 Terraform/1.11.0-beta1" Accept="application/json, */*" Host=35.202.66.46 tf_http_req_body=""
2025-01-25T00:33:52.158-0800 [DEBUG] kubernetes.Kubernetes: Received HTTP Response: new_logger_warning="This log was generated by a subsystem logger that wasn't created before being used. Use tflog.NewSubsystem to create this logger before it is used." Content-Length=1386 tf_http_trans_id=1270a6a4-1ab8-a3f5-d50e-3d8097b24b43 tf_http_op_type=response tf_http_res_status_code=200 Audit-Id=b06fac1e-07ec-42c8-9103-d691d98134cc X-Kubernetes-Pf-Flowschema-Uid=6a9e5560-b2fc-4d6e-a8eb-fd5f318cf508 tf_http_res_status_reason="200 OK"
  tf_http_res_body=
  | {"kind":"Service","apiVersion":"v1","metadata":{"name":"tf-acc-test-1509728476215865051","namespace":"default","uid":"28a0f40e-fe34-416f-a4e4-2b954d2aaa1e","resourceVersion":"43078","creationTimestamp":"2025-01-25T08:24:41Z","annotations":{"cloud.google.com/neg":"{\"ingress\":true}"},"finalizers":["service.kubernetes.io/load-balancer-cleanup"],"managedFields":[{"manager":"HashiCorp","operation":"Update","apiVersion":"v1","time":"2025-01-25T08:24:41Z","fieldsType":"FieldsV1","fieldsV1":{"f:spec":{"f:allocateLoadBalancerNodePorts":{},"f:externalTrafficPolicy":{},"f:internalTrafficPolicy":{},"f:ports":{".":{},"k:{\"port\":80,\"protocol\":\"TCP\"}":{".":{},"f:port":{},"f:protocol":{},"f:targetPort":{}}},"f:sessionAffinity":{},"f:type":{}}}},{"manager":"cloud-controller-manager","operation":"Update","apiVersion":"v1","time":"2025-01-25T08:24:41Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:finalizers":{".":{},"v:\"service.kubernetes.io/load-balancer-cleanup\"":{}}}},"subresource":"status"}]},"spec":{"ports":[{"protocol":"TCP","port":80,"targetPort":8080,"nodePort":32270}],"clusterIP":"34.118.229.5","clusterIPs":["34.118.229.5"],"type":"LoadBalancer","sessionAffinity":"None","externalTrafficPolicy":"Cluster","ipFamilies":["IPv4"],"ipFamilyPolicy":"SingleStack","allocateLoadBalancerNodePorts":true,"internalTrafficPolicy":"Cluster"},"status":{"loadBalancer":{}}}
   tf_http_res_version=HTTP/2.0 Date="Sat, 25 Jan 2025 08:33:52 GMT" Cache-Control="no-cache, private" Content-Type=application/json X-Kubernetes-Pf-Prioritylevel-Uid=7418f017-37b7-48b1-b8a7-b8a9f77074f5
2025/01/25 00:33:52 [INFO] Received service status: v1.ServiceStatus{LoadBalancer:v1.LoadBalancerStatus{Ingress:[]v1.LoadBalancerIngress(nil)}, Conditions:[]v1.Condition(nil)}
2025-01-25T00:34:02.163-0800 [DEBUG] kubernetes.Kubernetes: Sending HTTP Request: new_logger_warning="This log was generated by a subsystem logger that wasn't created before being used. Use tflog.NewSubsystem to create this logger before it is used." Accept-Encoding=gzip Host=35.202.66.46 tf_http_req_version=HTTP/1.1 User-Agent="HashiCorp/1.0 Terraform/1.11.0-beta1" Authorization="Bearer  <TOKEN>" tf_http_trans_id=f6e6c6e0-f7b7-dbe8-377d-468cf9adfdab tf_http_req_body="" tf_http_req_uri=/api/v1/namespaces/default/services/tf-acc-test-1509728476215865051 tf_http_req_method=GET Accept="application/json, */*" tf_http_op_type=request
2025-01-25T00:34:02.236-0800 [DEBUG] kubernetes.Kubernetes: Received HTTP Response: new_logger_warning="This log was generated by a subsystem logger that wasn't created before being used. Use tflog.NewSubsystem to create this logger before it is used." tf_http_res_status_reason="200 OK" Content-Length=1386 tf_http_res_version=HTTP/2.0 Content-Type=application/json Audit-Id=c890743a-cb32-4afb-965b-56450af06078 X-Kubernetes-Pf-Flowschema-Uid=6a9e5560-b2fc-4d6e-a8eb-fd5f318cf508 tf_http_trans_id=f6e6c6e0-f7b7-dbe8-377d-468cf9adfdab Date="Sat, 25 Jan 2025 08:34:02 GMT" tf_http_res_status_code=200 tf_http_op_type=response X-Kubernetes-Pf-Prioritylevel-Uid=7418f017-37b7-48b1-b8a7-b8a9f77074f5 Cache-Control="no-cache, private"
  tf_http_res_body=
  | {"kind":"Service","apiVersion":"v1","metadata":{"name":"tf-acc-test-1509728476215865051","namespace":"default","uid":"28a0f40e-fe34-416f-a4e4-2b954d2aaa1e","resourceVersion":"43078","creationTimestamp":"2025-01-25T08:24:41Z","annotations":{"cloud.google.com/neg":"{\"ingress\":true}"},"finalizers":["service.kubernetes.io/load-balancer-cleanup"],"managedFields":[{"manager":"HashiCorp","operation":"Update","apiVersion":"v1","time":"2025-01-25T08:24:41Z","fieldsType":"FieldsV1","fieldsV1":{"f:spec":{"f:allocateLoadBalancerNodePorts":{},"f:externalTrafficPolicy":{},"f:internalTrafficPolicy":{},"f:ports":{".":{},"k:{\"port\":80,\"protocol\":\"TCP\"}":{".":{},"f:port":{},"f:protocol":{},"f:targetPort":{}}},"f:sessionAffinity":{},"f:type":{}}}},{"manager":"cloud-controller-manager","operation":"Update","apiVersion":"v1","time":"2025-01-25T08:24:41Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:finalizers":{".":{},"v:\"service.kubernetes.io/load-balancer-cleanup\"":{}}}},"subresource":"status"}]},"spec":{"ports":[{"protocol":"TCP","port":80,"targetPort":8080,"nodePort":32270}],"clusterIP":"34.118.229.5","clusterIPs":["34.118.229.5"],"type":"LoadBalancer","sessionAffinity":"None","externalTrafficPolicy":"Cluster","ipFamilies":["IPv4"],"ipFamilyPolicy":"SingleStack","allocateLoadBalancerNodePorts":true,"internalTrafficPolicy":"Cluster"},"status":{"loadBalancer":{}}}
  
2025/01/25 00:34:02 [INFO] Received service status: v1.ServiceStatus{LoadBalancer:v1.LoadBalancerStatus{Ingress:[]v1.LoadBalancerIngress(nil)}, Conditions:[]v1.Condition(nil)}
2025-01-25T00:34:12.240-0800 [DEBUG] kubernetes.Kubernetes: Sending HTTP Request: new_logger_warning="This log was generated by a subsystem logger that wasn't created before being used. Use tflog.NewSubsystem to create this logger before it is used." tf_http_trans_id=ac865380-e726-4b44-5ce8-97347faffdee User-Agent="HashiCorp/1.0 Terraform/1.11.0-beta1" tf_http_req_body="" tf_http_op_type=request tf_http_req_method=GET Accept-Encoding=gzip Accept="application/json, */*" Authorization="Bearer  <TOKEN>" tf_http_req_uri=/api/v1/namespaces/default/services/tf-acc-test-1509728476215865051 tf_http_req_version=HTTP/1.1 Host=35.202.66.46
2025-01-25T00:34:12.318-0800 [DEBUG] kubernetes.Kubernetes: Received HTTP Response: new_logger_warning="This log was generated by a subsystem logger that wasn't created before being used. Use tflog.NewSubsystem to create this logger before it is used." Cache-Control="no-cache, private" X-Kubernetes-Pf-Flowschema-Uid=6a9e5560-b2fc-4d6e-a8eb-fd5f318cf508 tf_http_trans_id=ac865380-e726-4b44-5ce8-97347faffdee Content-Type=application/json tf_http_op_type=response tf_http_res_version=HTTP/2.0 tf_http_res_status_code=200 Date="Sat, 25 Jan 2025 08:34:12 GMT" X-Kubernetes-Pf-Prioritylevel-Uid=7418f017-37b7-48b1-b8a7-b8a9f77074f5 tf_http_res_status_reason="200 OK" Content-Length=1386 Audit-Id=3f1480b5-7a0b-4bd0-8584-7a4e6d77a357
  tf_http_res_body=
  | {"kind":"Service","apiVersion":"v1","metadata":{"name":"tf-acc-test-1509728476215865051","namespace":"default","uid":"28a0f40e-fe34-416f-a4e4-2b954d2aaa1e","resourceVersion":"43078","creationTimestamp":"2025-01-25T08:24:41Z","annotations":{"cloud.google.com/neg":"{\"ingress\":true}"},"finalizers":["service.kubernetes.io/load-balancer-cleanup"],"managedFields":[{"manager":"HashiCorp","operation":"Update","apiVersion":"v1","time":"2025-01-25T08:24:41Z","fieldsType":"FieldsV1","fieldsV1":{"f:spec":{"f:allocateLoadBalancerNodePorts":{},"f:externalTrafficPolicy":{},"f:internalTrafficPolicy":{},"f:ports":{".":{},"k:{\"port\":80,\"protocol\":\"TCP\"}":{".":{},"f:port":{},"f:protocol":{},"f:targetPort":{}}},"f:sessionAffinity":{},"f:type":{}}}},{"manager":"cloud-controller-manager","operation":"Update","apiVersion":"v1","time":"2025-01-25T08:24:41Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:finalizers":{".":{},"v:\"service.kubernetes.io/load-balancer-cleanup\"":{}}}},"subresource":"status"}]},"spec":{"ports":[{"protocol":"TCP","port":80,"targetPort":8080,"nodePort":32270}],"clusterIP":"34.118.229.5","clusterIPs":["34.118.229.5"],"type":"LoadBalancer","sessionAffinity":"None","externalTrafficPolicy":"Cluster","ipFamilies":["IPv4"],"ipFamilyPolicy":"SingleStack","allocateLoadBalancerNodePorts":true,"internalTrafficPolicy":"Cluster"},"status":{"loadBalancer":{}}}
  
2025/01/25 00:34:12 [INFO] Received service status: v1.ServiceStatus{LoadBalancer:v1.LoadBalancerStatus{Ingress:[]v1.LoadBalancerIngress(nil)}, Conditions:[]v1.Condition(nil)}
2025-01-25T00:34:22.322-0800 [DEBUG] kubernetes.Kubernetes: Sending HTTP Request: new_logger_warning="This log was generated by a subsystem logger that wasn't created before being used. Use tflog.NewSubsystem to create this logger before it is used." Accept="application/json, */*" tf_http_req_body="" tf_http_req_version=HTTP/1.1 Authorization="Bearer  <TOKEN>" User-Agent="HashiCorp/1.0 Terraform/1.11.0-beta1" tf_http_req_method=GET tf_http_op_type=request Host=35.202.66.46 Accept-Encoding=gzip tf_http_trans_id=6add8c27-1a51-33d3-d1ab-ea2f9239b7e1 tf_http_req_uri=/api/v1/namespaces/default/services/tf-acc-test-1509728476215865051
2025-01-25T00:34:22.393-0800 [DEBUG] kubernetes.Kubernetes: Received HTTP Response: new_logger_warning="This log was generated by a subsystem logger that wasn't created before being used. Use tflog.NewSubsystem to create this logger before it is used." tf_http_op_type=response Audit-Id=f6cadd12-5318-497f-8c92-07b2170f7bd9 Content-Type=application/json Date="Sat, 25 Jan 2025 08:34:22 GMT" tf_http_res_version=HTTP/2.0 tf_http_res_status_reason="200 OK" X-Kubernetes-Pf-Flowschema-Uid=6a9e5560-b2fc-4d6e-a8eb-fd5f318cf508 tf_http_trans_id=6add8c27-1a51-33d3-d1ab-ea2f9239b7e1 tf_http_res_status_code=200 Cache-Control="no-cache, private" X-Kubernetes-Pf-Prioritylevel-Uid=7418f017-37b7-48b1-b8a7-b8a9f77074f5
  tf_http_res_body=
  | {"kind":"Service","apiVersion":"v1","metadata":{"name":"tf-acc-test-1509728476215865051","namespace":"default","uid":"28a0f40e-fe34-416f-a4e4-2b954d2aaa1e","resourceVersion":"43078","creationTimestamp":"2025-01-25T08:24:41Z","annotations":{"cloud.google.com/neg":"{\"ingress\":true}"},"finalizers":["service.kubernetes.io/load-balancer-cleanup"],"managedFields":[{"manager":"HashiCorp","operation":"Update","apiVersion":"v1","time":"2025-01-25T08:24:41Z","fieldsType":"FieldsV1","fieldsV1":{"f:spec":{"f:allocateLoadBalancerNodePorts":{},"f:externalTrafficPolicy":{},"f:internalTrafficPolicy":{},"f:ports":{".":{},"k:{\"port\":80,\"protocol\":\"TCP\"}":{".":{},"f:port":{},"f:protocol":{},"f:targetPort":{}}},"f:sessionAffinity":{},"f:type":{}}}},{"manager":"cloud-controller-manager","operation":"Update","apiVersion":"v1","time":"2025-01-25T08:24:41Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:finalizers":{".":{},"v:\"service.kubernetes.io/load-balancer-cleanup\"":{}}}},"subresource":"status"}]},"spec":{"ports":[{"protocol":"TCP","port":80,"targetPort":8080,"nodePort":32270}],"clusterIP":"34.118.229.5","clusterIPs":["34.118.229.5"],"type":"LoadBalancer","sessionAffinity":"None","externalTrafficPolicy":"Cluster","ipFamilies":["IPv4"],"ipFamilyPolicy":"SingleStack","allocateLoadBalancerNodePorts":true,"internalTrafficPolicy":"Cluster"},"status":{"loadBalancer":{}}}
   Content-Length=1386
2025/01/25 00:34:22 [INFO] Received service status: v1.ServiceStatus{LoadBalancer:v1.LoadBalancerStatus{Ingress:[]v1.LoadBalancerIngress(nil)}, Conditions:[]v1.Condition(nil)}
2025-01-25T00:34:32.398-0800 [DEBUG] kubernetes.Kubernetes: Sending HTTP Request: new_logger_warning="This log was generated by a subsystem logger that wasn't created before being used. Use tflog.NewSubsystem to create this logger before it is used." tf_http_req_method=GET Accept="application/json, */*" tf_http_req_body="" tf_http_op_type=request tf_http_req_version=HTTP/1.1 tf_http_req_uri=/api/v1/namespaces/default/services/tf-acc-test-1509728476215865051 tf_http_trans_id=aaff97fd-5088-902f-fc09-0b2f738e59cf User-Agent="HashiCorp/1.0 Terraform/1.11.0-beta1" Authorization="Bearer  <TOKEN>" Host=35.202.66.46 Accept-Encoding=gzip
2025-01-25T00:34:32.474-0800 [DEBUG] kubernetes.Kubernetes: Received HTTP Response: new_logger_warning="This log was generated by a subsystem logger that wasn't created before being used. Use tflog.NewSubsystem to create this logger before it is used." X-Kubernetes-Pf-Flowschema-Uid=6a9e5560-b2fc-4d6e-a8eb-fd5f318cf508 tf_http_res_version=HTTP/2.0 tf_http_op_type=response tf_http_res_status_reason="200 OK" Audit-Id=5bd3ee60-54d2-4a27-b5d0-c486bee78b66 tf_http_trans_id=aaff97fd-5088-902f-fc09-0b2f738e59cf Content-Type=application/json X-Kubernetes-Pf-Prioritylevel-Uid=7418f017-37b7-48b1-b8a7-b8a9f77074f5 Date="Sat, 25 Jan 2025 08:34:32 GMT" Cache-Control="no-cache, private" Content-Length=1386 tf_http_res_status_code=200
  tf_http_res_body=
  | {"kind":"Service","apiVersion":"v1","metadata":{"name":"tf-acc-test-1509728476215865051","namespace":"default","uid":"28a0f40e-fe34-416f-a4e4-2b954d2aaa1e","resourceVersion":"43078","creationTimestamp":"2025-01-25T08:24:41Z","annotations":{"cloud.google.com/neg":"{\"ingress\":true}"},"finalizers":["service.kubernetes.io/load-balancer-cleanup"],"managedFields":[{"manager":"HashiCorp","operation":"Update","apiVersion":"v1","time":"2025-01-25T08:24:41Z","fieldsType":"FieldsV1","fieldsV1":{"f:spec":{"f:allocateLoadBalancerNodePorts":{},"f:externalTrafficPolicy":{},"f:internalTrafficPolicy":{},"f:ports":{".":{},"k:{\"port\":80,\"protocol\":\"TCP\"}":{".":{},"f:port":{},"f:protocol":{},"f:targetPort":{}}},"f:sessionAffinity":{},"f:type":{}}}},{"manager":"cloud-controller-manager","operation":"Update","apiVersion":"v1","time":"2025-01-25T08:24:41Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:finalizers":{".":{},"v:\"service.kubernetes.io/load-balancer-cleanup\"":{}}}},"subresource":"status"}]},"spec":{"ports":[{"protocol":"TCP","port":80,"targetPort":8080,"nodePort":32270}],"clusterIP":"34.118.229.5","clusterIPs":["34.118.229.5"],"type":"LoadBalancer","sessionAffinity":"None","externalTrafficPolicy":"Cluster","ipFamilies":["IPv4"],"ipFamilyPolicy":"SingleStack","allocateLoadBalancerNodePorts":true,"internalTrafficPolicy":"Cluster"},"status":{"loadBalancer":{}}}
  
2025/01/25 00:34:32 [INFO] Received service status: v1.ServiceStatus{LoadBalancer:v1.LoadBalancerStatus{Ingress:[]v1.LoadBalancerIngress(nil)}, Conditions:[]v1.Condition(nil)}
2025/01/25 00:34:41 [DEBUG] Looking up events via this selector: "involvedObject.kind=Service,involvedObject.name=tf-acc-test-1509728476215865051,involvedObject.namespace=default"
2025-01-25T00:34:41.645-0800 [ERROR] sdk.proto: Response contains error diagnostic: diagnostic_summary="client rate limiter Wait returned an error: context deadline exceeded" tf_provider_addr=registry.terraform.io/hashicorp/kubernetes tf_proto_version=5.6 tf_req_id=9676480a-0aae-524e-ad74-3b592aa5c56c tf_rpc=ApplyResourceChange tf_resource_type=kubernetes_service_v1 diagnostic_detail="" diagnostic_severity=ERROR
2025-01-25T00:34:41.666-0800 [WARN]  sdk.helper_resource: Error running Terraform CLI command: test_working_directory=/var/folders/mq/r6f7by0x78j1966k9ybr5bnc0000gn/T/plugintest2342798162 test_step_number=1
  error=
  | exit status 1
  | 
  | Error: client rate limiter Wait returned an error: context deadline exceeded
  | 
  |   with kubernetes_service_v1.test,
  |   on terraform_plugin_test.tf line 7, in resource "kubernetes_service_v1" "test":
  |    7: resource "kubernetes_service_v1" "test" {
  | 
   test_name=TestAccKubernetesServiceV1_loadBalancer_ipMode test_terraform_path=/Users/mau/.asdf/shims/terraform
2025-01-25T00:34:41.666-0800 [DEBUG] sdk.helper_resource: Stopping providers: test_step_number=1 test_name=TestAccKubernetesServiceV1_loadBalancer_ipMode test_terraform_path=/Users/mau/.asdf/shims/terraform test_working_directory=/var/folders/mq/r6f7by0x78j1966k9ybr5bnc0000gn/T/plugintest2342798162
2025-01-25T00:34:41.667-0800 [ERROR] sdk.helper_resource: Unexpected error: test_name=TestAccKubernetesServiceV1_loadBalancer_ipMode test_terraform_path=/Users/mau/.asdf/shims/terraform test_working_directory=/var/folders/mq/r6f7by0x78j1966k9ybr5bnc0000gn/T/plugintest2342798162 test_step_number=1
  error=
  | Error running apply: exit status 1
  | 
  | Error: client rate limiter Wait returned an error: context deadline exceeded
  | 
  |   with kubernetes_service_v1.test,
  |   on terraform_plugin_test.tf line 7, in resource "kubernetes_service_v1" "test":
  |    7: resource "kubernetes_service_v1" "test" {
  | 
  
    resource_kubernetes_service_v1_test.go:348: Step 1/2 error: Error running apply: exit status 1
        
        Error: client rate limiter Wait returned an error: context deadline exceeded
        
          with kubernetes_service_v1.test,
          on terraform_plugin_test.tf line 7, in resource "kubernetes_service_v1" "test":
           7: resource "kubernetes_service_v1" "test" {
        
2025-01-25T00:34:41.668-0800 [DEBUG] sdk.helper_resource: Creating sdkv2 provider instance: test_working_directory=/var/folders/mq/r6f7by0x78j1966k9ybr5bnc0000gn/T/plugintest2342798162 test_step_number=1 tf_provider_addr=registry.terraform.io/hashicorp/kubernetes test_name=TestAccKubernetesServiceV1_loadBalancer_ipMode test_terraform_path=/Users/mau/.asdf/shims/terraform
2025-01-25T00:34:41.678-0800 [DEBUG] sdk.helper_resource: Created sdkv2 provider instance: test_terraform_path=/Users/mau/.asdf/shims/terraform test_working_directory=/var/folders/mq/r6f7by0x78j1966k9ybr5bnc0000gn/T/plugintest2342798162 test_step_number=1 test_name=TestAccKubernetesServiceV1_loadBalancer_ipMode tf_provider_addr=registry.terraform.io/hashicorp/kubernetes
2025-01-25T00:34:41.678-0800 [DEBUG] sdk.helper_resource: Starting sdkv2 provider instance server: test_name=TestAccKubernetesServiceV1_loadBalancer_ipMode test_terraform_path=/Users/mau/.asdf/shims/terraform test_working_directory=/var/folders/mq/r6f7by0x78j1966k9ybr5bnc0000gn/T/plugintest2342798162 test_step_number=1 tf_provider_addr=registry.terraform.io/hashicorp/kubernetes
2025-01-25T00:34:41.681-0800 [DEBUG] sdk.helper_resource: Started sdkv2 provider instance server: tf_provider_addr=registry.terraform.io/hashicorp/kubernetes test_working_directory=/var/folders/mq/r6f7by0x78j1966k9ybr5bnc0000gn/T/plugintest2342798162 test_step_number=1 test_name=TestAccKubernetesServiceV1_loadBalancer_ipMode test_terraform_path=/Users/mau/.asdf/shims/terraform
2025-01-25T00:34:42.112-0800 [DEBUG] sdk.helper_resource: Stopping providers: test_step_number=1 test_name=TestAccKubernetesServiceV1_loadBalancer_ipMode test_terraform_path=/Users/mau/.asdf/shims/terraform test_working_directory=/var/folders/mq/r6f7by0x78j1966k9ybr5bnc0000gn/T/plugintest2342798162

@@ -129,6 +129,7 @@ func flattenLoadBalancerStatus(in v1.LoadBalancerStatus) []interface{} {

att["ip"] = ingress.IP
att["hostname"] = ingress.Hostname
att["ip_mode"] = ingress.IPMode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we're missing the expander which is where we receive the resp that contains the ip_mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support .status.loadBalancer.ingress.ipMode in resource_kubernetes_service_v1.go
3 participants