prompt
stringlengths
65
38.7k
response
stringlengths
41
29.1k
<p>I have created the service with the following config file:</p> <pre><code>{ "kind":"Service", "apiVersion":"v1", "metadata":{ "name":"my-service", "labels":{ "app":"my-service" } }, "spec":{ "ports": [ { "port":8080, "targetPort":"http-s...
<p>It can take a few minutes for the external IP to show up because it takes a while for the cloud provider (EC2 in this case) to provision a load balancer for you.</p> <p>On the off chance that it doesn't show up after a few minutes, run <code>kubectl get events</code> to see what's going wrong.</p>
<p>I have a question about kubectl command with flag --selector. In help menu it says,</p> <pre><code>-l, --selector="": Selector (label query) to filter on </code></pre> <p>how ever it does't work as i expect, for example, i want to get RC who have selector like</p> <pre><code> "spec": { "replicas": 2, ...
<p>Try</p> <pre><code>kubectl get pods --selector=app=tas-core </code></pre> <p>as in <a href="http://kubernetes.io/docs/user-guide/kubectl-cheatsheet/" rel="noreferrer">http://kubernetes.io/docs/user-guide/kubectl-cheatsheet/</a></p>
<p>I want to create MongoDB replica of the three machines, it needs to specify the IP-addresses of these machines? But they run into a pod's and have a dynamic IP. If you try to specify the DNS-name service MongoDB he says</p> <blockquote> <p>No host described in new configuration XXXXX for replica set app_replica...
<p>Take a look at <a href="https://www.mongodb.com/blog/post/running-mongodb-as-a-microservice-with-docker-and-kubernetes" rel="nofollow">https://www.mongodb.com/blog/post/running-mongodb-as-a-microservice-with-docker-and-kubernetes</a>, there is a great pdf tutorial.</p>
<p>How do I configure the Google Computing Engine (GKE) L7 load balancer to serve HTTPS?</p> <p>I have made HTTP work, but when I configure for TLS as described <a href="http://kubernetes.io/docs/user-guide/ingress/#tls" rel="noreferrer">in the guide</a>, it does not respond to HTTPS requests. Specifically, the <code>...
<p>Due to a likely bug in Kubernetes, one must first delete the ingress and then re-create it (rather than doing <code>kubectl replace</code> as I did):</p> <pre><code>kubectl delete -f ingress.yaml kubectl create -f ingress.yaml </code></pre>
<p>I have pod and its purpose is to take the incoming data and write it to the host volume. I'm running this pod in all the minions.</p> <p>Now when i setup NodePort service to this pods, traffic will go to 1 pod at a time. </p> <p>But how do i send request to all this pods in different minions? How to i bypass the l...
<p>A service uses a selector to identify the list of pods to proxy to (if they're in the Ready state). You could simply ask for the same list of pods with a GET request:</p> <pre><code>$ curl -G "$MASTER/api/v1/namespaces/$NAMESPACE/pods?labelSelector=$KEY=$VALUE" </code></pre> <p>And then manually send your request ...
<p>I need to scale down the number of pods in a replica controllers. However, I need a clean scale down:</p> <ul> <li>Stop to send load on the pods that will be scaled down</li> <li>Wait for the pod to have finished to handle the load </li> <li>Delete the pod</li> </ul> <p>I do not want a pod to be deleted when it is...
<p>Check out the <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination" rel="nofollow noreferrer">Termination of Pods</a> section in the pods user guide. You might wish to implement a <a href="http://kubernetes.io/docs/user-guide/container-environment/#hook-details" rel="nofollow no...
<p>Is there any doc and go file that shows all the various naming restrictions for Kubernetes entities? I am interested in charset and length restriction.</p>
<p>The <a href="https://github.com/kubernetes/kubernetes/blob/release-1.2/docs/design/identifiers.md" rel="nofollow">identifiers doc on Github</a> is the closest thing to what you're looking for.</p>
<p>I have a Kubernetes cluster running in High Availability mode with 3 master nodes. When I try to run the DNS cluster add-on as-is, the <code>kube2sky</code> application errors with an x509 signed by unknown certificate authority message for the API Server service address (which in my case is 10.100.0.1). Reading thr...
<p>It would be ideal to have the service IP of the API in the SAN field of all your server certificates.</p> <p>If this is not possible in your setup, set the <code>clusters{}.cluster.insecure-skip-tls-verify</code> field to <code>true</code> in your <a href="http://kubernetes.io/docs/user-guide/kubeconfig-file/" rel=...
<p>I am adding an environment variable to a Kubernetes replication controller spec, but when I update the running RC from the spec, the environment variable isn't added to it. How come?</p> <p>I update the RC according to the following spec, where the environment variable <code>IRON_PASSWORD</code> gets added since th...
<p>Replacing the ReplicationController object does not actually recreate the underlying pods, so the pods keep the spec from the previous configuration of the RC until they need to be recreated. If you delete the running pod, the new one that gets created to replace it will have the new environment variable.</p> <p>Th...
<p>I am following the hellonode tutorial on kubernetes.io</p> <p><a href="http://kubernetes.io/docs/hellonode/" rel="nofollow">http://kubernetes.io/docs/hellonode/</a></p> <p>I am getting an error when trying to do the 'Create your pod' section.</p> <p>When I run this command (replacing PROJECT_ID with the one I cre...
<p>I figured out the issue. In the <code>Create your cluster</code> section I missed a critical step. </p> <p>The step I missed was: <code>Please ensure that you have configured kubectl to use the cluster you just created.</code> The configured part is a link to how to do this:</p> <p>The steps are as follows:</p> ...
<p>I have a pod with some terrible, buggy software in it. One reason Kubernetes is great is that it'll just restart the software when it crashes, which is awesome.</p> <p>Kubernetes was designed for good software, not terrible software, so it does an exponential backoff while restarting pods. This means I have to wait...
<p>Unfortunately, the max back off time for container restarts is not tunable for the node reliability (i.e., too many container restarts can overwhelm the node). If you absolutely want to change it in your cluster, you will need to <a href="https://github.com/kubernetes/kubernetes/blob/a6718f59691d7b3989c4222fb21e8dae...
<p>I have a K8S cluster setup on openstack using the COREOS guide.</p> <p>I am getting following error while accessing the GRAFANA UI on <a href="http://%3Cmaster%3E:8080/api/v1/proxy/namespaces/kube-system/services/monitoring-grafana/" rel="nofollow">http://master-ip:8080/api/v1/proxy/namespaces/kube-system/services/...
<p>To help drill down on what the problem is, I'd recommend seeing if the master is able to reach the pod at all. This'll help determine whether the issue is in your networking setup as a whole or just with the service routing from the master.</p> <p>You should be able to verify whether the apiserver can reach the pod...
<p>I'm using kubernetes 1.2 example to run 2 cassandra nodes for testing. <a href="https://github.com/kubernetes/kubernetes/blob/release-1.2/examples/cassandra/README.md" rel="nofollow">https://github.com/kubernetes/kubernetes/blob/release-1.2/examples/cassandra/README.md</a> </p> <p>I use daemonset to have one cassan...
<p>You can't achieve this with current Kubernetes. You need the implementation of <a href="https://github.com/kubernetes/kubernetes/pull/18016" rel="nofollow">PetSets</a> due in v1.3.</p>
<p>I'm trying to run Rabbitmq using Kubernetes on AWS. I'm using the <a href="https://hub.docker.com/_/rabbitmq/">official Rabbitmq docker container</a>. Each time the pod restarts the rabbitmq container gets a new hostname. I've setup a service (of type LoadBalancer) for the pod with a resolvable DNS name.</p> <p>But...
<p>The idea is to use a different 'service' and 'deployment' for each of the node you want to create. </p> <p>As you said, you have to create a custom NODENAME for each i.e:</p> <pre><code>RABBITMQ_NODENAME=rabbit@rabbitmq-1 </code></pre> <p>Also <code>rabbitmq-1,rabbitmq-2,rabbitmq-3</code> have to be resolved from...
<p>I need to set a static hostname in a Kubernetes replication controller. Docker supports it with some runtime flags, however, Kubernetes replication controllers don't appear to support it. The environment: OS - CentOS 6.6 Approach to use sysctl to change the variable kernel.hostname does not work for a K8s replicatio...
<p>In 1.7 you can set the hostname directly in the Deployment spec</p> <pre><code>spec: replicas: 1 template: spec: hostname: myhostname containers: ... </code></pre> <p><strong>Old Answer</strong></p> <p>Now that 1.2 has landed, you can set a static hostname in a Replication Controller o...
<p>On my ubuntu laptop I was issuing some kubectl commands including running kubernetes from a local Docker container all was well ... at some point I then issued this command</p> <pre><code>kubectl config set-cluster test-doc --server=https://104.196.108.118 </code></pre> <p>now my local kubectl fails to execute ......
<p>It's important to note that you've set a <a href="http://kubernetes.io/docs/user-guide/kubeconfig-file/" rel="noreferrer">kubeconfig</a> setting for your <strong>client</strong>. When you run <code>kubectl version</code>, you're getting the version for client and the server which in your case seems to be the issue w...
<p>I am trying to mount a persistent disk on my container which runs a Postgres custom image. I am using Kubernetes and following <a href="https://cloud.google.com/container-engine/docs/tutorials/persistent-disk/" rel="nofollow noreferrer">this</a> tutorial.</p> <p>This is my <code>db_pod.yaml</code> file:</p> <pre><co...
<p>In the end, it seems that the real problem was the fact that I was trying to create the database from my entrypoint script. Things such as creating a db or a user should be done <em>at container creation time</em> so I ended up using the standard Postgres image, which actually provides a simple and easy way to crea...
<p>I have several different Deployments.<br> <code>Deployment A: export port 3333</code><br> <code>Deployment B: export port 4444</code><br> I want to use a single Service(with LoadBalancer type) to export them.<br> <code>Service Main: export port 4545 -&gt; Route to Deployment A's port 3333 export port ...
<p>I don't think that is possible today, but it seems like a potentially useful feature. I filed a <a href="https://github.com/kubernetes/kubernetes/issues/24875" rel="nofollow">feature request</a>.</p>
<p>I have a kubernetes service exposed via a load balancer, works fine but I want access this service via a VPN service. The ip range of the service doesn't seem to match my VPC (does not know if that is a problem)</p> <p>I have successfully setup a VPN tunnel between my VPC and the router.</p> <p>Kindly, provide mo...
<p>This is what I ended up doing...</p> <p>I exposed the service I was interested in via loadbalancer and then accessed it through the VPN via <strong><em>"privateNodeIp":"nodePort"</em></strong></p> <p><a href="http://kubernetes.io/docs/user-guide/services/" rel="nofollow">see the publishing services section of kube...
<p>I was following a tutorial on kubernetes and it told me to run the following commands:</p> <pre><code>kubectl config set-cluster --server=http://127.0.0.1:8080 kubectl config set-context local --cluster=local kubectl config use-context local </code></pre> <p>Now when I run <code>kubectl config view</code> I see an...
<p>You can <code>kubectl config unset contexts.testorz</code> to remove that entry.</p> <p>See <a href="http://kubernetes.io/docs/user-guide/kubectl/kubectl_config_unset/" rel="noreferrer">http://kubernetes.io/docs/user-guide/kubectl/kubectl_config_unset/</a></p>
<p>What are the differences between secrets and configmap in term of security?</p> <p>In which cases would I want to use secret instead of configmap? </p>
<p>Secrets are stored encoded and over time will <a href="https://github.com/kubernetes/kubernetes/issues/12742" rel="noreferrer">become more protected</a> (e.g. limited access, encrypted at rest, etc). Secrets existed before ConfigMap was created, so until recently it was common to store configuration data in secrets ...
<p>Have been using Kubernetes secrets up to date. Now we have ConfigMaps as well.</p> <p>What is the preferred way forward - secrets or config maps?</p> <p>P.S. After a few iterations we have stabilised at the following rule:</p> <ul> <li><p>configMaps are per solution domain (can be shared across microservices with...
<p>I'm the author of both of these features. The idea is that you should:</p> <ol> <li>Use <a href="https://kubernetes.io/docs/concepts/configuration/secret/" rel="nofollow noreferrer">Secrets</a> for things which are actually secret like API keys, credentials, etc</li> <li>Use <a href="https://kubernetes.io/docs/conce...
<p>How can one create a second network interface for a pod. </p> <p>In particular, I actually have a use case where second network interface should be ideally shared network interface to the host('s 2nd network interface) because the host has second network domain? </p> <p>The external service (on a separate subnet a...
<p>To share network interfaces between pod and host. You need to start the pod with host mode, which means pod will share the same network namespace with the host node.</p> <p>In the pod configuration file, you need to specify "hostNetwork: true".</p> <p>And for Kubernetes version before 1.1, you need to use --host-n...
<p>I'm running multiple clusters of Kubernetes in GKE. I'm using a heapster + influxdb to get metrics on pods performances. What is the recommended way to get and store cluster wide metrics like:</p> <ul> <li>number of pods in namespace</li> <li>total memory requested/limits per namespace</li> <li>total cpu requested/...
<p>4 of the metrics you mentioned can be visualized using Grafana, if you create custom dashboards and make good use of Grafana templates:</p> <ul> <li>total memory requested/limits per namespace</li> <li>total cpu requested/limits per namespace</li> </ul> <p>Sort by "pod_namespace" and aggregate by "cpu/usage" or "c...
<p>I have a little bit of an idea about their differences, but it would be great to have expert opinions.</p> <ul> <li><a href="https://cloud.google.com/compute/docs/containers/container_vms" rel="nofollow">Container-Optimized Google Compute Engine Images</a></li> <li><a href="https://cloud.google.com/container-engine...
<p>Google Container Engine is a <a href="http://kubernetes.io/" rel="nofollow">kubernetes</a> backed cluster manager. It makes managing simple or complex docker based applications easy. Easy in the form of configuration, updating and scaling.</p> <p>The container optimized compute engine images allows you to run docke...
<p>I am failing to pull from my private Docker Hub repository into my local Kubernetes setup running on Vagrant:</p> <blockquote> <p>Container "hellonode" in pod "hellonode-n1hox" is waiting to start: image can't be pulled</p> <p>Failed to pull image "username/hellonode": Error: image username/hellonode:lates...
<p>To pull a private DockerHub hosted image from a Kubernetes YAML:</p> <p>Run these commands:</p> <pre><code>DOCKER_REGISTRY_SERVER=docker.io DOCKER_USER=Type your dockerhub username, same as when you `docker login` DOCKER_EMAIL=Type your dockerhub email, same as when you `docker login` DOCKER_PASSWORD=Type your doc...
<p>I have defined a Deployment for my app:</p> <pre><code>apiVersion: extensions/v1beta1 kind: Deployment metadata: name: myapp-deployment spec: replicas: 2 template: metadata: labels: app: myapp spec: containers: - name: myapp image: 172.20.34.206:5000/myapp_img:2.0 ...
<p>You could do it via the REST API using the <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#patch-operations" rel="nofollow noreferrer">PATCH verb</a>. However, an easier way is to use <a href="https://kubernetes.io/docs/reference/generated/kubectl/k...
<p>I followed the guide to getting Kubernetes running in Azure here:</p> <p><a href="http://kubernetes.io/docs/getting-started-guides/coreos/azure/" rel="nofollow">http://kubernetes.io/docs/getting-started-guides/coreos/azure/</a></p> <p>In order to create pods, etc., the guide has you ssh into the master node <code>...
<p>The <code>kubectl</code> command line tool is just a wrapper to execute remote HTTPS API REST calls on the kubernetes cluster. If you want to be able to do so from your own machine you need to open the correct port (443) on your master node and pass along some parameters to the kubectl tool as specified in this tuto...
<p>I have a simple wordpress site defined by the <code>ReplicationController</code> and <code>Service</code> below. Once the app is deployed and running happily, I enabled autoscaling on the instance group created by Kubernetes by going to the GCE console and enabling autoscaling with the same settings (max 5, cpu 10)....
<h2>TLDR;</h2> <p>In your usecase kubernetes is only giving you overhead. You are running 1 pod (docker container) on each instance in your instance group. You could also have your Docker container be deployed to App Engine flexible (former Managed VM's) <a href="https://cloud.google.com/appengine/docs/flexible/custom...
<p>I've installed kubernetes 1.2.0 with the following configuration</p> <pre><code>export nodes="user@10.0.0.30 user@10.0.0.32" export role="ai i" export NUM_NODES=2 export SERVICE_CLUSTER_IP_RANGE=192.168.3.0/24 export FLANNEL_NET=172.16.0.0/16 export KUBE_PROXY_EXTRA_OPTS="--proxy-mode=iptables" </code></pre> <p>I'...
<p>You're not doing anything wrong, unfortunately. It's an artifact of how packets are proxied from the machine that receives them to the destination container.</p> <p>There's been a bunch of discussion around the problem in a <a href="https://github.com/kubernetes/kubernetes/issues/3760" rel="nofollow">very long Gith...
<p>When i do <code>kubectl get nodes</code> it gives me</p> <pre><code>Name Status 192.168.1.10 NotReady 192.168.1.11 Ready 192.168.1.12 Ready </code></pre> <p>Here node <strong>192.168.1.10</strong> as been completed deleted, but still this is listed in nodes list.</p> <p>Because of this when im trying to r...
<p>On some cloud providers, nodes will be automatically removed from the node list when the VM is deleted (because the master components can verify with an authoritative API that the VM is in fact not coming back). On bare metal (or cloud providers where that extra hook has not been implemented), the node will exist in...
<p>enter image description hereI tried to used the instructions from this link <a href="https://github.com/kubernetes/heapster/blob/master/docs/influxdb.md" rel="nofollow noreferrer">https://github.com/kubernetes/heapster/blob/master/docs/influxdb.md</a> but I was not able to install it. specifically I dont know what t...
<blockquote> <p>I am using latest version of kubernetes version 1.0.1</p> </blockquote> <p>FYI, the latest version is <a href="https://github.com/kubernetes/kubernetes/releases/tag/v1.2.3" rel="nofollow">v1.2.3</a>. </p> <blockquote> <p>... it says kube-system not found</p> </blockquote> <p>You can create the ku...
<p>I am eagerly awaiting the release of Kubernetes v1.3 in mid to late June, so that I can access cron scheduling for jobs. In the meantime, what I plan to do is the following:</p> <ul> <li>Deploy a job on my Kubernetes cluster</li> <li>Use jenkins as a cron tool to trigger the job in defined intervals (e.g. 1 hour).<...
<p>I am not sure if there is any fancy way to trigger a completed job, but one way to do it can be to delete and recreate the job.</p> <p>Re: rolling-update: that is required for long running pods, which is what RCs control. For jobs: You can update the podTemplateSpec in jobSpec and that will ensure that any new pod ...
<p><code>kubectl config view</code> shows contexts and clusters corresponding to clusters that I have deleted.</p> <p>How can I remove those entries?</p> <p>The command</p> <pre><code>kubectl config unset clusters </code></pre> <p>appears to delete all clusters. Is there a way to selectively delete cluster entries?...
<p><code>kubectl config unset</code> takes a dot-delimited path. You can delete cluster/context/user entries by name. E.g.</p> <pre><code>kubectl config unset users.gke_project_zone_name kubectl config unset contexts.aws_cluster1-kubernetes kubectl config unset clusters.foobar-baz </code></pre> <p>Side note, if you...
<p>I am setting up skydns for kubernetes following this template <a href="http://kubernetes.io/docs/getting-started-guides/docker-multinode/skydns.yaml.in" rel="nofollow">http://kubernetes.io/docs/getting-started-guides/docker-multinode/skydns.yaml.in</a>. But it is not able to resolve dns. After looking for solutions ...
<p>I had some iptables rules set which were blocking the connection on docker0 interface where kubernetes services including skydns were running. After flushing the rule it worked. Thus it appears that the first problem was with my local setup rather than skydns.</p> <p>However the problem reappeared after installing ...
<p>I am unable to install <a href="https://github.com/kubernetes/kubernetes/blob/release-1.2/cluster/addons/cluster-monitoring/google/heapster-controller.yaml" rel="nofollow">cluster/addons/cluster-monitoring/google/heapster-controller.yaml</a> with Kubernetes 1.2.0 on CoreOS 991.1.0/GCE due to the following error:</p>...
<p>Seems likely to be a mismatch between client and server version. Read more at <a href="https://github.com/kubernetes/kubernetes/issues/22273" rel="nofollow">this GitHub issue</a>.</p>
<p>I am creating a cluster of 1 master 2 nodes kubernetes. I am trying to create the skydns based on the following:</p> <pre><code>apiVersion: v1 kind: ReplicationController metadata: name: kube-dns-v11 namespace: kube-system labels: k8s-app: kube-dns version: v11 kubernetes.io/cluster-service: "true...
<p><code>SkyDNS</code> defaults its forwarding nameservers to the one listed in <code>/etc/resolv.conf</code>. Since <code>SkyDNS</code> runs inside the <code>kube-dns</code> pod as a cluster addon, it inherits its <code>/etc/resolv.conf</code> from its host as described in the <a href="https://github.com/kubernetes/ku...
<p>I am trying to set up autoscaling on a Kubernetes 1.2.3 (beta) cluster based on custom metrics. (I already tried CPU-based autoscaling on the cluster, and it worked fine.)</p> <p>I tried to follow their <a href="https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/custom-metrics.md" rel="nofollow">cu...
<p>The <a href="https://github.com/mwielgus/kubernetes.github.io/blob/custom-metrics/docs/user-guide/horizontal-pod-autoscaling/index.md" rel="nofollow">custom metrics proposal</a> is out of date.</p> <p>Please refer to the <a href="https://github.com/mwielgus/kubernetes.github.io/blob/custom-metrics/docs/user-guide/h...
<p>I am using fabric8 to develop a cluster management layer on top of Kubernetes, and I am confused as to what the 'official' API is to obtain notifications of errors when things go wrong when instantiating pods/rep controllers &amp; services etc. </p> <p>In the section "Pod Deployment Code" I have a stripped dow...
<p>I'd suggest you to have a look at events, see <a href="http://kubernetes.io/docs/user-guide/introspection-and-debugging/#example-debugging-pending-pods" rel="nofollow">this topic</a> for some guidance. Generally each object should generate events you can watch and be notified of such errors.</p>
<p>I am running a restfull service behind self signed cert thru NGINX in google cloud kubernetes infrastructure. Kubernetes service loader exposes 443 and routes the traffic those containers. All is working just fine as expected other than asking internal clients to ignore the self sign cert warning! It is time for to ...
<ol> <li><p>Update Firewall Rules for:</p> <pre><code>IP: 130.211.0.0/22 tcp:30000-32767 </code></pre></li> <li><p>Create NodePort type service:</p> <pre><code>apiVersion: v1 kind: Service metadata: name: yourservicenodeport labels: name: your-service-node-port spec: type: NodePort ports: - port: 80 ...
<p>I have a Kubernetes cluster running on 3 servers, a master and 2 minions. I would like to add another minion. Is it possible to add a minion without having to do the complete installation again? So far when searching for guides to do this, I can only find excellent guides on getting the whole cluster up. </p>
<p>I was stuck on this for awhile too. I found the solution was surprisingly simple.</p> <p>If you already have a master up, start the following processes on an unconnected minion in the order they appear. (I imagine you can start a similiar network overlay first if you're using a different one).</p> <pre><code>/opt/...
<p>I have a Kubernetes cluster installed in my Ubuntu machines. It consists of three machines: one master/node and two nodes.</p> <p>When I turn down the cluster, it never stops printing "waiting for tearing down pods":</p> <pre><code>root@kubernetes01:~/kubernetes/cluster# KUBERNETES_PROVIDER=ubuntu ./kube-down.sh B...
<p><strong>First we have to find out which rc is running :</strong></p> <p>kubectl get rc --namespace=kube-system </p> <p><strong>We have to delete Running rc :</strong></p> <p>kubectl delete rc <strong>above_running_rc_name</strong> --namespace=kube-system </p> <p>Then cluster down script "KUBERNETES_PROVIDER=ubu...
<p>I have a set of pods providing nsqlookupd service. Now I need each nsqd container to have a list of nsqlookupd servers to connect to (while service will point to different every time) simultaneously. Something similar I get with </p> <pre><code>kubectl describe service nsqlookupd ... Endpoints: .... </code></pre> ...
<p>Sounds like you would need an extra service running either in your <code>nsqd</code> container or in a separate container in the same pod. The role of that service would be to pole the API regularly in order to fetch the list of endpoints.</p> <p>Assuming that you enabled <a href="http://kubernetes.io/docs/user-gui...
<p>I'm following the <a href="http://kubernetes.io/docs/getting-started-guides/logging-elasticsearch/" rel="nofollow noreferrer">k8s logging instructions</a> on how to configure cluster level logging. I'm using <a href="https://github.com/coreos/coreos-kubernetes/releases" rel="nofollow noreferrer">kube-aws cli Tool</...
<p>So it seems that there is no support for this on <strong>kube-aws</strong> currently, quoting one of the authors:</p> <blockquote> <p>We are currently working on a kube-was distribution for this approach that includes Kibana for visualizing the elastic search data.</p> </blockquote> <p>Also a suggested <strong>w...
<p>I am using k8s 1.2 on ubuntu 14.04.4.</p> <p>Here is some info on my one k8s minion node:</p> <pre><code># cat /etc/os-release NAME=&quot;Ubuntu&quot; VERSION=&quot;14.04.4 LTS, Trusty Tahr&quot; ID=ubuntu ID_LIKE=debian PRETTY_NAME=&quot;Ubuntu 14.04.4 LTS&quot; VERSION_ID=&quot;14.04&quot; HOME_URL=&quot;http://ww...
<p>The short answer is <strong>yes</strong>. <code>kube-proxy</code> generates IPtables rules for each service so that it can be accessed from both hosts and pods.</p> <p>When in doubt, execute <code>iptables -t nat -n -v</code> <strong>on a host where kube-proxy is running</strong> and search for the IP of the servic...
<p>While trying to install Kubernetes on AWS, I have come across two major ways of doing things.</p> <p>The first one is to use the deploy scripts that come packaged with Kubernetes to create a Kubernetes cluster on AWS. Another one is to use CoreOS based <code>kube-aws</code> tool to run a cluster.</p> <p>What are t...
<p>The <code>kube-aws</code> tool utilizes an autoscaling group for the worker machines. You could resize this based on CloudWatch metrics like CPU/RAM, although this isn't set up by default. To scale it manually up or down, you can use the AWS console.</p>
<p>I can do a deploy like this, but cannot do it via command line.</p> <p><a href="https://i.stack.imgur.com/wYbrE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wYbrE.png" alt=""></a> </p> <p>I was looking at doing it like this</p> <pre><code>kubectl create -f kubernetes-rc.json </code></pre> <...
<p>Your service's selector is wrong. It should be selecting a label from the pod template, not a label on the RC itself.</p> <p>If you change the following in your service:</p> <pre><code>"selector": { "app": "foo-frontend-rc" }, </code></pre> <p>to:</p> <pre><code>"selector": { "app": "foo-frontend" }, </code>...
<p>I have tried</p> <pre><code>kubectl create -f x.yaml --logtostderr=true </code></pre> <p>but it didn't work.</p> <p><a href="https://i.stack.imgur.com/W5Vv7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W5Vv7.png" alt="enter image description here"></a></p>
<p>The Kubernetes API doesn't currently expose a way to change the logging behavior. It'll rotate the log files as appropriate to avoid filling up the disk, but if you need more control, you'll have to <a href="https://docs.docker.com/engine/admin/logging/overview/" rel="nofollow">modify the docker daemon on each node ...
<p>Actually, i have kubernetes cluster set up. I want to generate yaml config file dynamically based on a template using python.</p> <p>template.yaml</p> <pre><code>apiVersion: v1 kind: pod metadata: name: $name spec: replicas: $replicas template: metadata: labels: run: $name spec: c...
<p>If you want a way to do it using pure python, with no libraries, here's one using multiline strings and format:</p> <pre><code>def writeConfig(**kwargs): template = """ apiVersion: v1 kind: pod metadata: name: {name} spec: replicas: {replicas} template: metadata: ...
<p>What's the best way in script to wait for a job or pod to complete in Kubernetes or Google Container Engine?</p> <p>In particular, it would be better to be notified rather than polling for status in <code>kubectl</code>, but I'd be happy with a fairly efficient loop without any slips between the cracks. Essentially...
<p>It's not really what it was designed for, but you could run <code>kubectl attach $POD</code>. It'll show you the output of the pod while it's running and automatically terminate once the pod is done running.</p> <p>Of course, you'll have to handle the error that it prints if the pod is already done running, since i...
<p>Can’t find any resources that simply say here’s where your cert goes and here’s how to enable it. I have the cert there when I run <code>gcloud compute ssl-certificates list</code>. I have a cluster with kubernetes running and exposing http traffic via this service:</p> <pre><code>{ "kind": "Service", "apiVersi...
<p>K8s doesn't have special TLS support for the ordinary services. You need to use one of the following methods:</p> <ol> <li><p>using Ingress: see <a href="http://kubernetes.io/docs/user-guide/ingress/#tls" rel="noreferrer">http://kubernetes.io/docs/user-guide/ingress/#tls</a>. You need to choose a Ingress controller...
<p>We have a Kubernetes 1.1 cluster on AWS provisioned using <code>kube-up.sh</code>.</p> <p>Part of the base installation includes <code>fluentd-elastisearch</code>. We want to uninstall it. Specifically, we have been unsuccessful in removing the static pods running one-per-node.</p> <p>We do not use the Kubernetes-...
<p>I believe we have working steps to remove <strong>fluentd</strong> from a cluster which <em>already</em> has it installed.</p> <ol> <li>Delete <strong>fluentd-elastisearch</strong> addon (on <strong>master</strong>) <ul> <li><code>rm</code> (or <code>mv</code>) <code>/etc/kubernetes/addons/fluentd-elasticsearch/</...
<p>Is there a way to force an SSL upgrade for incoming connections on the ingress load-balancer? Or if that is not possible with, can I disable port :80? I haven't found a good documentation pages that outlines such an option in the YAML file. Thanks a lot in advance!</p>
<p><a href="https://github.com/kubernetes/ingress-gce#frontend-https" rel="noreferrer">https://github.com/kubernetes/ingress-gce#frontend-https</a></p> <p>You can block HTTP through the annotation <code>kubernetes.io/ingress.allow-http: "false"</code> or redirect HTTP to HTTPS by specifying a custom backend. Unfortuna...
<p>Is it possible to run kubernetes from source (./hack/local-up-cluster.sh) and still properly configure the cloud provider from this type of setup? For example, if an instance is running on AWS EC2 and all prerequisites are met including proper exports, aws cli and configs but keep getting an error stating that the ...
<p>I don't think <code>hack/local-up-cluster.sh</code> is designed to be run on a cloud provider. However, <code>cluster/kube-up.sh</code> <em>is</em> designed to work when building from source:</p> <pre><code>$ make release $ export KUBERNETES_PROVIDER=aws $ cluster/kube-up.sh # Uses the release built in step 1 </co...
<h2>Environment background</h2> <ul> <li>I currently have two vmware datacenters</li> <li>Kubernetes 1.2.2 running on coreos</li> <li>In datacenter 'L', I have a kubernetes cluster of 3 masters and 5 minions</li> <li>In datacenter 'O', I was planning on standing 5 minions only</li> <li>etcd is running on the 3 kuberne...
<p>I believe you're looking for <a href="https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/federation.md" rel="nofollow">Cluster Federation</a> (a.k.a. "Ubernetes"). This feature is under active development, but exists as of 1.2 in a "lite" form: see <a href="http://kubernetes.io/docs/admin/multiple-z...
<p>I am getting some issues while creating a Kubernetes cluster on a Google Cloud instance.</p> <p>I am running below command for creating a Kubernetes Cluster.</p> <pre class="lang-bash prettyprint-override"><code>./cluster/kube-up.sh </code></pre> <p>Please see error below from the console:</p> <pre class="lang-n...
<p>Make sure that the Instance has the necessary OAuth2 scopes (changing the scopes will require re-creating the Instance).</p> <p>To run <code>./cluster/kube-up.sh</code>, you most likely need <code>compute</code> scope (to create other Instances) and <code>devstorage.full_control</code> or <code>devstorage.read_writ...
<p>We are using elasticsearch/kibana instead of gcp for logging (based on what is described <a href="https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/fluentd-elasticsearch" rel="nofollow noreferrer">here</a>).</p> <p>To have fluentd-elsticsearch pod's launched we've set <code>LOGGING_DESTINATION=ela...
<p>There isn't a fully supported way to reconfigure the kube-env in GKE. As you've found, you can hack the instance template, but this isn't guaranteed to work across upgrades.</p> <p>An alternative is to create your cluster without gcp logging enabled and then create a DaemonSet that places a fluentd-elasticsearch po...
<p>I'm trying to get logs from my pod, but it doesn't work for some reason though <code>kubectl describe pod</code> works well, <code>docker logs</code> works well. I have Kubernetes 1.2.3 Debian 8 x64 installed manually on a single node</p> <pre><code> $ kubectl logs -f web-backend-alzc1 --namespace=my-namespace --v...
<p>This is caused by the <code>--enable-debugging-handlers</code> flag being set to false, which prevents the kubelet from attaching to containers and fetching the logs. Restarting the kubelet without this flag (it defaults to <code>true</code>) should fix it.</p>
<p>This is like a follow-up question of: <a href="https://stackoverflow.com/questions/37138499/recommended-way-to-persistently-change-kube-env-variables">Recommended way to persistently change kube-env variables</a></p> <p>I was playing around with the possibility to define a <em>k8s-user-startup-script</em> for GKE i...
<p>Google Container Engine doesn't support custom startup scripts for nodes. </p> <p>As I mentioned in <a href="https://stackoverflow.com/questions/37138499/recommended-way-to-persistently-change-kube-env-variables">Recommended way to persistently change kube-env variables</a> you can use a DaemonSet to customize your...
<p>Is there a way to obtain hardware information (e.g. number of CPU cores, capacity of RAM) of an OpenShift 3.0 node programmatically? I could not find anything useful in the API references for <a href="https://docs.openshift.com/enterprise/3.0/rest_api/openshift_v1.html" rel="nofollow">OpenShift</a> or <a href="https...
<p>The Kubernetes <code>NodeStatus</code> has a field called <code>Capacity</code>, which is a list of resources with their corresponding amounts.</p> <p>You can also see the Capacity in the output of <code>kubectl describe nodes</code></p> <p>e.g.</p> <pre><code>$ kubectl describe nodes my-node-1 Name: my...
<p>I am newbie in Kubernetes. I didn't find option for IBM Bluemix container in your_provider for cluster configuration. (I am referring to this <a href="http://kubernetes.io/docs/getting-started-guides/binary_release/" rel="nofollow noreferrer">link</a>). Cloud you please tell me, Is it possible to integrate Bluemix w...
<p>Today it is not feasible to run Kubernetes natively within the Bluemix platform. We are investigating the ability to support the native API and CLI so please check back for future announcements in this space. </p>
<p>I have used following command for autoscaling.</p> <pre><code>kubectl autoscale deployment catch-node --cpu-percent=50 --min=1 --max=10 </code></pre> <p>The status of autoscaling in my case on load test is as like below .</p> <p>27th minute</p> <pre><code>NAME REFERENCE TARGET CUR...
<p>As documented in this <a href="https://github.com/kubernetes/kubernetes/blob/release-1.2/docs/design/horizontal-pod-autoscaler.md#autoscaling-algorithm" rel="nofollow">doc</a>, there are two factors affect the reaction time of the autoscaler:</p> <ol> <li><p><code>--horizontal-pod-autoscaler-sync-period</code>, whi...
<p>I have created a <a href="http://kubernetes.io/v1.1/docs/user-guide/horizontal-pod-autoscaler.html" rel="noreferrer">Kubernetes autoscaler</a>, but I need to change its parameters. How do I update it?</p> <p>I've tried the following, but it fails:</p> <pre><code>βœ— kubectl autoscale -f docker/production/web-control...
<p>You can always interactively edit the resources in your cluster. For your autoscale controller called <code>web</code>, you can edit it via:</p> <pre><code>kubectl edit hpa web </code></pre> <p>If you're looking for a more programmatic way to update your horizontal pod autoscaler, you would have better luck descri...
<p>I am working on a new project with Kubernetes and I need three environments: DEV,QA and PROD.</p> <p>What is most recommended, create Multiple Clusters or create one big cluster separating environments by namespace.</p>
<p>Are you just going to have a single prod cluster or multiple prod clusters? One thing to consider is that updating the cluster management software (to a new k8s release) can impact your application. If you only plan to have a single prod cluster, I'd recommend running qa and dev separately so that you can upgrade th...
<p>I have followed the helloword tutorial on <a href="http://kubernetes.io/docs/hellonode/" rel="noreferrer">http://kubernetes.io/docs/hellonode/</a>.</p> <p>When I run:</p> <pre><code>kubectl run hello-node --image=gcr.io/PROJECT_ID/hello-node:v1 --port=8080 </code></pre> <p>I get:</p> <blockquote> <p>The connection t...
<p>The issue is that your <code>kubeconfig</code> is not right. To auto-generate it run:</p> <pre><code>gcloud container clusters get-credentials "CLUSTER NAME" </code></pre> <p>This worked for me.</p>
<p>How can I modify the values in a Kubernetes <code>secret</code> using <code>kubectl</code>?</p> <p>I created the secret with <code>kubernetes create secret generic</code>, but there does not seem to be a way to modify a secret. For example, to add a new secret-value to it, or to change a secret-value in it.</p> <p>I...
<p>The most direct (and interactive) way should be to execute <code>kubectl edit secret &lt;my secret&gt;</code>. Run <code>kubectl get secrets</code> if you'd like to see the list of secrets managed by Kubernetes.</p>
<p>I'm working <a href="https://github.com/kubernetes/kubernetes/issues/23864" rel="nofollow">to add port range support to kubernetes</a> so I need to modify the API and schemas to support a new parameter: portrange instead of the traditional port. To do it, I've follow <a href="https://github.com/kubernetes/kubernetes...
<p>You need to register the API in the APIServer code. See:</p> <p><a href="https://github.com/kubernetes/kubernetes/blob/master/pkg/master/master.go#L245" rel="nofollow">https://github.com/kubernetes/kubernetes/blob/master/pkg/master/master.go#L245</a></p> <p>for an example for v1beta1.</p>
<p>Every time a deployment gets updated, a new replica set is added to a long list. Should the old rs be cleaned?</p>
<p>Removing old replicasets is part of the Deployment object, but it is optional. You can set <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#revision-history-limit" rel="noreferrer"><code>.spec.revisionHistoryLimit</code></a> to tell the Deployment how many old replicasets to keep around...
<p>According to Kubernetes <a href="http://kubernetes.io/docs/admin/cluster-management/" rel="nofollow">documentation</a>, </p> <blockquote> <p>If you are using GCE, you can configure your cluster so that the number of nodes will be automatically scaled based on:</p> <ul> <li>CPU and memory utilization.</li> ...
<p>The disclaimer at the bottom of that section explains why it won't work by default in GKE:</p> <blockquote> <p>Note that autoscaling will work properly only if node metrics are accessible in Google Cloud Monitoring. To make the metrics accessible, you need to create your cluster with KUBE_ENABLE_CLUSTER_MONITORIN...
<p>I am working on a new project with Kubernetes and I need three environments: DEV,QA and PROD.</p> <p>What is most recommended, create Multiple Clusters or create one big cluster separating environments by namespace.</p>
<p>Namespaces will not bring you isolation, at the moment it's just a different subdomain in dns. It's better to have namespace per application. I highly recommend you to have two clusters for prod (in case of updating k8s) and one-two for dev/qa.</p>
<p>Is there anything special about running ingress controllers on Kubernetes CoreOS Vagrant Multi-Machine? I followed the example but when I run <code>kubectl -f</code> I do not get an address.</p> <p>Example:</p> <p><a href="http://kubernetes.io/v1.1/docs/user-guide/ingress.html#single-service-ingress" rel="nofollow...
<p>With a lot help from kubernetes irc and slack, I fixed this a while back. If I remember correctly, I had the ingress service listening on a port that was already being used, I think for vagrant. These commands really help:</p> <pre><code>kubectl get pod &lt;nginx-ingress pod&gt; -o json kubectl exec &lt;nginx-ingre...
<p>I wondered about how kubelet communicates with docker containers. Where this configuration has defined? I searched a lot but didn't find anything informative. I am using https kube API server. I am able to create pods but containers are not getting spawned ? Any one knows what may be the cause ? Thanks in advance. <...
<p>Kubelet talks to the docker daemon using the docker API over the docker socket. You can override this with <code>--docker-endpoint=</code> argument to the kubelet.</p> <p>Pods may not be being spwaned for any number of reasons. Check the logs of your scheduler, controller-manager and kubelet.</p>
<p>After writing a skydns-svc.yml file with the IP 192.168.3.10 I recieve the following error:</p> <pre><code>Error: The Service "kube-dns" is invalid:spec.clusterIP: Invalid value: "192.168.3.10": provided IP is not in the valid range </code></pre> <p>skydns-svc.yml</p> <pre><code>apiVersion: v1 kind: Service metad...
<p>You need to set the clusterIP to an IP in the "SERVICE_CLUSTER_IP_RANGE", which is a CIDR range (typically a /16 or smaller) passed to the kube-apiserver process in the <code>--service-cluster-ip-range</code> flag. If you pick any address in that range you should no longer receive the above error. </p>
<p>Imagine this hypothetical situation (that just bit me in practice):</p> <ol> <li>All worker instances in a Kubernetes cluster die (say due to a spot price fluctuations), and a new one comes back automatically.</li> <li>The scheduler then attempts to schedule pods onto the node in some arbitrary order but they can't...
<p>This is a real problem, and Kubernetes doesn't have Pod QoS guarantees yet.</p> <p>To be completely safe, your cluster should be big enough to handle any expected cluster shrinkage, but that's not always practical.</p> <p>At the moment, manually shrinking the competing, lower-priority deployments would probably be...
<p>Is there a way to programmatically get the name of the pod that a container belongs to in Kubernetes? If so how? I'm using fabric8's java client but curl or something similar will be fine as well.</p> <p>Note that I don't want to find the pod using a specific label since then (I assume) I may not always find the ri...
<p>You can tell Kubernetes to put the pod name in an environment variable of your choice using the <a href="http://kubernetes.io/docs/user-guide/downward-api/" rel="noreferrer">downward API</a>.</p> <p>For example:</p> <pre><code>apiVersion: v1 kind: Pod metadata: name: dapi-test-pod spec: containers: - name:...
<p>How do I achieve cross-region load balancing on Google Container Engine?</p> <p>I will have one Kubernetes cluster per region in several regions and I need to route traffic from a single domain name to the geographically closest cluster.</p> <p>Some options I've investigated:</p> <ul> <li><strong>Kubernetes LoadB...
<p>Google's <a href="https://cloud.google.com/compute/docs/load-balancing/network/" rel="nofollow noreferrer">Network load balancing</a> (L3) load balancing is specifically per-region (these are the load balancers that are automatically configured if you create a service of type <code>LoadBalancer</code>). As Alex ment...
<p>If I forwarded a port using </p> <pre><code>kubectl port-forward mypod 9000:9000 </code></pre> <p>How can I undo that so that I can bind port 9000 with another program?<br> Additionally, how can I test to see what ports are forwarded?</p>
<p>The port is only forwarded while the kubectl process is running, so you can just kill the kubectl process that's forwarding the port. In most cases that'll just mean pressing CTRL+C in the terminal where the port-forward command is running.</p>
<p>I've been experimenting with the fabric8 events() API in my attempts to get a working solution for <a href="https://stackoverflow.com/questions/37020369/best-way-in-kubernetes-to-receive-notifications-of-errors-when-instantiating-res">this question</a> that I asked a while back.</p> <p>The answer to the aforementi...
<p>Looking at the stack trace indicates your using an older version of the fabric8 kubernetes client (we migrated to okhttp from async-http-client a while back). First you need to upgrade to the latest version (<code>io.fabric8:kubernetes-client:1.3.90</code> at time of writing). Here's a snippet for watching events:</...
<p>I am using the standard <a href="https://github.com/kubernetes/contrib/tree/master/ingress/controllers/gce#the-ingress" rel="nofollow">L7 load balancing ingress</a> on <a href="https://cloud.google.com/container-engine/" rel="nofollow">Google Container Engine</a>. I have installed it through the following ingress de...
<p>Apparently, the L7 ingress doesn't currently monitor the TLS secret for changes. But <a href="https://github.com/kubernetes/contrib/pull/791" rel="nofollow">a PR</a> to solve this has been merged, so it should only be a matter of time.</p>
<p>I'm trying to run my first kubernetes pod locally. I've run the following command (from <a href="http://kubernetes.io/docs/getting-started-guides/docker/" rel="noreferrer">here</a>):</p> <pre><code>export ARCH=amd64 docker run -d \ --volume=/:/rootfs:ro \ --volume=/sys:/sys:ro \ --volume=/var/lib/docker...
<p>By default Kubernetes looks in the public Docker registry to find images. If your image doesn't exist there it won't be able to pull it.</p> <p>You can run a local Kubernetes registry with the <a href="https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/registry" rel="noreferrer">registry cluster ad...
<p>I've created a deployment like this:</p> <pre><code>kubectl run my-app --image=ecr.us-east-1.amazonaws.com/my-app:v1 -l name=my-app --replicas=1 </code></pre> <p>Now I goto the Kubernetes Dashboard:</p> <pre><code>https://172.0.0.1/api/v1/proxy/namespaces/kube-system/services/kubernetes-dashboard </code></pre> <...
<p>Kubernetes Dashboard is pretty limited at the moment, and only supports ReplicationControllers. If you create a ReplicationController then you will be able to see the Pods connected to it, check their memory and CPU usage, and view their logs.</p> <p>Work is being done to improve Dashboard and in the future it shou...
<p>I have a ReplicationController containing two containers in a pod, the first is a long-living pod, the second does a few maintenance tasks when the RC starts up a POD. However as the second container is short lived, it stops itself when it finishes its start tasks. When Kuberbetes notices this, it kills off the POD...
<p>As you already noticed, by design all containers in a pod are destined to live and die together. It's a bit hard to tell what your best alternative would be without knowing what kind of maintenance task your sidekick needs to perform exactly. Generally speaking, I can think of three approaches:</p> <ol> <li><p>Keep...
<p><strong>Background:</strong></p> <p>Currently we're using Docker and Docker Compose for our services. We have externalized the configuration for different environments into files that define environment variables read by the application. For example a <code>prod.env</code> file:</p> <pre><code>ENV_VAR_ONE=Somethin...
<p>You can populate a container's environment variables through the use of <a href="http://kubernetes.io/docs/user-guide/secrets/" rel="noreferrer">Secrets</a> or <a href="http://kubernetes.io/docs/user-guide/configmap/" rel="noreferrer">ConfigMaps</a>. Use Secrets when the data you are working with is sensitive (e.g. ...
<p>Due to limitations of <a href="http://kubernetes.io/docs/user-guide/ingress/" rel="nofollow">ingress resources</a> (in my case I need more than 50 routes which is not supported in Google Container Engine) I'm considering using Nginx as a reverse proxy to other backend services. What I want to do is essentially the s...
<p>ConfigMaps containing text-files should be no problem at all. Take a look at the <code>--from-file</code> option: <a href="http://kubernetes.io/docs/user-guide/configmap/" rel="nofollow">http://kubernetes.io/docs/user-guide/configmap/</a>.</p> <p>Im unsure about binary files inside a ConfigMap. I'm able to add a JP...
<p>I am brand new to Docker, so I apologize for any ignorance.</p> <p>I have a web API which needs to trigger a Python script to run. The script is very resource intensive (CPU and RAM), so it needs to run on a different server than the API server. I am planning to run this script within a Docker container. I am also ...
<p>Off the top of my head I can think of two approaches, both of which I've used:</p> <ul> <li>If you want the script to start immediately, use <code>CMD</code> or <code>ENTRYPOINT</code> in your Dockerfile to kick off the script at start of the container</li> </ul> <p>So, abstracted, something like this</p> <pre><c...
<p>I have done all kubernetes DNS service config,and test it running ok. but how could I access the pod from serviceName(DNS domain name)?</p> <p><strong>pod list</strong>:</p> <pre><code>[root@localhost ~]# kubectl get pod NAME READY STATUS RESTARTS AGE bj001-y1o2i 3/3 Running 12 ...
<p>I have found my fault. kubernetes use iptables to transmit with different pod. So we should do that all we used port should be seted in the {spec.ports}, like my issue, the 18010 port must be opened.</p> <pre><code>[root@localhost ~]# kb get svc NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECT...
<p>I'm sharing the same cluster for 2 <em>namespaces</em>: <strong>staging</strong> and <strong>production</strong>. The only differences among the two namespaces are:</p> <ol> <li>Volumes mounted to certain pods (separate persistence between <strong>staging</strong> and <strong>production</strong>, obviously!)</li> <...
<p>You could probably create one <a href="http://kubernetes.io/docs/user-guide/persistent-volumes/#persistentvolumeclaims" rel="nofollow noreferrer" title="PersistentVolumeClaim">PersistentVolumeClaim</a> in each namespace. Take a look at <a href="https://stackoverflow.com/questions/34282704/can-a-pvc-be-bound-to-a-spe...
<p>I am using glog flag log_dir in my project. Recently I imported kubernetes library and started getting this runtime panic</p> <p>panic: ./aaa.test flag redefined: log_dir</p> <pre><code>May 16 23:51:35 ecmdev03-core01 docker[26867]: goroutine 1 [running]: May 16 23:51:35 ecmdev03-core01 docker[26867]: panic(0x15eb...
<p>That error doesn't have to do with conflicting libraries, it is a conflicting flag (<code>log_dir</code>). It means you're adding a "--log_dir" flag, and the glog library used by kubernetes also has a <code>log_dir</code> flag. This is a problem with adding flags in libraries during package init. Unfortunately vendo...
<p>Using Kubernetes 1.2.4, why does my below <a href="http://kubernetes.io/docs/user-guide/deployments/" rel="noreferrer">Deployment</a> definition (redis.yaml) cause the following error?</p> <pre><code>$ kubectl apply -f redis.yaml error validating "redis.yaml": error validating data: found invalid field name for v1b...
<p>Selector directives in Deployments <a href="http://kubernetes.io/docs/user-guide/labels/#resources-that-support-set-based-requirements" rel="noreferrer">require</a> you to use a sub-field of either <code>matchLabels</code> or <code>matchExpressions</code>, so in my case I need to make use of <code>matchLabels</code>...
<p>I was just wondering how to manually set the external endpoint used by the Kubernetes web dashboard.</p> <p>After creating the namespace <em>kube-system</em>, I ran the following:</p> <pre><code>kubectl create -f https://rawgit.com/kubernetes/dashboard/master/src/deploy/kubernetes-dashboard.yaml </code></pre> <p>...
<p>You can specify the desired port as the <code>nodePort</code> in the yaml spec that you use to create the service. In this case, where the yaml file you linked to defines the service as:</p> <pre><code>- kind: Service apiVersion: v1 metadata: labels: app: kubernetes-dashboard kubernetes.io/clust...
<p><code>kube-apiserver</code> does not seem to provide an option to use a certification revocation list (CRL).</p> <p>Is there a way to revoke a client certificate if it's lost or not used anymore?</p>
<p>As far as I know there isn't a way to directly revoke certificates via a CRL. However, what does work, and what we are currently using, is <strong><a href="http://kubernetes.io/docs/admin/authorization/" rel="nofollow">ABAC policies</a></strong> to identify users (set via the Common Name of a certificate), and whet...
<p>I have created the replication controller in Kubernetes with the following configuration:</p> <pre><code>{ "kind":"ReplicationController", "apiVersion":"v1", "metadata":{ "name":"guestbook", "labels":{ "app":"guestbook" } }, "spec":{ "replicas":1, "selector":{ ...
<p>I fixed the error. </p> <p>The thing was in the actual service. It needs to be listening on 0.0.0.0 instead of 127.0.0.1 or localhost. That way it will listen on every available network interface. More details on the difference between 0.0.0.0 and 127.0.0.1: <a href="https://serverfault.com/questions/78048/whats-th...
<p>I'm following the <a href="http://kubernetes.io/docs/hellonode/" rel="nofollow">hello node Kubernetes tutorial</a> but when I get to the step of pushing my machine to google cloud with the command:</p> <p><code>gcloud docker push gcr.io/PROJECT_ID/hello-node:v1</code></p> <p>I get the following error message:</p>...
<p>You should replace <code>PROJECT_ID</code> with the alphanumeric ID of your project (e.g. "my-project-123").</p>
<p>I am trying to assign <strong>clusterIP</strong> to a <strong>Service</strong> in the kube cluster. I know the IP range, so that I can form new IPs from that IP range.</p> <p>I am implementing proxy within containers. So I need to know the clusterIP of the depending services, so that I can do a proxy from the sourc...
<p>You can look at all services in all namespaces using:</p> <pre><code>kubectl get services --all-namespaces </code></pre> <p>It's likely that a service in the <code>kube-system</code> namespace has the 10.7.240.2 address. </p>
<p>Im using fabric8 Kubernetes Java Client and Im accessing Kubernetes through HTTP, I followed the example from <a href="https://github.com/fabric8io/kubernetes-client/blob/master/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/ExecExample.java" rel="nofollow">fabric8</a> but I get the following erro...
<p>I found out that this has to do with http2, because Kubernetes exec uses SPDY, the problem went away when I upgraded to curl version > 7.36 and installed nghttp2 on the server.</p> <p>After installing curl I was able to get the response by adding some headers</p> <p><code>curl -H "Connection: upgrade" -H "Upgrade:...
<p>I'm trying to run an interactive Pod (container) in Kubernetes that does not create a Job or Deployment and deletes itself after completing. </p> <p>The purpose of the container is to give our developers an easy way to access our database, which doesn't have a public IP address.</p> <p>Currently, we are using this...
<p>Adding the "--rm" flag to the original command resulted in the Job (and Pod) being deleted at the completion of the interactive session, which is what I was after. The command then becomes:</p> <pre><code>kubectl run -i --tty --rm proxy-pgclient --image=private-registry.com/pgclient --restart=Never --env="PGPASSWOR...
<p>My container engine cluster has a red exclamation mark next to its name in the Google cloud console overview of the container engine. A tooltip says "<strong>The cluster has a problem. Click the cluster name for details.</strong>" Once I click the name I don't get any more infos, it's just the usual summary. Stackdr...
<p>Are you able to use other <code>kubectl</code> commands such as <code>kubectl get pods</code>?</p> <p>This sounds like the cluster isn't set up correctly or there's some network issue. Would you also try <code>kubectl config view</code> to see how your cluster is configured? More specifically, look for <code>curren...
<p>I'm new to Kubernetes - I've worked with docker-compose until now (on one machine). Now I want to expend my work to cluster of nodes and to get Kubernetes capabilities (service discovery, load balancing, health check etc).</p> <p>I'm working in local servers (RHEL7) and trying to run my first Kubernetes environment...
<p>It means there's no available nodes in the system for the pods to be scheduled on. Can you provide the output of <code>kubectl get nodes</code> and <code>kubectl describe nodes</code>?</p> <p>Following steps descirbed in the local cluster doc should give you a single node. If your node is there (it should be) but j...
<p>I use the K8s example the create a Reliable, Scalable Redis on Kubernetes. <a href="https://github.com/kubernetes/kubernetes/tree/master/examples/redis" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/tree/master/examples/redis</a></p> <p>The Redis master needs to get slave the origin IP and regi...
<p>EDIT: I have figured out the magic combination of flags to get this working.</p> <p>1) run stop docker &amp; the bootstrap docker processes </p> <pre><code>systemctl stop docker &amp;&amp; pkill -f "docker-bootstrap" &amp;&amp; sleep 10 </code></pre> <p>2) Delete iptables rules: </p> <pre><code>iptables -F &...
<p>I understand that openshift comes with its own kubernetes and etcd. But i have already installed kubernetes and etcd. What should i do? what is the differences between Openshift kubernetes an google's? Thanks.</p>
<p>OpenShift is a PaaS layer on top of Kubernetes, so there really isn't a difference in the Kubernetes part of the stack. However, OpenShift embeds many Kubernetes (and Etcd) binaries in their distribution, so it isn't always 100% obvious that Kubernetes is somewhere underneath because you don't interact the the stock...