google-kubernetes-engine

Replication Controller VS Deployment in Kubernetes

不问归期 提交于 2019-12-02 18:58:39
I wanted to know what is the difference between a Replication Controller and a Deployment within Kubernetes (1.2). Going through the getting started document ( http://kubernetes.io/docs/hellonode/ ) I have created a deployment - but it doesn't show up on the web UI. When I create apps from the web UI - they are created as replication controllers. Functionally though, they seem very similar (they both manage pods and have services). So - what is the difference and when should I use each? Pixel Elephant Deployments are a newer and higher level concept than Replication Controllers. They manage

HTTPS load balancer in Google Container Engine

江枫思渺然 提交于 2019-12-02 18:01:50
I'm trying to set up an HTTPS load balancer for GKE using HTTPS L7 load balancer but for some reason is not working. Even the HTTP load balancer in the HTTP Load Balancing walkthrough . The forwarding rule's IP address is created and I'm able to ping and telnet to port 80. But when request via curl it give me a error. <title>502 Server Error</title> </head> <body text=#000000 bgcolor=#ffffff> <h1>Error: Server Error</h1> <h2>The server encountered a temporary error and could not complete your request. <p>Please try again in 30 seconds.</h2> <h2></h2> </body></html> All the steps were fine and

Workflow for building, pushing, and testing Docker images inside GKE / Kubernetes

纵饮孤独 提交于 2019-12-02 17:02:19
问题 I am developing a Kubernetes service for deployment in Google Container Egine (GKE). Until recently, I have built Docker images in Google Cloud Shell, but I am hitting quota limits now, because the overall load on the free VM instance where Cloud Shell runs is apparently too high from multiple docker build s and push es. My experience so far is that after about a week or so of sustained work I face the following error message and have to wait for about two days before the Cloud Shell becomes

How to SSH to docker container in kubernetes cluster?

末鹿安然 提交于 2019-12-02 15:30:44
I am fairly new to the Google Cloud platform and Docker and set-up a cluster of nodes, made a Dockerfile that copies a repo and runs a Clojure REPL on a public port. I can connect to it from my IDE and play around with my code, awesome! That REPL should however probably tunneled through SSH, but here is where my problem starts. I can't find a suitable place to SSH into for making changes to the repo that Docker runs the REPL on: The exposed IP just exposes the REPL service (correct kubernetes term?) and does not allow me to SSH in. Neither does the cluster master endpoint, it gives me a public

How do I get logs from all pods of a Kubernetes replication controller?

别说谁变了你拦得住时间么 提交于 2019-12-02 14:25:09
Running kubectl logs shows me the stderr/stdout of one Kubernetes container. How can I get the aggregated stderr/stdout of a set of pods, preferably those created by a certain replication controller? You can use labels kubectl logs -l app=elasticsearch I've created a small bash script called kubetail that makes this possible. For example to tail all logs for pods named "app1" you can do: kubetail app1 You can find the script here . You can get the logs from multiple containers using labels as Adrian Ng suggested: kubectl logs --selector app=yourappname In case you have a pod with multiple

How to switch kubectl clusters between gcloud and minikube

谁说我不能喝 提交于 2019-12-02 14:07:44
I have Kubernetes working well in two different environments, namely in my local environment (MacBook running minikube) and as well as on Google's Container Engine (GCE, Kubernetes on Google Cloud). I use the MacBook/local environment to develop and test my YAML files and then, upon completion, try them on GCE. Currently I need to work with each environment individually: I need to edit the YAML files in my local environment and, when ready, (git) clone them to a GCE environment and then use/deploy them. This is a somewhat cumbersome process. Ideally, I would like to use kubectl from my Macbook

RBAC Error in Kubernetes

痴心易碎 提交于 2019-12-02 12:35:15
问题 I have deployed kubernetes v1.8 in my workplace. I have created roles for admin and view access to namespaces 3months ago. In the initial phase RBAC is working as per the access given to the users. Now RBAC is not happening every who has access to the cluster is having clusteradmin access. Can you suggest the errors/changes that had to be done? 回答1: Ensure the RBAC authorization mode is still being used ( --authorization-mode=…,RBAC is part of the apiserver arguments) If it is, then check for

GCE + K8S - Accessing referral IP address

本秂侑毒 提交于 2019-12-02 11:43:44
With a standard Kubernetes deployment on Google Container Engine, to include services configured with the Kubernetes load balancer settings which creates network load balancers, is it possible to access the user's (or referring) IP address in an application? In the case of PHP, checking common headers in the $_SERVER superglobal only results in the server and internal network addresses being available. Not yet. Services go through kube_proxy, which answers the client connection and proxies through to the backend (your PHP server). The address that you'd see would be the IP of whichever kube

Google container engine logging to Stackdriver Error Reporting

耗尽温柔 提交于 2019-12-02 10:20:41
I'm currently trying to log errors to Stackdriver Error Reporting from Google Container Engine. I'm using the built-in fluentd-based Stackdriver Logging agent from GKE which works great. However, when I log an error according to the specification( https://cloud.google.com/error-reporting/docs/formatting-error-messages ), I do not see it appear in Stackdriver Error Reporting The payload I see in Stackdriver Logging is { insertId: "xatjb4fltv246" jsonPayload: { stream: "event" message: "path was incorrect" environment: "production" event_type: "RAILS_ERROR" context: { path: "/2", reportLocation:

change the horizontal-pod-autoscaler-sync-period with gke

好久不见. 提交于 2019-12-02 09:46:34
horizontal-pod-autoscaler-sync-period How can I change this setting with gke? I want to change from the default 30 seconds. There is no way to add/remove flags when using GKE - that's the downside of it being managed for you and not by you . 来源: https://stackoverflow.com/questions/46317275/change-the-horizontal-pod-autoscaler-sync-period-with-gke