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

REST request fails with "The server encountered a temporary error and could not complete your request. Please try again in 30 seconds" #141

Closed
muzuro opened this issue Mar 3, 2018 · 4 comments
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@muzuro
Copy link

muzuro commented Mar 3, 2018

I am deploying application at google kubernetes engine. Applicaion has 2 services. There is also Ingress wich i am trying to use to expose one service and ingress also used for https support. I have 1 NodePort service "gateway" and ClusterIp service "internal". "Internal" should be accessed from gateway. Here is services config:

	apiVersion: extensions/v1beta1
	kind: Ingress
	metadata:
	  name: x-ingress
	  annotations:
		kubernetes.io/ingress.global-static-ip-name: x-x-ip
		kubernetes.io/tls-acme: "true"
	  labels:
		app: gateway
	spec:
	  tls:
		- secretName: secret
		  hosts:
		  - x.x.com
	  backend:
		serviceName: gateway
		servicePort: 80
	---
	apiVersion: certmanager.k8s.io/v1alpha1
	kind: ClusterIssuer
	metadata:
	  name: x-x
	spec:
	  acme:
		server: https://acme-v01.api.letsencrypt.org/directory
		email: x@x.com
		privateKeySecretRef:
		  name: x-x
		http01: {}
	---
	apiVersion: v1
	kind: Service
	metadata:
	  annotations:
		service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
	  name: gateway
	  labels:
		app: gateway
	spec:
	  type: NodePort
	  ports:
	  - port: 80
		name: gateway
		targetPort: 8080
	  selector:
		app: gateway
	---
	apiVersion: v1
	kind: Service
	metadata:
	  annotations:
		service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
	  name: internal
	  labels:
		app: internal
	spec:
	  ports:
	  - port: 8082
		name: internal
		targetPort: 8082
	  selector:
		app: internal

Gateway serve static content and REST resources. Static content is served ok, so i see html and images and scripts. But when i try to call REST endpoint i got 502 error with text: The server encountered a temporary error and could not complete your request. Please try again in 30 seconds. Gateway forward REST request to "internal" service and return response from internal. Gateway access internal service with url http://internal:8082/some/rest. I got errors when i call any request wich should be forwarded to "internal".
Actualy i have same scheme without Ingress and it works. "Gateway" is LoadBalancer service and "internal" is NodePort. I need Ingress for https.

What i have tried(without success):
I noticed i don't have any forwading rules related to 8082 port, only 80 and 443( i have used gcloud compute forwarding-rules list and gcloud compute forwarding-rules describe commands). I have added them with console cloud:
image
I have also found information about health check - so i have added "/" endpoints in each service with 200 response.

Here is output of kubectl describe svc

	Name:                     gateway
	Namespace:                default
	Labels:                   app=gateway
	Annotations:              service.alpha.kubernetes.io/tolerate-unready-endpoints=true
	Selector:                 app=gateway
	Type:                     NodePort
	IP:                       *
	Port:                     gateway  80/TCP
	TargetPort:               8080/TCP
	NodePort:                 gateway  31168/TCP
	Endpoints:                *:8080
	Session Affinity:         None
	External Traffic Policy:  Cluster
	Events:                   <none>
    ---
	Name:              internal
	Namespace:         default
	Labels:            app=internal
	Annotations:       service.alpha.kubernetes.io/tolerate-unready-endpoints=true
	Selector:          app=internal
	Type:              ClusterIP
	IP:                *
	Port:              internal  8082/TCP
	TargetPort:        8082/TCP
	Endpoints:         *:8082
	Session Affinity:  None
	Events:            <none>
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 3, 2018
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten
/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jul 3, 2018
@muzuro
Copy link
Author

muzuro commented Jul 3, 2018

/close

@arunmummidi
Copy link

/open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

4 participants