google-kubernetes-engine

Can you route an Kubernetes ingress resource based on port?

二次信任 提交于 2019-12-20 01:52:15
问题 I have a Kubernetes service that expose two ports, one for the external interface (target port 8080) and one for the admin interface (target port 8081). I'd like to make both of these endpoints accessible over the internet using https so thus I think I want use an ingress resource. The ingress resource creates a static IP for the load balancer and I'd like to route port 80 and 443 to the external interface (8080) and port 81 (http) and port 4431 (https) to the admin interface (8081). Is this

How to execute command in a pod (kubernetes) using API?

瘦欲@ 提交于 2019-12-19 16:50:44
问题 I'm trying to execute command in a contianer (in a Kubernetes POD on GKE with kubernetes 1.1.2). Reading documentation I understood that I can use GET or POST query to open websocket connection on API endpoint to execute command. When I use GET, it does not work completly, returns error. When I try to use POST, something like that could work probably (but it's not): curl 'https://admin:xxx@IP/api/v1/namespaces/default/pods/hello-whue1/exec?stdout=1&stderr=1&command=ls' -H "Connection: upgrade

Communication from Pod to Pod on same node inside kubernetes in GCP

↘锁芯ラ 提交于 2019-12-19 10:16:18
问题 I have dockerized and created deployment and service for both front(REACT) and backend (EXPRESS NODE JS) project in kubernetes. I have successfully deployed in Kubernetes(Single node cluster) in Same Node with Two Pods(i.e One Pod --> REACT APP and SECOND POD --> EXPRESS NODE JS ) in Google cloud Platform. Question: 1.) How to communicate from one pod to another pod inside the Node in Kubernetes cluster? 2.) I have exposed my REACT app to the Outer world by creating LoadBalancer Type Service

How to access client IP of an HTTP request from Google Container Engine?

南楼画角 提交于 2019-12-19 04:07:05
问题 I'm running a gunicorn+flask service in a docker container with Google Container Engine. I set up the cluster following the tutorial at http://kubernetes.io/docs/hellonode/ The REMOTE_ADDR environmental variable always contains an internal address in the Kubernetes cluster. What I was looking for is HTTP_X_FORWARDED_FOR but it's missing from the request headers. Is it possible to configure the service to retain the external client ip in the requests? 回答1: I assume you set up your service by

GCE LoadBalancer : Invalid value for field 'namedPorts[0].port': '0'. Must be greater than or equal to 1

天大地大妈咪最大 提交于 2019-12-17 20:12:06
问题 In one of my HTTP(S) LoadBalancer, I wish to change my backend configuration to increase the timeout from 30s to 60s (We have a few 502's that do not have any logs server-side, I wish to check if it comes from the LB) But, as I validate the change, I got an error saying Invalid value for field 'namedPorts[0].port': '0'. Must be greater than or equal to 1 even if i didn't change the namedPort. This issue seems to be the same, but the only solution is a workaround that does not work in my case

Changing Permissions of Google Container Engine Cluster

有些话、适合烂在心里 提交于 2019-12-17 18:56:26
问题 I have been able to successfully create a Google Container Cluster in the developers console and have deployed my app to it. This all starts up fine, however I find that I can't connect to Cloud SQL, I get; "Error: Handshake inactivity timeout" After a bit of digging, I hadn't had any trouble connecting to the Database from App Engine or my local machine so I thought this was a little strange. It was then I noticed the cluster permissions... When I select my cluster I see the following;

GKE clusterrolebinding for cluster-admin fails with permission error

让人想犯罪 __ 提交于 2019-12-17 10:54:13
问题 I've just created a new cluster using Google Container Engine running Kubernetes 1.7.5, with the new RBAC permissions enabled. I've run into a problem allocating permissions for some of my services which lead me to the following: The docs for using container engine with RBAC state that the user must be granted the ability to create authorization roles by running the following command: kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin [--user=<user-name>]

How to mimic '--volumes-from' in Kubernetes

对着背影说爱祢 提交于 2019-12-17 10:23:58
问题 I'm looking for a pattern that allows to share volumes between two containers running on the same pod in Kubernetes. My use case is: I have a Ruby on Rails application running inside a docker container. The docker image contains static assets in /app/<app-name>/public directory, and I need to access those assets from the nginx container running alongside in the same pod. In 'vanilla' docker I would have used --volumes-from flag to share this directory: docker run --name app -v /app/<app-dir>

Kubernetes : configuring custom influxdb sink for heapster running in kube-system namespace on GKE

假装没事ソ 提交于 2019-12-13 13:24:21
问题 I need to configure heapster to send kubernetes cluster metrics to our custom influx db server . For this I tried to edit heapster deployment in kube-system namespace but after some time deployment is getting reverted to original state . I am using GKE , master version is 1.5.7 and node version is 1.5.6 . 回答1: As for now, a custom configuration of addons is not supported on GKE. Any changes to the default Heapster configuration will be reverted by addon-manager. If the default Heapster

Can I mount multiple partitions of a single GCE disk to a Pod?

浪子不回头ぞ 提交于 2019-12-13 12:29:55
问题 I'd like use a single google compute engine disk and mount it to multiple places a Kubernetes Google Container Engine . I'm wondering if using persistentVolumeClaim would work, but what I did expect to work is being able to mount two partitions of the same disk: ... volumes: - name: database gcePersistentDisk: pdName: dist-1 fsType: ext4 partition: 1 readOnly: true - name: media gcePersistentDisk: pdName: disk-1 fsType: ext4 partition: 2 readOnly: true Mounting either of them separately works