google-kubernetes-engine

http -> https redirect in Google Kubernetes Engine

 ̄綄美尐妖づ 提交于 2019-12-21 03:58:46
问题 I'm looking to redirect all traffic from http://example.com -> https://example.com like how nearly all websites do. I've looked at this link with no success: Kubernetes HTTPS Ingress in Google Container Engine And have tried the following annotations in my ingress.yaml file. nginx.ingress.kubernetes.io/configuration-snippet: | if ($http_x_forwarded_proto != 'https') { return 301 https://$host$request_uri; } nginx.ingress.kubernetes.io/force-ssl-redirect: "true" nginx.ingress.kubernetes.io/ssl

Recommended way to persistently change kube-env variables

让人想犯罪 __ 提交于 2019-12-21 02:55:23
问题 We are using elasticsearch/kibana instead of gcp for logging (based on what is described here). To have fluentd-elsticsearch pod's launched we've set LOGGING_DESTINATION=elasticsearch and ENABLE_NODE_LOGGING="true" in the "Compute Instance Template" -> "Custom metadata" -> "kube-env". While this works fine when done manually it gets overwritten with every gcloud container clusters upgrade as a new Instance Template with defaults ( LOGGING_DESTINATION=gcp ...) is created. My question is: How

Dynamic wildcard subdomain ingress for Kubernetes

自古美人都是妖i 提交于 2019-12-20 10:13:03
问题 I'm currently using Kubernetes on GKE to serve the various parts of my product on different subdomains with the Ingress resource. For example: api.mydomain.com , console.mydomain.com , etc. ingress.yml (current) : apiVersion: extensions/v1beta1 kind: Ingress metadata: name: ingress spec: rules: - host: api.mydomain.com http: paths: - backend: serviceName: api-service servicePort: 80 - host: console.mydomain.com http: paths: - backend: serviceName: console-service servicePort: 80 That works

Replication Controller VS Deployment in Kubernetes

喜你入骨 提交于 2019-12-20 09:09:05
问题 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? 回答1:

How to SSH to docker container in kubernetes cluster?

北城以北 提交于 2019-12-20 08:25:03
问题 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

I got Pod errors: CrashLoopBackOff from kubernetes

旧巷老猫 提交于 2019-12-20 07:11:10
问题 I was trying to run simple python file on kubenetes engine. while i got following error message "Pod errors: CrashLoopBackOff". How to fix this issue? 回答1: The issue caused by the docker container which exits as soon as the "start" process finishes. Add a command that runs forever and probably it'll work. For example, recreating docker image: #Dockerfile [...] CMD exec /bin/bash -c "trap : TERM INT; sleep infinity & wait" 回答2: Just modify your deployment as follows: spec: containers: - image:

Google container engine logging to Stackdriver Error Reporting

和自甴很熟 提交于 2019-12-20 06:12:28
问题 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

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

流过昼夜 提交于 2019-12-20 06:08:47
问题 horizontal-pod-autoscaler-sync-period How can I change this setting with gke? I want to change from the default 30 seconds. 回答1: 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

View client ip address in kubernetes logs when using load balancer

陌路散爱 提交于 2019-12-20 05:53:31
问题 I am hosting my application on GKE. The kubectl version installed in the server is v1.10.11-gke.1 and nginx-ingress is nginx-ingress-0.28.2 I would like to see the client IP address in my logs. For now, I can only see the pod IP address for example: 2019-02-14 15:17:21.000 EAT 10.60.1.1 - [10.60.1.1] - - [14/Feb/2019:12:17:21 +0000] "GET /user HTTP/2.0" 404 9 "-" "Mozilla/5.0 (Macintosh; My service has tls managed by letsencrypt. How can I get the client IP address on the logs? screenshot of

Google cloud platform creating a pipeline with Kubernetes and replacing the same container

此生再无相见时 提交于 2019-12-20 03:52:17
问题 I am struggling trying to replace an existing container with a container from my container-register from Google Cloud Platform. This is my cloudbuild.yaml file. steps: # This steps clone the repository into GCP - name: gcr.io/cloud-builders/git args: ['clone', 'https:///user/:password@github.com/PatrickVibild/scrappercontroller'] # This step runs the unit tests on the src - name: 'docker.io/library/python:3.7' id: Test entrypoint: /bin/sh args: - -c - 'pip install -r requirements.txt &&