prompt
stringlengths
65
38.7k
response
stringlengths
41
29.1k
<p>I successfully create Cassandara Petset on Kubernetes cluster in AWS. While, this is a single DC Cassandra cluster. Thinking of adding multiple DC support for cassandra. Say, have one kubernetes cluster in US west, one in US east, one in Europe. I'd like to have cassandra installed on each of those DCs and be able t...
<p>You need to take in consideration the Snitch, Seed Provider and Topology Strategy for Kubernetes, so the nodes are aware of their geographical location and guarantee that copies of the data are set up in all the regions; for this you should have a replication factor that will ensure enough copies. </p> <p>There is ...
<p>In my kubernetes cluster I have several kind of pods. Some pods have to wait for other pods to start. To create a cluster I have to Run all the pods in a particular serial. This requires me to continuously check for states of previous pods. I want to reduce the time taken for creating cluster.</p> <p>I want to expl...
<p>Pet Sets might help you with this.</p> <p><a href="http://kubernetes.io/docs/user-guide/petset/" rel="nofollow">http://kubernetes.io/docs/user-guide/petset/</a></p>
<p>I'd like to use regex in the path of an Ingress rule, but I haven't been able to get it to work. <a href="https://github.com/nginxinc/kubernetes-ingress/blob/master/examples/complete-example/cafe-ingress.yaml" rel="noreferrer">For example</a>:</p> <pre><code>apiVersion: extensions/v1beta1 kind: Ingress metadata: ...
<p>Apparently this question is still getting traffic, so I feel like I should update it. I'm no longer using the nginx ingress, so I can't verify this works. According to <a href="https://kubernetes.github.io/ingress-nginx/user-guide/ingress-path-matching/" rel="nofollow noreferrer">https://kubernetes.github.io/ingress...
<p>When running a Kubernetes cluster on Google Cloud Platform is it possible to somehow have the IP address from service endpoints automatically assigned to a Google CloudDNS record? If so can this be done declaratively within the service YAML definition?</p> <p>Simply put I don't trust that the IP address of my <code...
<p>GKE uses <a href="https://cloud.google.com/deployment-manager/docs/" rel="nofollow">deployment manager</a> to spin new clusters, as well as other resources like Load Balancers. At the moment deployment manager does not allow to integrate Cloud DNS functionality. Nevertheless there is a <a href="https://code.google.c...
<p>I run new modules of my system in Google-Container-Engine. I would like to bring stdout and stderr from them (running in pods) to my centralised logstash. Is there an easy way to forward logs from pods to external logging service, e.g., logstash or elasticsearch?</p>
<p>I decided to log directly to <em>elasticsearch</em>, an external virtual machine that can be access at <code>elasticsearch.c.my-project.internal</code> (I am on Google-Cloud-Platform). It is quite easy:</p> <ol> <li><p>Setup an ExternalService with name: <em>elasticsearch</em> that points to the elasticsearch instan...
<p>I have deployed my application on Google <code>gcloud</code> container engine. My application required <code>MySQL</code>. Application is running fine and connecting to <code>MySQL</code> correctly. But I want to connect <code>MySQL</code> database from my local machine using <code>MySQL</code> Client (<code>Workben...
<p>Try the <code>kubectl port-forward</code> command.</p> <p>In your case; <code>kubectl port-forward app-mysql-3323704556-nce3w 3306:3306</code></p> <p>See <a href="https://kubernetes.io/docs/user-guide/kubectl/kubectl_port-forward" rel="noreferrer">The documentation</a> for all available options.</p>
<ol> <li>In <code>kubernetes</code> I can expose services with <code>service</code>. This is fine.</li> <li>Lets say I have 1 web instance and 10 java server instances.</li> <li>I have a windows gateway I'm used to access those 10 java servers instances via the jconsole installed on it.</li> <li>Obviously I do not exp...
<p>Another option is to forward JMX port from K8 pod to your local PC with <strong>kubectl port-forward</strong>. </p> <p>I do it like this:</p> <p>1). Add following JVM options to your app:</p> <pre><code>-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote...
<p>I followed the <a href="http://kubernetes.io/v1.0/docs/getting-started-guides/docker.html" rel="noreferrer">Kubernetes docs for setting up a single node cluster as a Docker container</a>. I now have Kubernetes running on a remote Linux VM (say, <code>mykube01.example.com</code>).</p> <p>I then downloaded and instal...
<p>When you created the connection to your master, a file should be created:</p> <pre><code>/etc/kubernetes/kubelet.conf </code></pre> <p>By default, your personal config is empty or missing. So, I copied the above mentioned kubelet.conf file as my <code>~/.kube/config</code> file. Worked perfectly.</p>
<p>I've tried to add fsGroup to a Job with no luck, the generated Pod doesn't include the fsGroup in the security context. Does a Kube Job allow for the fsGroup to be specified and then propagated to the generated Pod?</p>
<p>I'm using Kubernetes 1.4 and successfully created a job with <code>fsGroup</code>. Maybe you misplaced <code>fsGroup</code> in your manifest? This is my manifest:</p> <pre><code>apiVersion: batch/v1 kind: Job metadata: name: hello-world spec: template: metadata: name: hello-world spec: conta...
<p>We are running as hosted Kubernetes cluster on Google Cloud (GKE) and scraping it with Prometheus.</p> <p>My Question is similar to <a href="https://stackoverflow.com/questions/39349744/kubernetes-prometheus-metrics-for-running-pods-and-nodes">this</a> one, but I'd like to know what are the most important metrics t...
<p>etcd is the foundation of Kubernetes. So having a good set of alerts for it is important. We wrote <a href="https://coreos.com/blog/developing-prometheus-alerts-for-etcd.html" rel="noreferrer">this blog post</a> and creating alerting rules for it and provided a base set at the end.</p> <p>Further sources of importa...
<p>I tried to create kubernetes cluster(v1.2.3) on azure with coreos cluster. I followed the documentation (<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>Then I cloned the repo( git clone <a href="http...
<p>Have you had a look at kuberenetes-anywhere (<a href="https://github.com/kubernetes/kubernetes-anywhere" rel="nofollow">https://github.com/kubernetes/kubernetes-anywhere</a>)? Much work has been done there and now probably has all the right bits to deploy out your cluster with Azure specific cloud provider integrati...
<p>I'm running a bare metal Kubernetes cluster and trying to use a Load Balancer to expose my services. I know typically that the Load Balancer is a function of the underlying public cloud, but with recent support for Ingress Controllers it seems like it should now be possible to use nginx as a self-hosted load balance...
<p>This is something that is tested and works for an nginx service created on a particular node.</p> <pre><code>apiVersion: v1 kind: Service metadata: name: nginx namespace: default spec: ports: - port: 80 protocol: TCP targetPort: 80 name: http - port: 443 proto...
<p>I have a Kubernetes cluster on Google Cloud, I have a database service, which is running in front of a mongodb deployment. I also have a series of microservices, which are attempting to connect to that datastore. </p> <p>However, they can't seem to find the host. </p> <pre><code>apiVersion: v1 kind: Service metada...
<p>First, check that the service is created</p> <p><code>kubectl describe svc mongo</code></p> <p>You should see it show that it is both created and routing to your pod's IP. If you're wondering what your pod's IP is you can check it out via</p> <p><code>kubectl get po | grep mongo</code></p> <p>Which should retur...
<p>Where can I find an official template which describes how to create your <code>.yaml</code> file to setup services/pods in Kubernetes?</p>
<p>You can find the specification for a pod here <a href="http://kubernetes.io/docs/api-reference/v1/definitions/#_v1_pod" rel="nofollow noreferrer">http://kubernetes.io/docs/api-reference/v1/definitions/#_v1_pod</a></p> <p>A good starting point is also the examples <a href="https://github.com/kubernetes/kubernetes/tr...
<p>I'm now trying to run a simple container with shell (/bin/bash) on a Kubernetes cluster.</p> <p>I thought that there was a way to keep a container running on a Docker container by using <code>pseudo-tty</code> and detach option (<code>-td</code> option on <code>docker run</code> command).</p> <p>For example,</p> ...
<p>Containers are meant to run to completion. You need to provide your container with a task that will never finish. Something like this should work:</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: v1 kind: Pod metadata: name: ubuntu spec: containers: - name: ubuntu image: ubuntu:latest ...
<p>dear Kubernetes guru's!</p> <p>I have spinned kube 1.4.1 cluster on manually created AWS hosts using 'contrib' Ansible playbook (<a href="https://github.com/kubernetes/contrib/tree/master/ansible" rel="nofollow">https://github.com/kubernetes/contrib/tree/master/ansible</a>). </p> <p>My problem is that Kube doesn't...
<p>Nobody helped me at K8 Slack channels, so after a day of pulling my hair off I found the solution by myself:</p> <p>To get the K8 cluster installed by 'contrib' Ansible playbook (<a href="https://github.com/kubernetes/contrib/tree/master/ansible" rel="noreferrer">https://github.com/kubernetes/contrib/tree/master/an...
<p>After reading <a href="https://stackoverflow.com/questions/29837531/changing-permissions-of-google-container-engine-cluster/">this earlier question</a>, I have some follow-up questions. I have a Google Container Engine cluster which lacks the Cloud Monitoring API Access permission. According to this post I cannot en...
<p>You can keep the same cluster, but create a new <a href="https://cloud.google.com/container-engine/docs/node-pools" rel="noreferrer">Node Pool</a> with the new scopes you need (and then delete your old "default" Node Pool):</p> <pre><code>gcloud container node-pools create new-np --cluster $CLUSTER --scopes monitor...
<p>I am working on a mac machine and installed the latest Kubernetes and followed the <a href="https://medium.com/@claudiopro/getting-started-with-kubernetes-via-minikube-ada8c7a29620#.xfrpcgv50" rel="nofollow">example here</a> (this is for dev’t purpose). All went smooth but I was hoping that Kubernetes provide me an ...
<p>I followed the steps in the article you linked and it works as expected.</p> <p>Just do:</p> <pre><code>minikube service hello-minikube --url </code></pre> <p>You will get a url like <code>http://192.168.99.100:32382/</code> - the port and IP could and will change for you. Also note that the exposed port will be ...
<p>So we have a deployment that is using rolling updates. We need it to pause 180 seconds between each pod it brings up. My understanding is that I need to set <code>MinReadySeconds: 180</code> and to set the <code>RollingUpdateStrategy.MaxUnavailable: 1</code> and <code>RollingUpdateStrategy.MaxSurge: 1</code> for the...
<p>Assuming that a pod is ready after a certain delay is not very idiomatic within an orchestrator like Kubernetes, as there may be something that prevents the pod from successfully starting, or maybe delays the start by another few seconds.</p> <p>Instead, you could use <a href="https://kubernetes.io/docs/tasks/config...
<p>I am trying to automate the update to the deployment using </p> <pre><code>kubectl set </code></pre> <p>I have no issues using kubectl set image command to push new version of the docker image out, but I also need to add a new persistent disk for the new image to use. I don't believe i can set 2 different options ...
<p><a href="http://kubernetes.io/docs/user-guide/managing-deployments/#in-place-updates-of-resources" rel="nofollow">http://kubernetes.io/docs/user-guide/managing-deployments/#in-place-updates-of-resources</a> has the different options you have.</p> <hr> <p>You can use <a href="http://kubernetes.io/docs/user-guide/ku...
<p>I'm trying to get an openzipkin server running in a k8s cluster, starting with testing in a minikube. I'm beginner with k8s config, but here's what I've done so far:</p> <pre><code>$ minikube start $ eval $(minikube docker-env) $ kubectl run zipkin --image=openzipkin/zipkin --port=9411 $ kubectl expose deployment z...
<p>The web app is trying to access <code>config.json</code> at root (accessing as <code>/config.json</code> vs just <code>config.json</code> ) - that is <a href="http://localhost:8001/config.json" rel="nofollow">http://localhost:8001/config.json</a> . This would obviously be wrong as it should be <a href="http://localh...
<p>I installed minikube to use kubernetes locally. I was able to create pods and services locally.</p> <p>However, pods (and containers) running on them, cannot resolve services using service names. </p> <p>Example: I have redis service running that acts a proxy for redis pods. </p> <p><code>kubectl get services</co...
<p>You need to expose your services as <code>type: NodePort</code> in minikube instead of <code>ClusterIP</code></p> <p>You can then access them with <code>minikube service &lt;servicename&gt;</code> </p> <p>(or you can find out which port they were mapped manually to with <code>kubectl get services</code>)</p>
<h2>Trying to set up PetSet using Kube-Solo</h2> <p>In my local dev environment, I have set up Kube-Solo with CoreOS. I'm trying to deploy a Kubernetes PetSet that includes a Persistent Volume Claim Template as part of the PetSet configuration. This configuration fails and none of the pods are ever started. Here is my...
<p><strong>I am not familiar with kube-solo.</strong></p> <p>However, the issue here might be that you are attempting to use a feature, <a href="http://blog.kubernetes.io/2016/10/dynamic-provisioning-and-storage-in-kubernetes.html" rel="nofollow">dynamic volume provisioning</a>, which is in beta, which does not have s...
<p>I am following up guide [1] to create multi-node K8S cluster which has 1 master and 2 nodes. Also, a label needs to set to each node respectively.</p> <pre><code>Node 1 - label name=orders Node 2 - label name=payment </code></pre> <p>I know that above could be achieved running kubectl command</p> <pre><code>kube...
<p>In fact there is a trivial way to achieve that since 1.3 or something like that. </p> <p>What is responsible for registering your node is the kubelet process launched on it, all you need to do is pass it a flag like this <code>--node-labels 'role=kubemaster'</code>. This is how I differentiate nodes between differe...
<p>Having set the default gce ingress controller working with ingresses resources set to respond to hostnames</p> <p>The advantage of having a static ip (in my very current point of view) is that you never wonder where to configure your domain to, it will always remain the same ip; and on the other side you can stick ...
<p>Finally I have a working solution. You gotta add an L4 Service using <code>loadBalancerIP: x.x.x.x</code> where you put a previously reserved static IP, and then put a selector that the deployment/RC already has, like this:</p> <blockquote> <p>UPDATE [Nov-2017]: Static IP should be regional and in the same region...
<p>is there a way to tell kubectl that my pods should only deployed on a certain instance pool?</p> <p>For example:</p> <pre><code>nodeSelector: pool: poolname </code></pre> <p>Assumed i created already my pool with something like:</p> <pre><code>gcloud container node-pools create poolname --cluster=cluster-1...
<p>Ok, i found out a solution:</p> <p>gcloud creates a label for the pool name. In my manifest i just dropped that under the node selector. Very easy.</p> <p>Here comes my manifest.yaml: i deploy ipyparallel with kubernetes</p> <pre><code>apiVersion: extensions/v1beta1 kind: Deployment metadata: name: ipengine spe...
<p>Is it reasonable to use Kubernetes for a clustered database such as MySQL in production environment? </p> <p>There are example configurations such as <a href="https://github.com/eBay/Kubernetes/tree/master/examples/mysql-galera" rel="noreferrer">mysql galera example</a>. However, most examples do not make use of pe...
<p>The Kubernetes project introduced <a href="http://kubernetes.io/docs/user-guide/petset/" rel="nofollow">PetSets</a>, a new pod management abstraction, intended to run stateful applications. <strong>It is an alpha feature at present</strong> (as of version 1.4) and moving rapidly. A list of the various issues as we ...
<p>I recently got started to learn Kubernetes by using Minikube locally in my Mac. Previously, I was able to start a local Kubernetes cluster with Minikube 0.10.0, created a deployment and viewed Kubernetes dashboard. </p> <p>Yesterday I tried to delete the cluster and re-did everything from scratch. However, I found ...
<p>It turned out to be a network problem in my case.</p> <p>The pod status is &quot;ContainerCreating&quot;, and I found during container creation, docker image will be pulled from gcr.io, which is inaccessible in China (blocked by GFW). Previous time it worked for me because I happened to connect to it via a VPN.</p>
<p>I have the following image created by a Dockerfile:</p> <pre><code>REPOSITORY TAG IMAGE ID CREATED SIZE ruby/lab latest f1903b1508cb 2 hours ago 729.6 MB </code></pre> <p>And I have my following YAML file:</p> <pre><code>apiVersion: extensions/v1beta1 kind: Deployment metadata: nam...
<p>You can point your docker client to the VM's docker daemon by running </p> <pre><code>eval $(minikube docker-env) </code></pre> <p>Then you can build your image normally and create your kubernetes resources normally using kubectl. Make sure that you have </p> <pre><code>imagePullPolicy: IfNotPresent </code></pre...
<p>I'm working on a setup where we run our Java services in docker containers hosted on a kubernetes platform. </p> <p>On want to create a dashboard where I can monitor the heap usage of all instances of a service in my grafana. Writing metrics to statsd with the pattern:</p> <p><code>&lt;servicename&gt;.&lt;containe...
<p>This can happen for 2 reasons, because grafana is using the "connected" setting for null values, and/or (as is the case here) because statsd is sending the previously-seen value for the gauge when there are no updates in the current period.</p> <h2>Grafana Config</h2> <p>You'll want to make 2 adjustments to your g...
<p>I'm repeatedly seeing something like;</p> <blockquote> <p>Warning FailedSync Error syncing pod, skipping: failed to "StartContainer" for "some-service" with RunContainerError: "GenerateRunContainerOptions: Couldn't find key app-id in ConfigMap default/intercom"</p> </blockquote> <p>Where the deploym...
<p>Your configmap only contains a single key: <code>intercom</code></p>
<blockquote> <p>FailedMount MountVolume.SetUp failed for volume "kubernetes.io/glusterfs/f8c3bcce-42010a80007d-glusterfsmilogvol" (spec.Name: "glusterfsmilogvol") pod "f8c3bcce-42010a80007d" (UID: "f8c3bcce--42010a80007d") with: glusterfs: mount failed: mount failed: exit status 32 Mounting arguments: IPAdd...
<p>Further Analysis revealed that I am on Kubernetes 1.4, which has gci as image-type for the node. <a href="https://cloud.google.com/container-engine/docs/node-image-migration" rel="nofollow">https://cloud.google.com/container-engine/docs/node-image-migration</a> Since Kubernetes 1.4, gci image is defaulted for GKE Co...
<p>I'm in the need of learning how to use Kubernetes. I've read the first sentences of a couple of introductory tutorials, and never have found one which explains me, step by step, how to build a simulated real world example on a single computer.</p> <p>Is Kubernetes by nature so distributed that even the 101-level tu...
<p>The easiest might be <a href="https://github.com/kubernetes/minikube" rel="nofollow">minikube</a>.</p> <blockquote> <p>Minikube is a tool that makes it easy to run Kubernetes locally. Minikube runs a single-node Kubernetes cluster inside a VM on your laptop for users looking to try out Kubernetes or develop w...
<p>Very simple and common case, i have 2 pods in cluser:</p> <ol> <li>wordpress blog + mysql</li> <li>nginx serving static web site</li> </ol> <p>I want to show static web site when user load <a href="http://my-site.com" rel="nofollow">http://my-site.com</a> and show blog when user will do <a href="http://my-site/blo...
<p>One way to accomplish this may be to use an ingress resource. You could make the two services and then point at them from the ingress resource.</p> <p>Reference: <a href="http://kubernetes.io/docs/user-guide/ingress/#simple-fanout" rel="nofollow">Simple fanout using ingress resources.</a></p>
<p>I am trying to mount a GCE persistent disk in a kubernetes pod via the deployment object yaml. I am observing this behavior that as long as the node (on which the pod resides) is in the same zone as the persistent disk (say us-central1-a), the mounting succeeds. However, if there are in different zones (say node i...
<p>You can use this nodeSelector:</p> <pre><code> nodeSelector: failure-domain.beta.kubernetes.io/zone: us-central1-b </code></pre>
<p>I have a pod that is being run as an individual pod created from the API directly and not from kubectl. I can confirm the only container within the pod is running and it is logging when I go directly to the node and run <code>docker logs -f &lt;container id&gt;</code> but when I do a <code>kubectl logs -f &lt;pod ...
<p>The issue was that the container in the pod was set as a TTY enabled container which caused the process inside the container to have a prompt that was blocking any logs from being sent out to the connection kubectl opens up.</p>
<p>I'm trying to get a good understanding of container technologies but am somewhat confused. It seems like certain technologies overlap different portions of the stack and different pieces of different technologies can be used as the DevOps team sees fit (e.g., can use Docker containers but don't have to use the Docke...
<p>This may be a bit long and present some oversimplification but should be sufficient to get the idea across.</p> <h1>Physical machines</h1> <p>Some time ago, the best way to deploy simple applications was to simply buy a new webserver, install your favorite operating system on it, and run your applications there. <...
<p>Having a 'working' cluster based on the following example : <a href="https://github.com/jetstack/kube-lego/tree/master/examples/nginx" rel="nofollow">https://github.com/jetstack/kube-lego/tree/master/examples/nginx</a></p> <p>With the above config for the RC, I keep having the following error when looking at the lo...
<p>Note that LB health checks are part of the gce infra and differ from k8s internal pod healthchecks.</p> <p>see <a href="https://stackoverflow.com/questions/34648176/is-the-google-container-engine-kubernetes-service-loadbalancer-sending-traffic-t">Is the Google Container Engine Kubernetes Service LoadBalancer sendin...
<p>As the title says, I am looking for a way to force a LoadBalancer service to use a predefined security group in AWS. I do not want to have to manually edit the inbound/outbound rules of the security group that is created for the ELB by Kubernetes. I have not been able to find anything within the documentation, nor h...
<p>EDIT: 2021 - I am told my answer is now out of date, refer to stackoverflow.com/a/70162565/699493 instead.</p> <p>You cannot prevent Kubernetes from creating a new security group. But since Andonaeus' answer was submitted a new feature has been added which allows for explicitly defining inbound permissions via your ...
<p>I have been looking into Docker containerization for a while now but few things are still confusing to me. I understand that all the containers are grouped into a cluster and cluster management tools like Docker Swarm, DC/OS, Kubernetes or Rancher can be used to manage docker containers. I have been testing out Cont...
<p>Kubernetes has concept called <code>service</code>. A Kubernetes Service is an abstraction which defines a logical set of Pods and a policy by which to access them. Kubernetes uses services to serve traffic from multiple containers. You can read more about services <a href="http://kubernetes.io/docs/user-guide/servi...
<p>As part of the PetSet definition, the volumeClainTemplates are defined for Kubernetes to dynamically generate Persistent Volume Claims. For example:</p> <pre><code> volumeClaimTemplates: - metadata: name: datadir annotations: volume.alpha.kubernetes.io/storage-class: anything spec: ...
<p><code>volumeClaimTemplates</code> is an array of <code>PersistentVolumeClaim</code>. You can try to define them using <code>selector</code> and label existing volumes somehow, i.e.:</p> <pre><code>kind: PersistentVolume apiVersion: v1 metadata: name: pv0001 labels: foo: foo bar: bar spec: accessModes:...
<p>I need a bash script to delete only pods on specific node before shutdown or reboot using Kubernetes API.</p>
<p>Found a solution that works for what I'm trying to achieve:</p> <pre><code>for each in $(curl -XGET https://URL/api/v1/namespaces | jq -r '.items[].metadata.name'); do arr=($(curl -XGET https://URL/api/v1/namespaces/$each/pods | jq --arg node `hostname` -r '.items[] | select(.spec.nodeName == $node) | .metadat...
<p>I have been using init-containers since they became available and find them super useful. My core image (below as web-dev) does not change much, but my init-container image (below as web-data-dev) does change often.</p> <p>The init-container uses a container image with a version number. I change this version number...
<p>If you are using Kubernetes 1.4, try to change <code>pod.alpha.kubernetes.io/init-containers</code> to <code>pod.beta.kubernetes.io/init-containers</code>.</p> <p>I can't find a proper issue on GitHub, but behaviour of these two annotations is different. I can do <code>kubectl apply -f</code> with the second one an...
<p>I am having an issue with some (but not all) HPAs in my cluster stopping updating their CPU utilization. This appears to happen after some different HPA scales its target deployment.</p> <p>Running <code>kubectl describe hpa</code> on the affected HPA yields these events:</p> <pre><code> 56m &lt;invalid&gt;...
<p>It is not correct to set up more than one HPA pointing to the same target deployment. When two different HPAs point to the same target (as described here), behavior of the system may be weird.</p>
<p>When creating a headless service in Kubernetes, it auto-generates the CNAME for each pod. I need to access this hostname somehow on pod boot. I can't seem to find it in the downward API or set in any kind of environment variable. Where can I get this value from within the pod itself, or is it even possible?</p> <p>...
<p>It sounds like you want to treat your pods as pets, not cattle. Maybe you can try to use <a href="http://kubernetes.io/docs/user-guide/petset/" rel="nofollow"><code>PetSet</code></a>s and headless <code>Service</code>? Then you will have the <a href="http://kubernetes.io/docs/user-guide/petset/#network-identity" rel...
<p>I have a web app running Kubernetes behind an nginx ingress controller, it works fine for request browsing, but any AJAX/XMLHTTPRequest from the browser gets a 502 error from nginx.</p> <p>I captured the HTTP headers for both regular and AJAX request that they look fine, correct Host header, protocol, etc. I am con...
<p>I resolved the issue. The reason that only XmlHttpRequests failed was because the application has a special behavior when it saw an XmlHttpRequest request, where it dumped about 3000 bytes of extra headers into the response. This made the total header size larger than the default nginx header buffer.</p> <p>nginx c...
<p>I'm running an nginx service in a docker container with Google Container Engine which forwards specific domain names to other services, like API, Frontend, etc. I have simple cluster for that with configured services. Nginx Service is Load Balance.</p> <p>The REMOTE_ADDR environmental variable always contains an in...
<p>With the current implementation of L3 balancing (as of Kubernetes 1.4) it isn't possible to get the source IP address for a connection to your service. </p> <p>It sounds like your use case might be well served by using an <a href="http://kubernetes.io/docs/user-guide/ingress/" rel="nofollow">Ingress</a> object (or ...
<p>I have been looking into Docker containerization for a while now but few things are still confusing to me. I understand that all the containers are grouped into a cluster and cluster management tools like Docker Swarm, DC/OS, Kubernetes or Rancher can be used to manage docker containers. I have been testing out Cont...
<p>The autoscaling in DC/OS (note: Mesosphere is the company, DC/OS the open source project) the autoscaling is described in detail in the <a href="https://dcos.io/docs/1.8/usage/tutorials/autoscaling/" rel="nofollow">docs</a>. Essentially the same as with Kubernetes, you can use either low-level metrics such as CPU ut...
<p>Currently playing with kubernetes, I need to deploy a cluster by myself on my own hardware or cloud provider (I would love to use GCE but it is not possible in a near future).</p> <p>I saw kubeadm allow a quick and easy cluster bootstrapping except it does only provide one kubernetes master. </p> <p>As I'm looking...
<p>I am also trying to bring up some experimental setups using ubu 16.04 and kubeadm, with the following experience:</p> <p>the master reboot situation is the most critical point with kubeadm, as the cluster is not booting up properly after a reboot. Another SO user reported the issue <a href="https://stackoverflow.co...
<p>Imagine I got a Kubernetes cluster which has 3 pods and each pod has its own value for the label 'name' and what I actually want is each time I run/open my app, I'd see the name of pod (so its label's value) on console output. Of course the output/value may be different each time, based on which pod is being used. ...
<p>You can use Kubernete's <a href="http://kubernetes.io/docs/user-guide/downward-api/" rel="nofollow">Downward API</a> to Convey Pod Properties to the containers inside the pods without having to use Kubernete's REST API. From the docs:</p> <blockquote> <p>It is sometimes useful for a container to have information ...
<p>My apologies if this question sounds obvious, but the Kubernetes and Google cloud documentation is extremely confusing and contradictory in places.</p> <p>Anyway, I have pushed a Dockerized web-server to my private Google Container Registry. I want this container to be restarted if it dies, but I only need one sing...
<p>Based on your description, I would suggest you use a <a href="http://kubernetes.io/docs/user-guide/deployments/" rel="noreferrer">Deployment</a> with <code>replicas</code> set to 1. The Deployment will ensure that there is always one instance of your pod running. You can define your <a href="http://kubernetes.io/doc...
<p>I have got 2 VMs nodes. Both see each other either by hostname (through /etc/hosts) or by ip address. One has been provisioned with kubeadm as a master. Another as a worker node. Following the instructions (<a href="http://kubernetes.io/docs/getting-started-guides/kubeadm/" rel="noreferrer">http://kubernetes.io/docs...
<p>I ran in the same issue too. It seems weaver wants to connect to the Kubernetes Cluster IP address, which is virtual. Just run this to find the cluster ip: <code>kubectl get svc</code>. It should give you something like this:</p> <pre><code>$ kubectl get svc NAME CLUSTER-IP EXTERNAL-IP ...
<p>The <code>env</code> element added in <code>spec.containers</code> of a pod using K8 dashboard's <em>Edit</em> doesn't get saved. Does anyone know what the problem is? </p> <p>Is there any other way to add environment variables to pods/containers? </p> <p>I get this error when doing the same by editing the file us...
<p>Not all fields can be updated. This fact is sometimes mentioned in the <code>kubectl explain</code> output for the object (and the error you got lists the fields that can be changed, so the others probably cannot).:</p> <pre><code>$ kubectl explain pod.spec.containers.env RESOURCE: env &lt;[]Object&gt; DESCRIPTION...
<p>I want to calculate the cpu usage of all pods in a kubernetes cluster. I found two metrics in prometheus may be useful:</p> <pre><code>container_cpu_usage_seconds_total: Cumulative cpu time consumed per cpu in seconds. process_cpu_seconds_total: Total user and system CPU time spent in seconds. Cpu Usage of all pod...
<p>This I'm using to get CPU usage at cluster level:</p> <pre><code>sum (rate (container_cpu_usage_seconds_total{id="/"}[1m])) / sum (machine_cpu_cores) * 100 </code></pre> <p>I also track the CPU usage for each pod.</p> <pre><code>sum (rate (container_cpu_usage_seconds_total{image!=""}[1m])) by (pod_name) </code></...
<p>I do have deployment with single pod, with my custom docker image like:</p> <pre><code>containers: - name: mycontainer image: myimage:latest </code></pre> <p>During development I want to push new latest version and make Deployment updated. Can't find how to do that, without explicitly defining tag/version an...
<p>You can configure your pod with a grace period (for example 30 seconds or more, depending on container startup time and image size) and set <code>"imagePullPolicy: "Always"</code>. And use <code>kubectl delete pod pod_name</code>. A new container will be created and the latest image automatically downloaded, then th...
<p>I want to deploy a simple containerized app on GCE. I've created a deployment file and a service file. The latter includes <code>type: NodePort</code> and <code>"ports": [{"port": 443, "targetPort": "myapp-port", "protocol": "TCP"}]</code> declarations.</p> <p>After running <code>kubectl create -f deployment.json<...
<p>Probably because you missed</p> <pre><code>spec: type: LoadBalancer </code></pre> <p><a href="http://kubernetes.io/docs/user-guide/load-balancer/" rel="nofollow noreferrer">http://kubernetes.io/docs/user-guide/load-balancer/</a></p>
<p>I have a Kubernetes service (a Python Flask application) exposed publicly on port 30000 (All Kubernetes NodePorts have to be in the range 30000-32767 from what I understand) using the LoadBalancer type. I need for my public-facing service to be accessible on the standard HTTP port 80. What's the best way to go about...
<p>If you don't use any cloudproviders, you can just set <code>externalIPs</code> option in service and make this IP up on node, and kube-proxy will route traffic from this IP to your pod for you.</p> <pre><code>{ "kind": "Service", "apiVersion": "v1", "metadata": { "name": "my-service" }, ...
<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>There is a readonly stat endpoint exposed on both Openshift and Kubernetes. Normally it is exposed as <a href="https://api-host:10250/stats" rel="nofollow noreferrer">https://api-host:10250/stats</a></p>
<p>I am setting up a Kubernetes deployment using auto-scaling groups and Terraform. The kube master node is behind an ELB to get some reliability in case of something going wrong. The ELB has the health check set to <code>tcp 6443</code>, and tcp listeners for 8080, 6443, and 9898. All of the instances and the load ...
<p>The Hostnames of the two machines (master and the node) should be different. You can check them by running <code>cat /etc/hostname</code>. If they do happen to be the same, edit that file to make them different and then do a <code>sudo reboot</code> to apply the changes. Otherwise kubeadm will not be able to differ...
<p>I'm having a bit of hard time figuring out whether the Guestbook example is working in Minikube. My main issue is possibly that the example description <a href="https://github.com/kubernetes/kubernetes/tree/master/examples/guestbook" rel="nofollow">here</a> details all the steps but <em>there is no indication about ...
<p>Quick and dirty: <code> kubectl port-forward frontend-708336848-0h2zj 80:80 </code></p>
<p>In Google Cloud Platform I have a Container-Cluster with three running instances. I now want to connect from my terminal to be able to run <code>kubectl</code> commands. For this I ran the command </p> <pre><code>gcloud container clusters get-credentials cluster-1 --zone europe-west1-b --project project-id </code><...
<p>I tried from a different machine at home, and there it was working after installing and setting up gcloud. I think that on my work machine there is still an oauth token stored with which I authenticated to a different google account I used for a test.</p> <p><strong>Edit:</strong> I got it running now. the problem ...
<p>I was wondering if there is a possibility to continuously print logs from HTTP request to Kubernetes API. I am using python for querying K8S API sth like</p> <p><code>r = requests.get(self.url + "namespaces/" + namespace + "/pods/" + pod_name + "/log", cert=(self.cert, self.key), verify=False)</code></p> <p>and i ...
<p>What i was missing is <code>stream=True</code> in <code>request.get</code> parameter which allows to iterate through the response content so my code looks like this:</p> <pre><code>import requests class Logs(): def __init__(self, url='https://192.168.0.1:6443/api/v1/', cert='./client.crt', ...
<p>Kubectl command alway returns this error yaml: line 2: mapping values are not allowed in this context. Even when i call normal version command, config command, etc. Not sure whats causing this.</p> <pre><code>tessact@tessact-sys-1:~$ kubectl version Client Version: version.Info{Major:"1", Minor:"4", GitVersion:"v1....
<p>That the version command already throws an error indicates that there is some default YAML file that gets loaded.</p> <p>You can use <code>strace kubectl version</code> to see what file was opened, hopefully this is done just before <code>kubectl</code> throws the error. I assume there is some global config that it...
<p>I have an application that uses raft to elect a leader out of multiple instances. These instances use the gossip protocol, so it just needs to know another instance to discover the rest.</p> <p>I plan to run each instance as a kubernetes pod, with replication manage by a replication controller. I will also put a se...
<p>The solution is to use a headless service. For example, we can deploy a headless service called <code>myservice-discovery</code>. Because the service is headless, it does not do any load-balancing or get a cluster ip address. To get the ip addresses of the pods, you then query the DNS server for <code>myservice-disc...
<p>I have a replication controller creating 10 instances of my pod. The pod runs a Zeppelin notebook which should be accessed by users over the web. However I need the possibility to access a specific notebook/pod over the web. If I expose the pods using a service of type LoadBalancer I will automatically be routed to ...
<p>To get 1:1 IP addresses you'd need a replication controller for each site. Replication controllers are for managing identically configured resources.</p> <p>However, you could always do <a href="http://kubernetes.io/docs/user-guide/ingress/#simple-fanout" rel="nofollow noreferrer">host-based or path-based</a> rout...
<p>Our application is based on an API first architecture and is currently based on a single domain / service:</p> <p><code>api.todos.com</code></p> <p>Consumers of the API are :</p> <ul> <li>Our web-frontend</li> <li>Our mobile-apps</li> <li>Other business / public</li> </ul> <p>We will be building new <em>micro-se...
<p>As System Architect I think <code>it is better to have a single unified API domain where we do HTTP (layer 7) routing to reach our endpoints</code>. You can make your system more flexible without any changes for your clients. For example you have a microservice with routes:</p> <ul> <li>api.todos.com/route1</li> <l...
<p>I have an admin.conf file containing info about a cluster, so that the following command works fine:</p> <pre><code>kubectl --kubeconfig ./admin.conf get nodes </code></pre> <p>How can I <code>config</code> kubectl to use the cluster, user and authentication from this file as default in one command? I only see sep...
<p>Here are the official documentation for how to configure kubectl</p> <p><a href="http://kubernetes.io/docs/user-guide/kubeconfig-file/" rel="noreferrer">http://kubernetes.io/docs/user-guide/kubeconfig-file/</a></p> <p>You have a few options, specifically to this question, you can just copy your <code>admin.conf</c...
<p>I have set up a kubernetes cluster running on AWS. What I want to do now is to control the cluster from remote machines, for example, my macbook pro.</p> <p>I've learned that Kubernetes has RESTful apis, and Kubectl can serve as a proxy. By running : <code>kubectl proxy --port=8001 &amp;</code> I can access the RES...
<p>Depending on how you provisioned your cluster, the API server may be listening over a different port. Have a look at your <code>kubeconfig</code> file (<code>~/.kube/config</code>), in there should be a section which has the server you are connecting to.</p> <p>Also, your cluster may be using certs or some other ty...
<p>I have a simple ingress resource and two services: ess-index and ess-query. Services has been exposed with type <code>NodePort</code> with <code>--session-afinity=None</code>. Ingress resource has the following structure:</p> <pre><code>apiVersion: extensions/v1beta1 kind: Ingress metadata: name: ess-ingress spec:...
<p>Incorporating kubeproxy and cloud lb algorithms so they cooperate toward a common goal is still a work in progress. Right now, it will end up spraying, over time you get roughly equal distribution but it will not be strictly rr. </p> <p>If you really want fine grain control over the algorithm, you can deploy the <...
<p>I am working with Kubernetes 1.4.3 and my nodes look like the following:</p> <blockquote> <pre><code>ip-10-0-0-105.eu-central-1.compute.internal Ready 1d ip-10-0-0-50.eu-central-1.compute.internal Ready,SchedulingDisabled 1d ip-10-0-1-126.eu-central-1.compute.internal Ready ...
<p>This was answered in <a href="https://github.com/kubernetes/kubernetes/issues/29108#issuecomment-233432397" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/29108#issuecomment-233432397</a></p> <p>Basically, this is working as intended. DaemonSet pods will get scheduled on unschedulable nod...
<p>Sometimes a pod should take some times to "warmup"(like load some data to cache). At that time it should not be exposed.</p> <p>How to prevent a pod to be added to a kube-service unitl initialization complete?</p>
<p>You should use health checks. More specifically in Kubernetes, you need a <code>ReadinessProbe</code></p> <blockquote> <p>ReadinessProbe: indicates whether the container is ready to service requests. If the ReadinessProbe fails, the endpoints controller will remove the pod’s IP address from the endpoints of all s...
<p>my containers are killed on a new installation of Fedora 24 atomic:</p> <pre><code>#docker run -ti nginx /bin/bash docker: Error response from daemon: Cannot start container f24104b29f7f1f1614024414e8346e1a98c722c027f4122e6c70f7ace0cc5353: [9] System error: exit status 1. </code></pre> <p>After some debugging ses...
<p>I've just found the problem: <a href="https://bugzilla.redhat.com/show_bug.cgi?id=1320601" rel="nofollow noreferrer">https://bugzilla.redhat.com/show_bug.cgi?id=1320601</a></p> <p>Adding the systemd flag to the launch script of the daemon: --exec-opt native.cgroupdriver=systemd</p> <p>solved the problem.</p> <p>T...
<p>I have a deployment configuration as follows:</p> <pre><code>apiVersion: extensions/v1beta1 kind: Deployment --- REMOVED FOR BREVITY --- volumes: - gcePersistentDisk: {fsType: pd-ssd, pdName: devtasker-disk} name: devtasker-disk - gcePersistentDisk: {fsType: pd-ssd, pdName: devtasker-pg} ...
<p>The storage class tells how to create the PV. The PVC claim requests the actual PV from the underlining infrastructure. </p> <p>Your deployment should only know about the PVC, so using your example you would end up with the following and remove the <code>gcePersistentDisk</code> entries: </p> <pre><code>volumes: ...
<p>I'm trying to install kubernetes with kubelet 1.4.5 on CoreOS beta (1192.2.0).</p> <p>I'm using a slightly modified version of the controller and worker install scripts from <a href="https://github.com/coreos/coreos-kubernetes/tree/master/multi-node/generic" rel="nofollow noreferrer">https://github.com/coreos/coreo...
<p>The kubelet <a href="http://kubernetes.io/docs/admin/kubelet/" rel="nofollow noreferrer">documentation</a> says that the <code>--tls-cert-file</code> flag needs the CA be concatenated after the certificate. In you case it is the <code>apiserver.pem</code>:</p> <blockquote> <p><strong>--tls-cert-file</strong> File...
<p>Kubernetes version: 1.4.5</p> <p>I have a very simple service with <code>type: NodePort</code>. It only returns some text on <code>/info</code>. I am using the default GKE ingress controller (the L7 Google load balancer) with TLS. If I use the following ingress everything works as expected:</p> <h2>Working ingress...
<p><a href="https://github.com/kubernetes/ingress-gce/blob/master/README.md#paths" rel="nofollow noreferrer">https://github.com/kubernetes/ingress-gce/blob/master/README.md#paths</a></p> <p>Can you look over this part and comment if it solves the issue: </p> <blockquote> <p>Note what just happened, the endpoint exp...
<p>Did someone has an experience running scheduled job? Due to the <a href="http://kubernetes.io/docs/user-guide/scheduled-jobs/" rel="noreferrer">guide</a>, ScheduledJobs available since 1.4 with enabled runtime <strong>batch/v2alpha1</strong></p> <p>So I was ensured with <code>kubectl api-versions</code> command:</p...
<p>Okay, I think I resolved this issue. ScheduledJobs is currently in alpha state and Google Container Engine supports this feature only for clusters with <strong>additionally enabled</strong> APIs. I was able to create such cluster with command:</p> <p><code>gcloud alpha container clusters create my-cluster --enable-...
<p>The best source for restart policies in Kubernetes I have found is this:</p> <p><a href="http://kubernetes.io/docs/user-guide/pods/multi-container/#restartpolicy" rel="noreferrer">http://kubernetes.io/docs/user-guide/pods/multi-container/#restartpolicy</a></p> <p>But it only lists the possible <code>restartPolicy<...
<p><strong>Always</strong> means that the container will be restarted even if it exited with a zero exit code (i.e. successfully). This is useful when you don't care why the container exited, you just want to make sure that it is always running (e.g. a web server). This is the default.</p> <p><strong>OnFailure</strong...
<p>I am putting together a proof of concept to help identify gotchas using Spring Boot/Netflix OSS and Kubernetes together. This is also to prove out related technologies such as Prometheus and Graphana.</p> <p>I have a Eureka service setup which is starting with no trouble within my Kubernetes cluster. This is named d...
<blockquote> <p>How can I setup something like eureka.client.serviceUri?</p> </blockquote> <p>You have to have a Kubernetes <a href="http://kubernetes.io/docs/user-guide/services/" rel="noreferrer">service</a> on top of the eureka pods/deployments which then will provide you a referable IP address and port number. A...
<p>I have a problem when connecting to a mysql instance with a go app using standard package. This is my connection string/log</p> <pre><code> [13 Nov 16 13:53 +0000] [INFO] connecting to MySQL.. root:awsomepass@tcp(a-mysql-0:3340)/db?charset=utf8&amp;parseTime=True&amp;loc=Local 2016/11/13 13:53:25 dial tcp 1...
<p>got a response from kubernetes-slack, from mav. I am accessing the <code>mysql-service</code> to a wrong <code>container-port</code>. default mysql port was <code>3306</code>. I thought I was using a custom container that exposes <code>3340</code>.</p>
<p>I have a kubernetes cluster (hosted at the university, not in gcloud) and I'm trying to use Jenkins with the jenksci/kubernetes plugin to launch the slaves. However, it seems they cannot register to the master, no matter what I do. (k8s 1.2, jenkins 2.19.2, kub-plugin 0.9)</p> <p>This is the configuration I use:</p...
<p>The arguments field should be <code>${computer.jnlpmac} ${computer.name}</code> and should be set by default when adding new containers to the Pod definition</p>
<p>While getting familiar with kubernetes I do see tons of tools that should helps me to install kubernetes anywhere, but I don't understand exactly what it does inside, and as a result don't understand how to trouble shoot issues.</p> <p>Can someone provide me a link with tutorial how to install kubernetes without an...
<p>There are two good guides on setting up Kubernetes manually:</p> <ul> <li>Kelsey Hightower's <a href="https://github.com/kelseyhightower/kubernetes-the-hard-way" rel="noreferrer">Kubernetes the hard way</a></li> <li>Kubernetes guide on <a href="http://kubernetes.io/docs/getting-started-guides/scratch/" rel="norefer...
<p>I'm using node js &amp; am wanting to upload files to a bucket of mine. I've setup the secret:</p> <pre><code>NAME TYPE DATA AGE cloudsql-oauth-credentials Opaque 1 5d default-token-dv9kj kubernetes.io/se...
<p>Look <a href="http://kubernetes.io/docs/user-guide/secrets/#using-secrets-as-files-from-a-pod" rel="noreferrer">here</a> in the section <strong>Using Secrets as Files from a Pod</strong>. </p> <p>Basically, you need to specify two things when mounting a secret volume. The bit that you have + some extra info. <em>Th...
<p>I have a Kubernetes v1.4 cluster running in AWS with auto-scaling nodes. I also have a Mongo Replica Set cluster with SSL-only connections (FQDN common-name) and public DNS entries:</p> <ul> <li>node1.mongo.example.com -> 1.1.1.1</li> <li>node2.mongo.example.com -> 1.1.1.2</li> <li>node3.mongo.example.com -> 1.1.1....
<p>While not so obvious at first, the solution is quite simple. kube-dns image in recent versions includes <code>dnsmasq</code> as one of it's components. If you look into its man page, you will see some usefull options. Following that lecture you can choose a path similar to this :</p> <p>Create a ConfigMap to store ...
<h3>Overview</h3> <p><em>kube-dns</em> can't start (SetupNetworkError) after <em>kubeadm init</em> and network setup:</p> <pre><code>Error syncing pod, skipping: failed to "SetupNetwork" for "kube-dns-654381707-w4mpg_kube-system" with SetupNetworkError: "Failed to setup network for pod \"kube-dns-654381707-w4mpg_k...
<p>It looks like you have configured flannel before running <code>kubeadm init</code>. You can try to fix this by removing flannel (it may be sufficient to remove config file <code>rm -f /etc/cni/net.d/*flannel*</code>), but it's best to start fresh.</p>
<p><a href="http://kubernetes.io/" rel="nofollow noreferrer">Kubernetes</a> is an open-source system for automating deployment, scaling, and management of containerized applications.</p> <p>In the official site of Kubernetes it says "Google runs billions of containers a week", my question is: if a container here means...
<p>Gmail itself can be millions of containers (just throwing out a number). It need not mean that many applications. There might also be short term jobs etc.</p>
<p>If I have 10 different services, each of which are independent from each other and run from their own container, can I get kubernetes to run all of those services on, say, 1 host?</p> <p>This is unclear in the kubernetes documentation. It states that you can force it to schedule containers from the same pod onto o...
<p>In fact kubernetes will do exactly what you want by default. It is capable of running dozens if not hundreds of containers on a single host (depending on its specs).</p> <p>If you want very advanced control over scheduling pods, there is an alpha feature for that, which introduces concept of node/pod (anti)affiniti...
<p>I want my deploy configuration to use an image that was the output of a build configuration.</p> <p>I am currently using something like this:</p> <pre><code>- apiVersion: v1 kind: DeploymentConfig metadata: annotations: openshift.io/generated-by: OpenShiftNewApp creationTimestamp: null labels...
<p>Are you constructing the resource definitions by hand?</p> <p>It would be easier to use <code>oc new-build</code> and then <code>oc new-app</code> if you really need to set this up as two steps for some reason. If you just want to setup the build and deployment in one go, just use <code>oc new-app</code>.</p> <p>F...
<p>I have a Kubernetes Cluster running and have multiple Services fronting a few Pods. When I expose a each service as a LoadBalancer, it creates an unique endpoint for Public consumption. Is there a way to configure this to expose 1 common endpoint and then have Filters that redirect traffic to the correct Pod base on...
<p>I think you're looking for something like ingress</p> <p>Running an ingress controller can server as a frontend for routing to different services based on http rules<br> <a href="http://kubernetes.io/docs/user-guide/ingress/" rel="nofollow noreferrer">http://kubernetes.io/docs/user-guide/ingress/</a></p> <p>And he...
<p>So I've got my backend and front-end as seperate containers in the one <strong>Kubernetes Deployment</strong>.</p> <p>At the moment I'm having to access the front-end &amp; backend via different <strong>ports</strong>. </p> <p>E.g <code>example.com:5000 = frontend</code> &amp; <code>example.com:7000 = backend</cod...
<p>Well, for starters, you should not base exposing your service on Deployment. To do that, you should cover your Deployment(s) with Service(s). Read up on <a href="http://kubernetes.io/docs/user-guide/services/" rel="nofollow noreferrer">http://kubernetes.io/docs/user-guide/services/</a> for that.</p> <p>When you go ...
<p>I'm trying to create a local Kubernetes deployment using Minikube, Docker Registry, and a demo node project.</p> <p>The first thing I did was install Docker v1.12.3, then Minikube v0.12.2.</p> <p>Then I created a Docker Registry container by running this command (via <a href="https://docs.docker.com/registry/" rel...
<p>It looks like you're running the registry on the host. In fact, you need to run the registry inside the VM. You can point your docker client to the docker daemon inside the minikube VM by running this command first <code> eval $(minikube docker-env) </code> in your shell.</p> <p>Then, you can run the docker build...
<p>I recently installed Kubernetes using Kubernetes Operations tool, but when I installed Kubernetes Dashboard using <a href="https://rawgit.com/kubernetes/dashboard/master/src/deploy/kubernetes-dashboard.yaml" rel="nofollow noreferrer">this</a> script, the dashboard endpoints were in a private cluster.</p> <p>Is ther...
<p>You can easily accomplish that with <a href="http://kubernetes.io/docs/user-guide/ingress/" rel="nofollow noreferrer">Ingress</a> coupled with <a href="https://github.com/kubernetes/contrib/tree/master/ingress/controllers/nginx" rel="nofollow noreferrer">NginX IngressController</a> </p> <p>if you use something like...
<p>I have a service that directs all traffic to a UI-pod. I want to redirect traffic from my localhost:80 to that service. I have tried : </p> <pre><code>kubectl port-forward my_service 6379:6379 </code></pre> <p>This doesnt work because that service is actually supposed to be a pod. I have tried:</p> <pre><code>k...
<p>Unfortunately in kubernetes you can't port forward a service yet - <a href="https://github.com/kubernetes/kubernetes/issues/15180" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/15180</a></p> <p>However, in minikube, you can use ssh port forwarding for the VM to achieve the same result</p...
<p>I'm starting to experiment with Kubernetes on my Windows 10 dev machine. I've got minikube running on my machine, with some "canned" test services, so it looks like Kubernetes is working properly.</p> <p>Now I'm trying to create my first service by following this: <a href="http://kubernetes.io/docs/hellonode/" rel...
<p>Once you have the docker client on your host windows machine, you can run </p> <p><code>minikube docker-env --shell powershell</code> </p> <p>That will point the docker client on your host to the docker daemon inside the minikube VM.</p>
<p>there,</p> <p>According to the doc:</p> <p><code>ReadWriteOnce – the volume can be mounted as read-write by a single node</code></p> <p>I created a PV based on nfs:</p> <pre><code>apiVersion: v1 kind: PersistentVolume metadata: name: tspv01 spec: capacity: storage: 15Gi accessModes: - ReadWriteOnce...
<p>The accessModes are dependent upon the storage provider. For NFS they don't really do anything different, but a HostPath should use the modes correctly. </p> <p>See the following table for all the various options: <a href="http://kubernetes.io/docs/user-guide/persistent-volumes/#access-modes" rel="nofollow noreferr...
<p>I have a PetSet with </p> <pre><code> volumeClaimTemplates: - metadata: name: content spec: accessModes: [ "ReadWriteOnce" ] resources: requests: storage: 2Gi - metadata: name: database spec: accessModes: [ "ReadWriteOnce" ] resources: reque...
<p>You can create a storage class and add the failure zone there. For example, create a storage class like this:</p> <pre><code>kind: StorageClass apiVersion: storage.k8s.io/v1beta1 metadata: name: gp2storage provisioner: kubernetes.io/aws-ebs parameters: type: gp2 zone: us-east-1b encrypted: "true" </code></p...
<p>How do I automatically restart Kubernetes pods and pods associated with deployments when their configmap is changed/updated?</p> <hr> <p>I know there's been talk about the ability to automatically restart pods when a config maps changes but to my knowledge this is not yet available in Kubernetes 1.2. </p> <p>So w...
<p>The current best solution to this problem (referenced deep in <a href="https://github.com/kubernetes/kubernetes/issues/22368" rel="noreferrer">https://github.com/kubernetes/kubernetes/issues/22368</a> linked in the sibling answer) is to use Deployments, and consider your ConfigMaps to be immutable.</p> <p>When you ...
<p>I'm using google cloud to store my <strong>Docker</strong> images &amp; host my <strong>kubernetes</strong> cluster. I'm wondering how I can have <strong>kubernetes</strong> pull down the image which has the <strong>latest</strong> tag each time a new one is pushed.</p> <p>I thought <strong>imagePullPolicy</strong> ...
<p>Kubernetes it self will never trigger on container image update in repository. You need some sort of CI/CD pipeline in your tooling. Furthermore, I do strongly advise to avoid using <code>:latest</code> as it makes your container change over time. It is much better in my opinion to use some sort of versioning. Be it...
<p>We have an application deployed on Kubernetes. One of the services is an app running in the JVM.</p> <p>Our application is faulty, it consumes to much memory. We are hitting the limit set in the Replication Controller, which makes it restart the pod.</p> <p>Is it a good idea to use the replication controller for t...
<p>In fact this is not a responsibility of Deployment / ReplicationController. The restarts are handled within Pod it self. As for handling memory, this is not a trivial issue and you should control it on both levels (things like heap sizes etc.) so that your app avoids hitting the limit, but if it does go awall, limit...
<p>New to kubernetes. Can I use kubectl scale --replicas=N and start pods on different nodes?</p>
<p>By default the scheduler attempts to spread pods across nodes, so that you don't have multiple pods of the same type on the same node. So there's nothing special required if you're just aiming for best-effort pod spreading.</p> <p>If you want to express the requirement that the pod must not run on a node that alrea...
<p>I am running a cluster on GKE and sometimes I get into a hanging state. Right now I was working with just two nodes and allowed the cluster to autoscale. One of the nodes has a NotReady status and simply stays in it. Because of that, half of my pods are Pending, because of insufficient CPU. </p> <h2>How I got there...
<p>The first thing I would do is to define Resources and Limits for those pods. </p> <p>Resources tell the cluster how much memory and CPU you think that the pod is going to use. You do this to help the scheduler to find the best location to run those pods.</p> <p>Limits are crucial here: they are set to prevent your...