google-kubernetes-engine

websockets on GKE with istio gives 'no healthy upstream' and 'CrashLoopBackOff'

人走茶凉 提交于 2019-12-05 13:57:36
I am on GKE using Istio version 1.0.3 . I try to get my express.js with socket.io (and uws engine) backend working with websockets and had this backend running before on a 'non kubernetes server' with websockets without problems. When I simply enter the external_gke_ip as url I get my backend html page, so http works. But when my client-app makes socketio authentication calls from my client-app I get 503 errors in the browser console: WebSocket connection to 'ws://external_gke_ip/socket.io/?EIO=3&transport=websocket' failed: Error during WebSocket handshake: Unexpected response code: 503 And

How to propagate kubernetes events from a GKE cluster to google cloud log

别来无恙 提交于 2019-12-05 13:44:37
Is there anyway to propagate all kubernetes events to google cloud log? For instance, a pod creation/deletion or liveness probing failed, I knew I can use kubectl get events in a console. However, I would like to preserve those events in a log file in the cloud log with other pod level logs. It is quite helpful information. It seems that OP found the logs, but I wasn't able to on GKE (1.4.7) with Stackdriver. It was a little tricky to figure out, so I thought I'd share for others. I was able to get them by creating an eventer deployment with the gcl sink. For example: deployment.yaml kind:

cannot fetch token error when using cloudsql-proxy with GKE

戏子无情 提交于 2019-12-05 13:41:16
I am using GKE with istio add-on enabled. Myapp somehow gives 503 errors using when using websocket. I am starting to think that maybe the websocket is working but the database connection is not and that causes 503's, as the cloudsql-proxy logs give errors: $ kubectl logs myapp-54d6696fb4-bmp5m cloudsql-proxy 2019/01/04 21:56:47 using credential file for authentication; email=proxy-user@myproject.iam.gserviceaccount.com 2019/01/04 21:56:47 Listening on 127.0.0.1:5432 for myproject:europe-west4:mydatabase 2019/01/04 21:56:47 Ready for new connections 2019/01/04 21:56:51 New connection for

How do I set the correct time in my Google Kubernetes Engine container? Do I need to configure NTP?

喜夏-厌秋 提交于 2019-12-05 12:54:03
The containers in my k8s cluster need to be set to the correct time with high accuracy, meaning that I can only handle 10s of milliseconds difference max. Do I need to setup NTP configuration for the containers on Google Kubernetes Engine to make sure that that clock in the containers is set to the correct time? No. You don't need to do any of your own NTP configuration. Google Kubernetes Engine (GKE) runs a timesyncd service in each of the containers. The service is pre-configured to sync up with Google's NTP servers . If you want to set the time yourself, you need to stop the timesyncd

Is there any tool for GKE nodes autoscaling base on total pods requested in kubernetes?

我只是一个虾纸丫 提交于 2019-12-05 12:33:26
When I resize a replication controller using kubectl, if the cluster does not have enough resource, there will have one or more pods always in pending. Is there has any tool will auto resize GKE cluster when the resource is running out? I had a similar requirement (for the Go build system): wanted to know when scheduled vs. available CPU or memory was > 1, and scale out nodes when that was true (or, more accurately, when it was ~.8). There's not a built-in metric, but as you suggest you can do it with a custom metric. This was all done in Go, but it will give you the basic idea: Create the

Wait for job/pod completion in Kubernetes or Google Container Engine

佐手、 提交于 2019-12-05 11:43:17
What's the best way in script to wait for a job or pod to complete in Kubernetes or Google Container Engine? In particular, it would be better to be notified rather than polling for status in kubectl , but I'd be happy with a fairly efficient loop without any slips between the cracks. Essentially, I'd like the equivalent of a plain docker run since that blocks until command termination, but I don't want to use docker directly in this case. I looked at Github Issue #1899 but it looks unresolved as yet. It's not really what it was designed for, but you could run kubectl attach $POD . It'll show

I am trying to use gcs bucket as the volume in gke pod

吃可爱长大的小学妹 提交于 2019-12-05 09:39:49
I am getting the error: error validating "mysql.yaml": error validating data: ValidationError(Deployment.spec.template.spec.volumes[0]): unknown field "path" in io.k8s.kubernetes.pkg.api.v1.Volume; ) apiVersion: extensions/v1beta1 kind: Deployment metadata: name: mysql labels: app: mysql spec: replicas: 1 selector: matchLabels: app: mysql template: metadata: labels: app: mysql spec: containers: - image: mysql:5.6 name: mysql env: - name: MYSQL_ROOT_PASSWORD valueFrom: secretKeyRef: name: mysql key: password ports: - containerPort: 3306 name: mysql volumeMounts: - name: mapping-sandbox-test

How to verify ownership of Google Cloud Endpoints service URL?

孤者浪人 提交于 2019-12-05 07:26:18
I already set up Google Cloud Endpoints project and can invoke http/https requests. Endpoints gives me MY_API.endpoints.MY_PROJECT.cloud.goog domain name that I can use. I'm using gRPC Cloud Endpoints with HTTP/JSON to gRPC transcoding feature. It is deployed on Google Kubernetes Engine (deployment yaml script attached at the end). When I'm trying to create push subscription with that URL I getting next error: "The supplied HTTP URL is not registered in the subscription's parent project (url="https://MY_API.endpoints.MY_PROJECT.cloud.goog/v1/path", project_id="PROJECT_ID"). My gcloud call:

How to send alerts based on Kubernetes / Docker events?

我与影子孤独终老i 提交于 2019-12-05 06:56:37
Is it possible to somehow send alerts (to email / slack) based on events that occur within a Kubernetes cluster? In particular, it would be useful to get an alert if a pod has restarted unexpectedly or if a pod cannot start. Similarly it would be useful to know if a pod's CPU usage was over a certain threshold and get an alert. We have Heapster (with InfluxDB / Grafana backend) installed. While this gives useful data, it unfortunately does not provide us with alerting. Both sysdig and Datadog provide this functionality as well. You can check and probably replace InfluxDB with http://prometheus

Google Compute Engine: Required 'compute.zones.get' permission error

拜拜、爱过 提交于 2019-12-05 06:51:23
I am trying to create a Kubernetes cluster in Google Cloud Platform and I receive the following error when I try to create the cluster from the Web app: An unknown error has occurred in Compute Engine: "EXTERNAL: Google Compute Engine: Required 'compute.zones.get' permission for 'projects/my-project-198766/zones/us-west1-a'". Error code: "18" When I use gcloud I receive this response: (gcloud.container.clusters.create) ResponseError: code=403, message=Google Compute Engine: Required 'compute.zones.get' permission for 'projects/my-project-198766/zones/us-west1-a' Please note that I have the