google-kubernetes-engine

Can you route an Kubernetes ingress resource based on port?

人走茶凉 提交于 2019-12-01 21:50:35
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 possible and if so how? Via separate Ingress objects, you should be able to direct HTTP and HTTPS

gke cant disable Transparent Huge Pages… permission denied

无人久伴 提交于 2019-12-01 18:05:36
I am trying to run a redis image in gke. It works except I get the dreaded "Transparent Huge Pages" warning: WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled. Redis is currently too slow to be useful... So I tied turning off THP: sheena@gke-projectwaxd-cluster-default-pool-23593a74

Accessing Kubernetes API on Google Container Engine

孤街醉人 提交于 2019-12-01 18:04:14
According to Kubernetes API docs it is possible to create/list/delete pods, replication controllers and services: http://kubernetes.io/third_party/swagger-ui/#!/v1beta1 However in the Google Container Engine documentation they don't seem to expose this API. The only resources you can manage through a REST API are clusters. Pods, replication controllers and services have to be managed using gcloud. Is it possible to access the Kubernetes API when using Google Container Engine? Once you launch your container cluster on Google Container Engine, you will have a master running the kubernetes API on

Accessing Kubernetes API on Google Container Engine

对着背影说爱祢 提交于 2019-12-01 18:03:38
问题 According to Kubernetes API docs it is possible to create/list/delete pods, replication controllers and services: http://kubernetes.io/third_party/swagger-ui/#!/v1beta1 However in the Google Container Engine documentation they don't seem to expose this API. The only resources you can manage through a REST API are clusters. Pods, replication controllers and services have to be managed using gcloud. Is it possible to access the Kubernetes API when using Google Container Engine? 回答1: Once you

Kubernetes deployment name from within a pod?

馋奶兔 提交于 2019-12-01 17:24:30
问题 How can I to source the Kubernetes deployment/job name that spawned the current pod from within the pod? 回答1: In many cases the hostname of the Pod equals to the name of the Pod (you can access that by the HOSTNAME environment variable). However that's not a reliable method of determining the Pod's identity. You will want to you use the Downward API which allows you to expose metadata as environment variables and/or files on a volume. The name and namespace of a Pod can be exposed as

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

佐手、 提交于 2019-12-01 16:58:56
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" -k -X POST -H 'Upgrade: websocket' repsponse for that is unable to upgrade: missing upgrade headers

How to create a binary that contains zoneinfo.zip

空扰寡人 提交于 2019-12-01 12:08:09
I'm using Docker to create a container application and then deploy it to kubernetes engine but when the application is been initialized I get this error: err: open C:\Go/lib/time/zoneinfo.zip: no such file or directory When using Go's time package, specifically the LoadLocation method, it looks for time zone database information in various locations. This is explained in the comments for LoadLocation in the source code at https://golang.org/src/time/zoneinfo.go . Specifically it looks in these places: A location specified by a ZONEINFO environment variable Known locations where time zone

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

∥☆過路亽.° 提交于 2019-12-01 11:20:57
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 in kubernetes and i am able to access the React App Endpoint from the Browser. Now, Is it possible to

How to expose dynamic ports using Kubernetes service on Google Container Engine?

流过昼夜 提交于 2019-12-01 10:45:09
I am trying to connect to a Docker container on Google Container Engine(GKE) from my local machine through the internet by TCP protocol. So far I have used Kubernetes services which gives an external IP address, so the local machine can connect to the container on GKE using the service. When we create a service, we can specify only one port and cannot specify the port range. Please see the my-ros-service.yaml below. In this case, we can access the container by 11311 port from outside of GCE. However, some applications that run on my container expose dynamic ports to connect to other

Unable to publish messages to GCP Pub/Sub using Python SDK when executed via Cron inside a GKE POD

二次信任 提交于 2019-12-01 09:56:13
问题 Using a PYthon SDK to publish messages to GCP Pub/SUb. THe code is running inside a Kubernetes POD on GKE. import pymysql import os import argparse import time from google.cloud import pubsub_v1 entries = ['jelly'] def publish_messages(project, topic_name): publisher = pubsub_v1.PublisherClient() topic_path = publisher.topic_path(project, topic_name) for n in entries: data = u'Message number {}'.format(n) data = data.encode('utf-8') publisher.publish(topic_path, data=data) print "Message %s