prompt
stringlengths
65
38.7k
response
stringlengths
41
29.1k
<p>Created a <code>kubernetes</code> cluster with private topology on <code>aws</code> using <code>kops</code></p> <p>My application exposes several services. As expected, services communicate among each other using their names, i.e. the <code>name</code> field below:</p> <pre><code>kind: Service metadata: name: my...
<p>The simple answer is yes, you can put resources with the same name into separate namespaces and there will be no collision.</p>
<p>I would like to have Kubernetes use the local SSD in my Google Kubernetes engine cluster without using alpha features. Is there a way to do this?</p> <p>Thanks in advance for any suggestions or your help.</p>
<p><a href="https://cloud.google.com/kubernetes-engine/docs/concepts/local-ssd" rel="nofollow noreferrer">https://cloud.google.com/kubernetes-engine/docs/concepts/local-ssd</a> explains how to use local SSDs on your nodes in Google Kubernetes Engine. Based on the gcloud commands, the feature appears to be beta (not alp...
<p>I have a simple, yet irritating issue. I have bunch of deployments, services, etc. written out. </p> <p>For staging env (I'm using namespaces to separate staging/prod environments), I'm using images with tag :latest.</p> <p>For prod env I'd like custom :tag. However I'd like avoiding copy/pasting the .yml file and...
<p>Been there once. What I followed into was doing some simple templating, writing my own template wrappers, to finally end up evaluating and completely switching to <code>helm</code> "kubernetes package manager".</p> <p>I would strongly advise you to take a shortcut and go directly for helm, it can help a lot really,...
<p>I'm trying to use the standalone <code>gsutil</code> tool from within a container running in a GKE cluster, but I cannot get it to work. I believe the cluster has adequate permissions (see below). However, running</p> <pre><code>./gsutil ls gs://my-bucket/ </code></pre> <p>yields</p> <pre><code>ServiceException: ...
<p>You can use gsutil inside a docker container on GKE with a <a href="https://cloud.google.com/iam/docs/creating-managing-service-accounts#creating_a_service_account" rel="noreferrer">service account</a>, or with your own credentials.</p> <p><strong>Service Account</strong></p> <p><strong>1)</strong> Add the <code>s...
<p>We are running our prod DBs within Docker which works out good.</p> <p>Now we are going into managed K8s and putting eg elasticsearch into it which does not feel good at all. After the issues with the volumes were solved (with PersistentVolumeClaimTemplates) clustering hit us hard. The nodes of the cluster simply d...
<p>Some of my clusters come from as early as Kubernetes 1.2-alpha, back then it was obvious that the really statefull services (MySQL Galera cluster in my case was the primary one) need to be kept outside of kube cluster. That did not change for me much, even with 1.8 installed, my DB is still external. But it is also ...
<p>Consider we have two different Docker images both exposing the same port (80, for example).</p> <p>Now we'd like to create a multi-container Pod in Kubernetes cluster that contains containers created from these images.</p> <p>Is there a way to setup such configuration without changing images? How to map ports on P...
<p>Containers inside a Kubernetes Pod share different linux namespaces for things like networking, pid or file system. <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-overview/#networking" rel="nofollow noreferrer">From the docs</a></p> <blockquote> <p>Each Pod is assigned a unique IP address. Every ...
<p>I have a vm that sits in front of the cluster. Currently it is running HAProxy (with <code>use-proxy-protocol: "true"</code>). My end goal is to allow the pods associated with the default backend to be able to read the actual source client source IP. </p> <p>Here's a sample log of with <code>use-proxy-protocol</cod...
<p>I figured it out! The problem lies in the Iris web framework and has little to nothing to do with ingress-nginx. </p> <p>The solution is to read the remote headers manually in <code>ctx.Application().ConfigurationReadOnly().GetRemoteAddrHeaders()</code>. By default the Iris framework does not check for <code>X-Forw...
<p>We are running our prod DBs within Docker which works out good.</p> <p>Now we are going into managed K8s and putting eg elasticsearch into it which does not feel good at all. After the issues with the volumes were solved (with PersistentVolumeClaimTemplates) clustering hit us hard. The nodes of the cluster simply d...
<p>Personally, I prefer to keep as much important state as possible outside of Kubernetes (k8s) or any other Container Orchestration Framework (referring to it as COF from here on) and most people I asked about this topic felt the same. In the end, COFs are software which dynamically manage your containers (and their ...
<p>I have a database cluster that needs to set IP range into the whitelist. I set up a kubernetes cluster and run my app. How can I give/get the kubernetes cluster an IP address so that I can set it to my whitelist?</p> <p>Thank you~</p>
<p>If you can SSH into the cluster, you can run "ip addr show" to get the ip address.</p>
<p>This is more of a theoretical question. How do you guys create the structure of a Kubernetes deployments/services/pods that runs multiple applications?</p> <p>Let's say I want to run 3 Wordpress websites on my servers. For this I need: Nginx, MySQL, PHP-FPM and the Wordpress code base.</p> <ol> <li><p>Is it better...
<p>Kubernetes is extremely flexible as you are discovering and allows you to architect you application in numerous ways. As a general rule of thumb, only run one process per container per pod. However, there definitely valid use cases for running multiple containers in a pod. I think for your use case, you can use both...
<p>I cannot find any articles answering question: Is it safe/right to deploy Spinnaker to same Kubernetes cluster which Spinnaker will manage? Mainly I mean for production, HA deployments.</p>
<p>I think the architectures of Spinnaker and Kubernetes compliment each other very well, and running Spinnaker in the same K8s cluster it is managing is definitely safe.</p> <p>As per your comment in @mdirkse's answer, there is a codelab, which is official Spinnaker documentation, that explains how to create a set of...
<p>Does anyone know how could I proxy forward database traffic from localhost to an AWS database using kubernetes. Networkingwise, the pod has access to the db and it looks like below </p> <pre><code>+-----------+ +--------+ +-----------+ | | | | | | | Localhost +--&gt; | Pod...
<p>What you refer to is ssh port forwarding, and kubernetes has something similar with <code>kubectl port-forward &lt;mypod&gt; &lt;localport&gt;:&lt;podport&gt;</code>. With one crucial difference, it forwards just the ports from the pod you point it to. What we do to achieve more or less what you ask for, is running ...
<p>From the docs:</p> <blockquote> <p>Secrets must be created before they are consumed in pods as environment variables unless they are marked as optional. References to Secrets that do not exist will prevent the pod from starting.</p> </blockquote> <p>How to mark secret as optional? </p>
<p>What you're looking for is</p> <pre><code> - name: ENV_NAME valueFrom: secretKeyRef: name: &lt;secrets name&gt; key: &lt;secrets key&gt; optional: true </code></pre> <p>You can find type definition <a href="https://github.com/kubernetes/kubernetes/blob/e9e190c57c61a88a2ba96c4b0688b...
<p>Storage size which I specified in the persistent volume claim ignores with using nfs as a storage backend.</p> <p>I want to attach persistent volume to container with specified volume size. The following is the yaml file which I used to create pvc.</p> <pre><code>kind: PersistentVolumeClaim apiVersion: v1 metadat...
<p>Simply put, no, it's not possible.</p> <p>The storage parameter is used for matching PVC to a PV, and for autoprovisioning PVs when supported (ie. adding an EBS on AWS). Kubernetes it self has no means of managing filesystem quota whatsoever.</p> <p>One thing that could help is if you'd automaticaly provision NFS ...
<p>I'm deploying drone.io on gke k8s using helm. It works great if I have LetsEncrypt off. But I really would like https support.</p> <p>Here's my service:</p> <pre><code>apiVersion: v1 kind: Service metadata: name: {{ template "drone_ci.fullname" . }}-external labels: name: server app: {{ template "drone...
<p>I would suggest you switching from a LoadBalancer type service to a regular one an instead expose it via means of Ingress. Coupling Ingress with kube-lego you get a very nice support for exposing anything you want easily with trivial way of enabling let's encrypt integration for the used domains, even if the softwar...
<p>I am trying to create cluster with Kops, In my script I take a directory called instancegroup and copy its contant inside my "state" S3 bucket. When the cluster is being created I can see in Amazon console that all my nodes where deployed (master, 2 default nodes, and 5 nodes that I specifed inside my instancegroup ...
<p><code>get nodes</code> only lists registered Node API objects. The other nodes must not be registering themselves with the API server. Check the logs for the kubelet process on those nodes to determine why they aren't registering themselves. </p>
<p>I have 9 pods running which are basically 9 different applications.</p> <p>Is it possible to have same k8s service (LB | Public IP) for multiple pods such that I can access them by different ports, but the same IP of service (LB)?</p> <p>E.g. like so:<br> LB-IP:80 -- In the backend an application is running, which...
<p>As for the pure service approach, no it is not possible. Service relates to only one selector so you can't.</p> <p>Now, as you talk about LB here, you might be talking about exposing the thing externally, and for that you can have an Ingress/IngressController. If you want, you can also just deploy a "gateway" servi...
<p>I'd like to mount volume if it exists. For example:</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: v1 kind: Pod metadata: name: mypod spec: containers: - name: mypod image: redis volumeMounts: - name: foo mountPath: "/etc/foo" volumes: - name: foo secret: sec...
<p>secret and configmap volumes can be marked optional, and result in empty directories if the associated secret or configmap doesn't exist, rather than blocking pod startup</p> <pre><code>apiVersion: v1 kind: Pod metadata: name: mypod spec: containers: - name: mypod image: redis volumeMounts: ...
<p>In my StatefulSet deployment specification, I have 'replicas' defined as 2. Now I want to use Persistent Volume (PV) and Persistent Volume Claims (PVC), for which I created one PV (dynamic provisioning using StorageClass) and one PVC which I then used in my deployment spec. I am testing the deployment on AWS.</p> <...
<p>I think there are two issues you're facing here.</p> <p>For starters, AWS EBS can be attached to one node exclusively, o can't have the same PVC/PV couple for multiple PODs (what is called a ROX or RWX mode).</p> <p>Secondly, for scaled deployments/statefullsets etc. there is a special way to declare PVC in a way ...
<p>I'd like to edit my secrets. The only way I'm aware of is <code>kubectl edit secret mysecret</code> which gets me yaml blob to edit. However, all secrets are base64 encoded which isn't an easy way to edit them.</p> <p>Can I mount secrets to local volume somehow? Can I extract secrets to my localhost and edit them t...
<p>Unfortunately no, the problem you describe is something you just have to deal with "on the side" by decoding/encoding base64 content on your own.</p> <p>There are ways to simplify this by using templating for resources (ie. via helm charts), but that involves storing the raw secret in some other way and just applyi...
<p>When deploying a Kubernetes cluster manually we use kubeadm,</p> <p><pre>kubeadm init ...</pre></p> <p>passing the parameter <pre>--apiserver-cert-extra-sans=&lt;FQDN&gt;</pre> to include the FQDN in the generated certificate.</p> <p>What approach can we use to achieve the same affect using Kubespray/Ansible?</p>...
<p>I thought it was <a href="https://github.com/kubernetes-incubator/kubespray/blob/v2.3.0/inventory/group_vars/k8s-cluster.yml#L176" rel="nofollow noreferrer"><code>supplementary_addresses_in_ssl_keys</code></a> but <a href="https://github.com/kubernetes-incubator/kubespray/blob/v2.3.0/roles/kubernetes/secrets/templat...
<p>I am getting the error:</p> <blockquote> <p>error validating "mysql.yaml": error validating data: ValidationError(Deployment.spec.template.spec.volumes[0]): unknown field "path" in io.k8s.kubernetes.pkg.api.v1.Volume; )</p> </blockquote> <pre><code>apiVersion: extensions/v1beta1 kind: Deployment metadata: ...
<p>Your Deployment object looks correct using name and path as keys. You can see an example on <a href="https://github.com/maciekrb/gcs-fuse-sample" rel="noreferrer">how to mount a GCS bucket on kubernetes here</a></p> <pre><code>apiVersion: extensions/v1beta1 kind: Deployment metadata: name: gcsfuse-test spec: re...
<p>I want to start monit process in docker.</p> <p>Since its getting daemonized, the container is getting completed once monit starts. What is the best way to run it as a foreground process?</p>
<p>From <a href="https://wiki.gentoo.org/wiki/Monit" rel="nofollow noreferrer">https://wiki.gentoo.org/wiki/Monit</a>:</p> <pre><code>Running monit in the foreground To run monit in the foreground and provide feedback on everything it is detecting, use the -Ivv option: root #monit -Ivv </code></pre>
<p>This is a pretty basic question that I cannot seem to find an answer to, but I cannot figure out how to set the concurrencyPolicy in a cronjob. I have tried variations of my current file config:</p> <pre><code>apiVersion: batch/v1beta1 kind: CronJob metadata: name: job-newspaper spec: schedule: "* */3 * * *" ...
<p>The property <code>concurrencyPolicy</code> is part of the CronJob spec, not the PodSpec. You can locally see the spec for a given object using <code>kubectl explain</code>, like</p> <pre><code>kubectl explain --api-version="batch/v1beta1" cronjobs.spec </code></pre> <p>There you can see the structure/spec of the ...
<p>The <strong>error</strong> I am getting after running <strong>kubectl cluster-info</strong></p> <p>Kubernetes master is running at <a href="https://xxx-xxx-aks-yyyy.hcp.westeurope.azmk8s.io:443" rel="nofollow noreferrer">https://xxx-xxx-aks-yyyy.hcp.westeurope.azmk8s.io:443</a></p> <p>To further debug and diagnose...
<p>There is some issue on Azure Server. Please refer to this similar <a href="https://github.com/Azure/AKS/issues/112" rel="nofollow noreferrer">issue</a>.</p> <p>I suggest you could try again, if it still does not work, you could open a ticket or give feedback to Azure.</p>
<p>I need to understand how to deal with common libraries that i have created which my Application depends upon. When i create jar for this app using maven it creates a package. But how do we maintain or configure other common libraries which are listed in pom.xml of this application?</p> <p>should we have maven also ...
<p>The images that you use to build the containers that run on Kubernetes should contain everything that's needed to run the application.</p> <p>When you create the JAR file for your application, this JAR should contain the dependencies. There are different ways to achieve this, using both Maven or Gradle. <a href="ht...
<h3>Setup</h3> <p>The pods of the deployment named frontend are exposed via a service named frontend.</p> <pre><code>NAME READY STATUS RESTARTS AGE po/frontend-b48b88789-dcxs6 1/1 Running 0 2h NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE depl...
<p>I think that if you really need this, then what you actually might be interested in is <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/" rel="nofollow noreferrer">StatefulSet</a> which provides a somewhat static way of referencing to the pods that are spinned up by it. With StatefulSet...
<p>I created a StatefulSet on GKE, and it provisioned a bunch of GCE disks that are attached to the pods that belong to that StatefulSet. Suppose I scale the StatefulSet to 0: the constituent pods are destroyed and the disks are released. When I scale back up, the disks are reattached and mounted inside the correct pod...
<p>When you scale the StatefulSet to 0 replicas, the pods get destroyed but the persistent volumes and persistent volume claims are kept. The association with the GCE disk is written inside the PersistentVolume object. When you scale the RS up again, pods are assigned to the correct PV and thus get the same volume from...
<p>Suppose I have a RabbitMQ instance and a set of pods that pick messages from RabbitMQ and process them. How do I make Kubernetes increase the number of pods as the queue size increases?</p> <p>(I'm mentioning RabbitMQ, but that's just an example. Pick your favorite message queue software or load balancer if you wis...
<p>The top-level solution to this is quite straightforward:</p> <p>Set up a separate container that is connected to your queue, and uses the Kubernetes API to scale the deployments.</p> <p>There exist some solutions to this problem already, but they do however not look like they are actively maintained and production...
<p>Running Kubernetes on GKE</p> <p>Installed Nginx controller with latest stable release by using helm.</p> <p>Everythings works well, except adding the whitelist-source-range annotation results in that I'm completely locked out from my service.</p> <p>Ingress config</p> <pre><code>apiVersion: extensions/v1beta1 k...
<p>Yes. However, I figured out by myself. Your service has to be enabled <code>externalTrafficPolicy: Local</code>. That means that the actual client IP should be used instead of the internal cluster IP.</p> <p>To accomplish this run <code>kubectl patch svc nginx-ingress-controller -p '{"spec":{"externalTrafficPolicy"...
<p>I'm trying to reach a DaemonSet listening on port 18081 via a service but unsucessfully so far.</p> <p>The pod that was started by the DaemonSet works correctly. I can port-forward to the pod and port 18081 and talk to exposed API on the port.</p> <p>The service for the DaemonSet is configured as follows:</p> <pr...
<p>Found out was wrong, it was nothing in Kubernetes.</p> <p>The monerod daemon does only allow connections from localhost by default, for security reason. Enabling external connections '--confirm-external-bind' made it work.</p> <p>The link to <a href="https://kubernetes.io/docs/tasks/debug-application-cluster/debug...
<p>I need to implement logging for kubernetes ingress installation so all request will be logging with the following details:</p> <ul> <li>Request headers</li> <li>Request body</li> <li>Response headers</li> <li>Response body</li> </ul> <p>I understand that I can edit <code>log_format</code> of nginx using <a href="h...
<p>I think I found the solution. I need to use custom nginx template. In general, the steps should be as following:</p> <ol> <li>Obtain the <code>nginx.tmpl</code> from the ingress-nginx controller that is located at <code>/etc/nginx/template/nginx.tmpl</code></li> <li>Edit it according to your needs</li> <li>Map it u...
<p>I am very new to Kubernetes so apologies for gaps in my understanding and possibly incorrect wording. I am developing on my local MacBook Pro, which is somewhat resource constrained. My actual payload is a database, which is already running in a Docker container, but obviously needs some sort of persistent storage. ...
<p>A very short answer is that it's hard to do this properly.</p> <p>One of the best options I know of is <a href="https://github.com/linuxkit/kubernetes" rel="nofollow noreferrer">LinuxKit</a>, it allows you to build identical images that you can run on any of the popular cloud providers or in a data centre of your o...
<p>I have a service which is long-running (in a <code>while 1</code> loop) and processes payloads via GCloud pub/sub, after which it writes the result to a DB.</p> <p>The service doesn't need to listen on any port.</p> <p><strong>What would the declarative YAML config look like for <code>Kind=Deployment</code>?</stro...
<p>What you're describing sounds more like a job or a deployment than a service. You can run a deployment (which creates a replicaset, which ensures a certain number of replicas are running) without creating a service. </p> <p>If your pod isn't exposing any network services for others to consume, there's very little r...
<p>I have created a deployment for jenkins in Kubernetes. The pod is running fine, I've created a service to access jenkins on service-ip:8080 but it seems not to work. When I create an <code>ingress</code> above the service I can access it using the public ip.</p> <pre><code>kind: Service apiVersion: v1 metadata: n...
<p>If I understand correctly, you want any container running in your cluster to be able to access your jenkins service, but you don't want your jenkins service to be accessible outside your cluster to something like your browser?</p> <p>In this case:</p> <pre><code>curl http://jenkins-ui.default:8080 curl http://10.4...
<p>I've been having a really frustrating issue where Kubernetes services randomly stop being available on their cluster IPs after around a few hours of deployment. They almost seem to be ageing.</p> <p>My pods are having <code>hostNetwork: true</code> and <code>dnsPolicy: ClusterFirstWithHostNet</code>. Here is where ...
<p>It sounds like you have pods with <code>hostNetwork: true</code> and use services with <code>type: NodePort</code> and set fix node port number to be the same as the one your pod will be using.</p> <p>Generally, unless you have a very compelling use-case, you should avoid <code>hostNetwork: true</code>. It's mostl...
<p>i need a solution for that:</p> <p>i have 2 node pools in gcloud kubernetes, first is preemptible and autoscaling, second is only autoscaling.</p> <p>Jobs should be started on the first one ( with preemptible VMs ), but when no resources on the first pool are available Jobs should be started on the second one.</p>...
<p>I don't think you can get exactly what you want with the Cluster Autoscaler but I'll hopefully give you a couple options and pointers to further explore.</p> <ul> <li>The Cluster Autoscaler has the notion of <a href="https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-expanders" ...
<p>We are planning to use Kube for Postgres deployments. Our applications will be microservices with separated schema (or logical database). For security sake, we'd like to have separate users for each schema/logical_db. </p> <p>I suppose that the db/schema&amp;user should be created by Kube, so the application itself...
<p>When it comes to creating user, as you said, most charts and containers will have environment variables for creating a user at boot time. However, most of them do not consider the possibility of creating multiple users at boot time. </p> <p>What other containers do is, as you said, have the root credentials in k8s ...
<p>I want to link my selenium/hub container to my chrome and firefox node containers in a POD.</p> <p>In docker, it was easily defined in the docker compose yaml file. I want to know how to achieve this linking in kubernetes.</p> <p>This is what appears on the log.: <a href="https://i.stack.imgur.com/JJnKZ.png" rel="...
<p>You don't need to link them. The way Kubernetes works, <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod/#resource-sharing-and-communication" rel="nofollow noreferrer">all the containers in the same Pod are already on the same networking namespace</a>, meaning that they can just talk to each other thro...
<p>When a Kubernetes service is exposed via an <code>Ingress</code> object, is the load balancer "phisically" deployed in the cluster, i.e. as some <code>pod</code> controller inside the cluster nodes, or is just another managed service provisioned by the given cloud provider?</p> <p>Are there cloud provider specific ...
<p>By default, a kubernetes cluster has no <code>IngressController</code> at all. This means that you need to deploy one yourself if you are on premise.</p> <p>Some cloud providers do provide a default ingress controller in their kubernetes offer though, and this is the case of GKE. In their case the ingress controlle...
<p>I´m setting up kubernetes on GKE as described in Kelsey Hightowers <a href="https://github.com/kelseyhightower/kubernetes-the-hard-way/" rel="nofollow noreferrer">https://github.com/kelseyhightower/kubernetes-the-hard-way/</a></p> <p>Everything works fine except for setting up the DNS ClusterAddon <a href="https://...
<p>The URL comes from internal kubernetes information (service account token) and it should be fine (it should point to the first IP in the range assigned to service network, and that should be the <code>kubernetes.default</code> service. What you need to check is if your pod-to-pod networking and kube-proxy (it implem...
<p>When a Kubernetes service is exposed via an <code>Ingress</code> object, is the load balancer "phisically" deployed in the cluster, i.e. as some <code>pod</code> controller inside the cluster nodes, or is just another managed service provisioned by the given cloud provider?</p> <p>Are there cloud provider specific ...
<p>I will answer with respect to Google Cloud Engine. </p> <p>Yes, everytime, you deploy a new ingress resource, a Load balancer is created which you can view from the section:</p> <pre><code>GCP Console --&gt; Network services --&gt; LoadBalancing </code></pre> <p>Clicking on the respective Loadbalancer id gives yo...
<p>I am using Google Kubernetes Engine and would like my <code>StatefulSet</code> to use my previously created disk <code>my-app-disk</code> instead of dynamically creating new persistent disk for each replica in the set. My config is as follows:</p> <p><code>PersistentVolume</code> yaml:</p> <pre><code>apiVersion: v...
<p><code>StatefulSet</code> will create it's own <code>PersistentVolumeClaim</code> for each pod so you don't have to create one yourself. A <code>PersistentVolume</code> and a <code>PersistentVolumeClaim</code> will bind exclusively <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/#binding" rel=...
<p>Minikube version v0.24.1 </p> <p>kubernetes version 1.8.0</p> <p>The problem that I am facing is that I have several <code>statefulsets</code> created in minikube each with one pod. </p> <p>Sometimes when I start up minikube my pods will start up initially then keep being restarted by kubernetes. They will go fro...
<p>After some more digging there seems to have been a bug which can affect statefulsets that creates multiple controllers for the same statefulset:</p> <p><a href="https://github.com/kubernetes/kubernetes/issues/56355" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/56355</a></p> <p>This iss...
<p>Similar question on SO has 10 answers as 'force delete the pod' -_-</p> <p>Of course this is unacceptable as it causes problems on the cluster - too many pods are stuck on 'terminating', and many times if you try to delete a random pod it also gets stuck. It happens fairly randomly.</p> <p>So how to determine, fir...
<p>If your pods got terminated with apparently no cause, it could be:</p> <ul> <li>the node is under stress (memory, cpu) </li> <li>liveness condition is not respected</li> </ul> <p>For these reasons, the scheduler kills some pods.</p> <p>How to determine the precise cause? If you found 'logs' and 'describe' comma...
<p>How to access the canonical kubernetes dashboard from external network/IP? Is there a way to expose dashboard services externally rather accessing from the localhost browser where the canonical k8s cluster node?</p>
<p><a href="https://github.com/kubernetes/dashboard/wiki/Accessing-Dashboard---1.7.X-and-above" rel="noreferrer">The documentation has a guide</a> on how to do it.</p> <h2>Using kubectl proxy</h2> <p><code>kubectl proxy</code> creates proxy server between your machine and Kubernetes API server. By default it is only ac...
<p>I am attempting to install postgres via helm using the latest <a href="https://github.com/kubernetes/charts/tree/master/stable/postgresql" rel="noreferrer">stable</a> and it isn't installing the persistent volume properly. I am installing it in Minikube and for some reason it doesn't appear to be able to hostMount p...
<p>You may be running into this issue: <a href="https://github.com/kubernetes/minikube/issues/2256" rel="noreferrer">https://github.com/kubernetes/minikube/issues/2256</a></p> <p>The problem is there's a bug in the hostpath volume provisioner that encounters an error when the 'subPath' field is present in the Deployme...
<p>Can I create two pods where containers are running on same ports in one kubernetes cluster? considering that will create a separate service for both.</p> <p>Something like this : </p> <p>-- Deployment 1</p> <pre><code>kind: Deployment spec: containers: - name: &lt;name&gt; image: &lt;image&gt; imagePu...
<p>Sure you can. Every <code>POD</code> (which is the basic workload unit in k8s) is isolated from the others in terms of networking (as long as you don't mess with advanced networking options) so you can have as many pods as you want that bind the same port. You can't have two <code>containers</code> inside the same <...
<p>I'm trying to use the Jenkins/Kubernetes plugin to orchestrate docker slaves with Jenkins. </p> <p>I'm using this plugin: <a href="https://github.com/jenkinsci/kubernetes-plugin" rel="noreferrer">https://github.com/jenkinsci/kubernetes-plugin</a></p> <p>My problem is that all the slaves are offline so the job can...
<p>When running jenkins in Kubernetes, the service name is resolvable by both the jenkins master and slaves.</p> <p>The best way to configure this is than the use the internal DNS and set the jenkins url to:</p> <pre><code>http://jenkins:8080 </code></pre> <p>(assuming you called your service jenkins, and your port ...
<p>I have configured a kubernetes ingress service but it only works when the path is /</p> <p>I have tried all manner of different values for the path including:</p> <pre><code>/* /servicea /servicea/ /servicea/* </code></pre> <p>This is my ingress configuration (that works)</p> <pre><code>- apiVersion: extensions/...
<p>You are not using kubernetes Pods as they are intended to be used. <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod/" rel="noreferrer">A Pod</a></p> <blockquote> <p>it contains one or more application containers which are relatively tightly coupled — in a pre-container world, they would have execut...
<p>Through a stroke of luck I've been given an extremely powerful server in my office - I'd love to somehow set up a replica of our staging Kubernetes environment on it. Our staging Kube environment is 5 nodes running on AWS that each have different configurations. I can't find much in the way of best practice guides (...
<p>If you want to have it everything in one machine, I would also go for the multi-vm option. With Vagrant you could try to make the process simpler. This could help you:</p> <p><a href="https://github.com/pires/kubernetes-vagrant-coreos-cluster" rel="nofollow noreferrer">https://github.com/pires/kubernetes-vagrant-co...
<p>We have created 2 different Kubernetes clusters on Google Cloud Platform, one for Development and the other for Production. Our team members have the "editor" role (so they can create, update delete and list pods)</p> <p>We want to limit access to the production cluster by using RBAC authorization provided by Kuber...
<p>If you are in a initial phase or you can manage to move your testing cluster I would advise you to set up the clusters in two different projects.</p> <p>This will create two completely different environments and you will not have any kind of issues in the future and you automatically forbid the access to half of yo...
<p>Is there a way to monitor kube cronjob?</p> <p>I have a kube cronjob which runs every 10mins on my cluster. Is there a way to collect metrics every time my cronjob fails due to some error or notify when my cronjob has not been completed after a certain period of time?</p>
<p>I'm using these rules with <a href="https://github.com/kubernetes/kube-state-metrics/blob/master/docs/cronjob-metrics.md" rel="noreferrer">kube-state-metrics</a>:</p> <pre><code>groups: - name: job.rules rules: - alert: CronJobRunning expr: time() -kube_cronjob_next_schedule_time &gt; 3600 for: 1h la...
<p>Update:</p> <p>Found <a href="https://webhookrelay.com/v1/examples/relay-ingress.html" rel="noreferrer">this</a>, but it that the right way?</p> <p>I can see that I can do portforward to e node, like:</p> <pre><code>kubectl port-forward hello-nginx 8080:80 </code></pre> <p>But I want to play and try to scale and...
<p>The best approach would be using a Ingress, as you mentioned. That way, you could send requests to your local machine IP and the Ingress controller would send the traffic to the right <code>Pods</code>.</p> <p>For that you need to:</p> <ul> <li>Create <a href="https://kubernetes.io/docs/concepts/services-networkin...
<p>I have three cluster in Google Kubernetes Engine. (I called Cluster A, B C). In three cluster, i deployed some services.</p> <p>Im trying call example api with flow : Api call Service A1 in cluster A (Gke-A), and service A1 call service B1 in Gke-B then service B1 call service C1 in Gke C. I'm using nginx ingress ...
<p>This question is a little vague as it is, but in general there is no proper support for accessing services running in antother Kubernetes Cluster inside GCE, yet.</p> <p>One thing that could work would be to use an internal GCE load balancer and headless service pointing to this LBs IPs. But I'm not sure if/how tha...
<p>When creating a service, I can either specify static IP address from cluster IP range or don't specify any IP address in which case such address will be dynamically assigned. </p> <p>But when specifying static IP address, how can I make sure that it will not conflict with existing dynamically assigned IP address? I...
<p>The service ip you manually select has to be part of the selected range or you'll receive an <code>invalid</code> (422) response from kubernetes. The <a href="https://kubernetes.io/docs/concepts/services-networking/service/#choosing-your-own-ip-address" rel="nofollow noreferrer">kubernetes documentation</a> has a c...
<p>I want to expose multiple services trough single load balancer. Each service points to exactly one pod.</p> <p>So far I tried to:</p> <pre><code>kubectl expose &lt;podName&gt; --port=7000 </code></pre> <p>And in Azure portal to manually set either load balancing rules or Inbound Nat rules, pointing to exposed po...
<p>Depends on how you want to separate services on the same IP. The two ways that come to my mind are :</p> <ul> <li>use NodePort services and then map some ports from your LB to that part on your cluster nodes. This gives separation by port.</li> <li>way more interesting in my opinion is to use Ingress/IngressControl...
<p>I want to expose multiple services trough single load balancer. Each service points to exactly one pod.</p> <p>So far I tried to:</p> <pre><code>kubectl expose &lt;podName&gt; --port=7000 </code></pre> <p>And in Azure portal to manually set either load balancing rules or Inbound Nat rules, pointing to exposed po...
<p>In Azure container service, Azure will use Load Balancer to expose k8s services, like this:</p> <pre><code>root@k8s-master-E27AE453-0:~# kubectl get svc NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE jasonnginx 10.0.41.194 52.226.33.200 8080:32011/TCP 4m kubernetes 10.0.0.1 &lt;none&...
<p>I am trying trying to use a persistent disk from GCE on a GKE project.</p> <p>Here are the steps I used:</p> <p>gcloud compute disks create --size 50GB XXX</p> <p>And here is the response:</p> <hr> <p>WARNING: You have selected a disk size of under [200GB]. This may result in poor I/O performance. For more info...
<p>If you go the manual route, you need to both create the disk in gcloud AND create PV in kubernetes.</p> <p>Although, why not make use of the flexibility kube gives you with this cloud provider and stick with <a href="https://kubernetes.io/docs/concepts/storage/dynamic-provisioning/" rel="nofollow noreferrer">dynami...
<p>I'm starting to write helm charts for our services.</p> <p>There are two things I'm not sure how they are supposed to work or what to do with them.</p> <p>First: the release name. When installing a chart, you specify a name which helm uses to create a release. This release name is often referenced within a chart to ...
<p>Are you pulling in <code>postgresql</code> as a subchart of your chart (via your chart's <code>requirements.yaml</code>)? If so, both the <code>postgresql</code> (sub) chart and your chart will have the <strong>same</strong> <code>.Release.Name</code> - thus, you could specify your container's environment as</p> <...
<p>I am using Kubernetes Engine on the Google Cloud Platform. I have a pod running a process in a Docker scratch container. I also have a load balancer service that gives me access to the pod from the outside world.</p> <p>The process running in the pod needs to know what its external IP address is. How can I get this...
<p>Every Pod (unless configured not to do so) has valid kubernetes credentials in <code>/var/run/secrets/kubernetes.io/serviceaccount/token</code> <a href="https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/#accessing-the-api-from-a-pod" rel="nofollow noreferrer">as described here</a> so the ans...
<p>I attempted to upgrade to 1.7 to 1.9 using kubeadm, kube-dns was crashloopig. I removed the deployment and applied the a new deployment using the latest yaml for kube-dns (replacing the clusterip with 10.96.0.10, domain with cluster.local).</p> <p>The kubedns container fails after not being able to get a valid r...
<p>Kubedns 1.14.7 does not work well with kubernetes 1.9.1. In my case, kubedns was trying to connect to apiserver using 443 and not, as configured, 6443.</p> <p>When I changed the image version to 1.14.8 (newest - <a href="https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/dns" rel="nofollow noreferr...
<p>I have a working cluster with services and PODS/replicas running. If I an not wrong, if a service is created with Type=NodePort/LoadBalancer, Kube-proxy creates a new NodePort in all the nodes and creates a iptable rule. If I add a new Node to the cluster, does Kube-proxy creates a NodePort in the newly added Node ...
<p>Yes it does. That's what kubeproxy is meant to do.</p>
<p>I'm running Jenkins on Kubernetes with the git plugin installed. Now I want to use git commands in my script, which fails with the log: </p> <pre><code>script.sh: line 1: git: not found </code></pre> <p>My script: </p> <pre><code>stage('Package Helm Chart'){ sh """ #!/bin/bash ...
<p>The sh command in question should run on a jenkins node inside a node block. This command will then run in a shell on that node. To use git in the sh tag of a pipeline script you need to have git installed and on the PATH on the node that you want to use.</p> <p>If you are using Kubernetes, then I assume you are ru...
<p>I'm trying to deploy my Lagom accessservices on Kubernetes.</p> <p>To do that I tried to containerize my service using fabric8’s docker-maven-plugin.</p> <p>So, I added the following plugin settings to the root project pom.xml to register the fabric8 Maven plugin:</p> <pre><code>&lt;plugin&gt; &lt;groupId&gt;...
<p>You need to use other <code>imagePullPolicy</code> different than <code>Never</code>, otherwise kubernetes will never try to download the image for your container. <a href="https://kubernetes.io/docs/concepts/configuration/overview/#container-images" rel="nofollow noreferrer">You can choose</a> between Always or IfN...
<p>I am trying to access the kubernetes Dashboard using the config file. From the authentication when I select config file its giving ‘<code>Not enough data to create auth info structure</code>.’ Bu the same config file work for kubectl command.</p> <p><a href="https://i.stack.imgur.com/VEzb9.png" rel="noreferrer"><i...
<p>After looking at this answer <a href="https://stackoverflow.com/questions/46664104/how-to-sign-in-kubernetes-dashboard">How to sign in kubernetes dashboard?</a> and source code figured the kubeconfig authentication.</p> <p>After kubeadm install on the master server get the <strong>default</strong> service account t...
<p>Update:</p> <p>I got the NodePort to work: <code>kubectl get services</code></p> <pre><code>NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE kubernetes ClusterIP 10.96.0.1 &lt;none&gt; 443/TCP ...
<p>As far as I can tell from the output you posted, everything should be running smoothly in your local kubernetes cluster.</p> <p>However, your ingress controller is exposed using a <code>LoadBalancer Service</code> as you can tell from the following portion of the output you posted:</p> <pre><code>==&gt; v1/Service...
<p>I am using Kubernetes 1.8.6 on Google Kubernetes Engine and have a pod running Alpine as part of a <code>StatefulSet</code>.</p> <p>I have logged into my pod using <code>kubectl exec -it my-pod-0 -- /bin/sh</code> and then run the following commands at the prompt:</p> <pre><code>$ CA_CERT=/var/run/secrets/kubernet...
<p>You're not doing anything wrong. That pod's service account (specified in the pod's serviceAccountName) simply doesn't have any API permissions. </p> <p>You can grant a view role to that service account like this:</p> <pre><code>kubectl create rolebinding default-viewer \ --clusterrole=view \ --serviceaccount=...
<p>Use <code>helm</code> install can set value when install a chart like:</p> <pre><code>helm install --set favoriteDrink=slurm ./mychart </code></pre> <p>Now want to set value like:</p> <pre><code>helm install --set aws.subnets=&quot;subnet-123456, subnet-654321&quot; ./mychart </code></pre> <p>But failed:</p> <pre><c...
<p>According to <a href="https://github.com/kubernetes/helm/issues/1987#issuecomment-280497496" rel="noreferrer">https://github.com/kubernetes/helm/issues/1987#issuecomment-280497496</a>, you set multiple values using curly braces, for example:</p> <pre><code>--set foo={a,b,c} </code></pre> <p>So, in your case it wou...
<p>I did nginx ingress controller tutorial from <a href="https://github.com/kubernetes/ingress-nginx/blob/master/deploy/README.md" rel="noreferrer">github</a> and exposed kubernetes dashboard</p> <pre><code>kubernetes-dashboard NodePort 10.233.53.77 &lt;none&gt; 443:31925/TCP 20d </code></pre> <p>cre...
<p>As you pointed out, looks like nginx is proxying your https request to <code>ipWhichEndsWith.249:8443</code>, which is an HTTPS endpoint, using <code>http</code> as protocol. </p> <p>You should add the following annotation to your PodSpec:</p> <blockquote> <p><strong>LATEST</strong></p> <p>This annotation w...
<p>I'm quite new to the kubernetes and just wondering about several things.</p> <p>Consider I have two repositories (front-e, backe-e). Each of them builds into the docker image. </p> <p>I want to manage these two images with the kubernetes and run them inside the cluster. </p> <p>What is the best practice to store ...
<p>IMHO the best practice for this is <a href="https://helm.sh/" rel="nofollow noreferrer">helm</a>, the Kubernetes, package manager. In short, it allows you to use k8s manifests, such as deployment, service, persistence, etc., with the option to parameterize these with variables.</p> <p>You ask if it is better to kee...
<p>I'm using Openshift and Kubernetes as cloud platform for my application. For test purposes I need to intercept incoming http requests to my pods. Is this possible to do that with Kubernetes client library or maybe it can be configured with yaml?</p>
<p>Simple answer is no, you can't.</p> <p>One of the ways to overcome this is to exec into your container (<code>kubectl exec -it &lt;pod&gt; bash</code>), install tcpdump and run something like <code>tcpdump -i eth0 -n</code>.</p> <p>A more reasonable way to have it solved on infra level is to use some tracing tool ...
<p>I have created self-signed user certificates for my kubernetes cluster and now want to distribute respective kubeconfig files to the users. </p> <p>How to I transform the .crt and .key files I used for the process to kubeconfig inline format? </p> <p>Here is a redacted sample inline representation of the crt file:...
<p>Simply encode it with Base 64 : <code>cat mycert.crt | base64 -w0</code></p>
<p>I'm trying to run pod with Cassandra database, below is its deployment description:</p> <pre><code>- apiVersion: extensions/v1beta1 kind: Deployment metadata: name: cassandra namespace: test spec: progressDeadlineSeconds: 600 replicas: 1 revisionHistoryLimit: 2 selector: matchLab...
<p>Your pod is in <code>CrashLoopBackoff</code> state. This means that the container inside your pod is terminating its execution, kubernetes is trying to run it again, but it terminates again, giving you a <code>Crash Loop</code>.</p> <p>I suggest you to take a look at the container's output by running:</p> <pre><co...
<p>Istio and gRPC seem complementary and I'd like to use both in the clusters.</p> <p>The thing is that they both add an extra container which receives/proxy communication between pods / microservices.</p> <p>Is it advised or not to use both in parallel in all pods?</p> <p>Are there particular adaptations to do if one ...
<p>Istio and gRPC do work well together, when declaring your services ports' to istio just make sure to name them <code>grpc-something</code> so the proxy knows it is h2/grpc traffic and route it properly</p> <p>You mention that gRPC adds an extra container - why not having your service speak gRPC natively ? </p> <p>...
<p>Not really a programming question but quite curious to know how does Kubernetes or Minikube manage secrets &amp; uses it on multiple nodes/pods?</p> <p>Let's say if I create a secret to pull image with <code>kubectl</code> as below - </p> <pre><code>$ kubectl create secret docker-registry regsecret --docker-server...
<p>All data in Kubernetes is managed by the <code>API Server</code> component that performs CRUD operations on the data store (current only option is <code>etcd</code>). </p> <p>When you submit a <code>secret</code> with <code>kubectl</code> to the <code>API Server</code> it stores the resource and data in <code>etcd<...
<p>I'm trying to use PodSecurityPolicy to harden my cluster. I created 2 Pod Security Policies, one is default which allows minimal privilege and the other one is restricted which allows all privileges of a pod can request by SecurityContext. The default one can be used by any service account, the restricted one can on...
<p>Namespaces allow you to limit a user to a set of service accounts. Untrusted users can be limited to namespaces containing only low-privileged service accounts.</p>
<p>For a rails app on production is it a good practice, besides the autoscaler, to set up some puma workers? or is it better just to have more running pods?</p>
<p>For my experience, it is better to have an higher number of smaller (in terms or resource occupation) pods rather then a smaller number of bigger pods.</p> <p>The reason why I came to this thinking are:</p> <p>1) a smaller pod is quicker to spawn up and to be moved around by kube controller;</p> <p>2) the failure...
<p>Use <code>helm</code> installed <code>Prometheus</code> and <code>Grafana</code> on <code>minikube</code> at local.</p> <pre><code>$ helm install stable/prometheus $ helm install stable/grafana </code></pre> <p>Prometheus server, alertmanager grafana can run after set port-forward:</p> <pre><code>$ export POD_NAM...
<p>In the HTTP settings of Grafana you set <code>Access</code> to <code>Proxy</code>, which means that Grafana wants to access Prometheus. Since Kubernetes uses an overlay network, it is a different IP.</p> <p>There are two ways of solving this:</p> <ol> <li>Set <code>Access</code> to <code>Direct</code>, so the brow...
<p>I am pretty new to Kubernetes and wanted to setup Kafka and zookeeper with it. I was able to setup Apache Kafka and Zookeeper in Kubernetes using StatefulSets. I followed <a href="https://github.com/kow3ns/kubernetes-zookeeper" rel="noreferrer">this</a> and <a href="https://github.com/kow3ns/kubernetes-kafka" rel="n...
<p>I had the same problem as you last week and solved it, so it's possible to expose Kafka outside Kubernetes!</p> <p><strong>Solution:</strong> In your Kafka <code>broker-config.yaml</code> you should map cluster external IP to your local DNS</p> <pre><code>kafka-I.kafka-hs.default.svc.cluster.local:9093 </code></pr...
<p>I'm quite new to the kubernetes and just wondering about several things.</p> <p>Consider I have two repositories (front-e, backe-e). Each of them builds into the docker image. </p> <p>I want to manage these two images with the kubernetes and run them inside the cluster. </p> <p>What is the best practice to store ...
<p>Similar answer to a similar question here: <a href="https://stackoverflow.com/questions/47168381/best-practices-for-storing-kubernetes-configuration-in-source-control">Best practices for storing kubernetes configuration in source control</a></p> <p>Like David says, you can always try using <a href="https://github.c...
<p>Update: Ok I am not alone: <a href="https://github.com/docker/for-mac/issues/2445" rel="nofollow noreferrer">https://github.com/docker/for-mac/issues/2445</a></p> <p>Following <a href="https://github.com/kubernetes/examples.git" rel="nofollow noreferrer">this</a>, he gets an External-ip:</p> <p>I got the YAML file...
<p>The <code>LoadBalancer</code> services require support from the underlying infrastructure. They work automatically if you deploy them in supported providers such as AWS or GKE.</p> <p>They doesn't work if you deploy them locally on your Mac or with minikube</p> <p>Details here: <a href="https://kubernetes.io/docs/...
<p>I am trying to create a Service Account with 'roles/container.admin' and i get an error saying that the role is not supported for this resource.</p> <pre><code>$ gcloud iam service-accounts add-iam-policy-binding sa-ci-vm@PROJECT-ID.iam.gserviceaccount.com --member='serviceAccount:sa-ci-vm@PROJECT-ID.iam.gserviceac...
<p>You have to use <code>gcloud projects</code> to add roles for a service account at a project level as shown <a href="https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource" rel="noreferrer">here</a>.</p> <p>This works for me:</p> <pre><code>gcloud p...
<p>Anyone try to run vm for production on a Kubernetes cluster. Is their a way to run kvm instance inside a pod ? I know that google run all the vm inside container is it planned for kubernetes ? Thank you</p>
<p>Another option is KubeVirt: <a href="https://github.com/kubevirt/" rel="nofollow noreferrer">https://github.com/kubevirt/</a></p> <p>An add-on to Kubernetes to run virtual machines, in the sense of classical virtual machines, as you can run them on VMWare, oVirt, OpenStack.</p> <p>The goal is to support migration ...
<p>I am trying to develop a Helm chart for an application to ease release management and deployment of the application to kubernetes. In order to do so, i have written a pre-install hook in the Helm chart. </p> <pre><code> apiVersion: batch/v1 kind: Job metadata: name: px-etcd-preinstall-hook labels: herita...
<p>I don't think is possible. But I'd take a different approach.</p> <p>If your application requires ETCD, why don't you check if ETCD is accesible as one of your <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/" rel="nofollow noreferrer">Pod probes</a>, like liven...
<p>We are using the kubernetes python client (4.0.0) in combination with google's kubernetes engine (master + nodepools run k8s 1.8.4) to periodically schedule workloads on kubernetes. The simplified version of the script we use to creates the pod, attach to the the logs and report the end status of the pod looks as fo...
<p>In the end we have solved this by using bearer token authentication, instead of relying on the default gcloud authentication method.</p> <p>Here are the steps that I did to achieve this.</p> <p>First create a service account in the desired namespace, by creating a file with the following content.</p> <pre><code>a...
<p>When I run an image in Kubernetes with <code>kubectl run</code>, environment variables are injected into the container.</p> <p>My problem is that the values are wrong. I do not have anything running at <code>10.0.0.1</code>. I believe the correct value there would be <code>10.1.0.1</code>. This misconfiguration cau...
<p><a href="https://github.com/kubernetes/kubernetes/blob/v1.9.0/pkg/kubelet/envvars/envvars.go#L45-L48" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/blob/v1.9.0/pkg/kubelet/envvars/envvars.go#L45-L48</a> which I found via <code>git grep SERVICE_PORT</code></p> <p>It's possible that if your <code...
<p>Use <code>Helm</code> installed <code>Prometheus</code> and <code>Grafana</code> in a kubernetes cluster:</p> <pre><code>helm install stable/prometheus helm install stable/grafana </code></pre> <p>It has an <code>alertmanage</code> service.</p> <p><a href="https://i.stack.imgur.com/ePQ9w.png" rel="noreferrer"><im...
<p>The <code>alerts</code> and <code>rules</code> keys in the <code>serverFiles</code> group of the <code>values.yaml</code> file are mounted in the Prometheus container in the <code>/etc/config</code> folder. You can put in there the configuration you want (for example take inspiration by the blog post you linked) and...
<p>I have am using Google Kubernetes Engine 1.8.6 and have a load balancer configured as below:</p> <pre><code>apiVersion: v1 kind: Service metadata: name: my-load-balancer spec: ports: - port: 19222 name: my-test-port protocol: TCP targetPort: 19222 - port: 9222 name: my-prod-port protocol...
<p>You can't do this directly, because a <code>Service</code> has a single <code>NodeSelector</code> that is valid for all its ports. </p> <p>One option you have is to run a third pod that acts as a proxy. It receives connections on both ports and forwards the traffic to your backend a based on the port the incoming t...
<p>List installed <code>Helm</code> resources:</p> <pre><code>$ helm ls NAME REVISION UPDATED STATUS CHART NAMESPACE myresource1 1 Fri Jan 19 10:00:02 2018 DEPLOYED my-chart-1.0.0 default myresource2 1 Sat Jan 20 10...
<p>I don't think there is a built-in way of doing it, but you can use some good old bash</p> <pre><code>helm list --short | xargs -L1 helm delete </code></pre> <p>Remember to add the <code>--purge</code> flag if you want to delete everything related to the release.</p>
<p>I'd like to know how I can add a ConfigMap to a specific pod spawned by a StatefulSet.</p> <p>I've looked at the spec and I can't figure out how to ensure that a pod only mounts a ConfigMap with a specific label. I've already got a workaround ready in the form of a container. However I'd still like to know if this ...
<p>You can't threat a pod inside the same StatefulSet as a special pod. Simply because you can only specify a single <code>PodSpec</code> that's valid for the whole set.</p> <p>What you could do, but it is still an hack, is mount all versions of the config files in every pod and run an entrypoint script that uses a di...
<p>I'm trying to use nginx to reverse proxy into kubernetes pods running various web apps. My issue is that I can only proxy when location is set to <code>/</code> and not <code>/someplace</code></p> <p>I know the internal IPs are working because both web apps load successfully when I use them with <code>location /</c...
<p>Try adding the URL in your proxy location like this:</p> <pre><code>location = /app1/ { proxy_pass http://10.82.5:80/; } </code></pre> <p>Adding a trailing <code>/</code> at the end of the proxy_pass forces nginx to strip the <code>/app1</code> prefix from your requests while sending it to the backend.</p> <p>E...
<p>I try to use the post steps with the Jenkins kubernetes plugin. Does anyone has an idea?</p> <pre><code>java.lang.NoSuchMethodError: No such DSL method 'post' found among steps </code></pre> <p>My pipeline:</p> <pre><code>podTemplate( label: 'jenkins-pipeline', cloud: 'minikube', volumes: ...
<p>As of this writing, <a href="https://issues.jenkins-ci.org/browse/JENKINS-44160" rel="nofollow noreferrer"><code>Post</code> is only supported in declarative pipelines</a>. </p> <p>You could have a look at their <a href="https://github.com/jenkinsci/kubernetes-plugin/blob/master/examples/declarative.groovy" rel="no...
<p>I am new to Kubernetes, and have a question about it. </p> <p>When we create a statefulset, it gets associated with its PVC and the PVC will be associated a storageclass. </p> <p>So when we execute command "kubectl delete namespace", should it delete the storageclasses also?</p> <p>P.S. The cluster is running ...
<p><strong>Not All Objects are in a Namespace</strong></p> <p>Most Kubernetes resources (e.g. pods, services, replication controllers, and others) are in some namespaces. And low-level resources, such as nodes and persistentVolumes, are not in any namespace. <a href="https://kubernetes.io/docs/concepts/storage/persiste...
<p>I will try to explain my problem below, </p> <ol> <li><p>Create a pod using deployment and then apply one more update on it using <code>kubectl apply -f sampledep.yaml</code>.</p></li> <li><p>Pod name would have changed if we do <code>kubectl get pods</code>.</p></li> <li><p>So whatever logs we had in our previous ...
<ol> <li><p>Try to run <code>kubectl get pods --show-all</code>. If you can find your pod there you can just use <code>kubectl logs &lt;pod name&gt;</code>. If not, I don't think you can retrieve the logs anymore.</p></li> <li><p>The recommended way to manage logs in k8s is using an addon like <a href="https://github.c...
<p>In the kubernetes go client, what is a <code>clientset</code>?</p> <p>It is defined in multiple places. </p> <ol> <li><p>In the <code>client-go</code> package. <a href="https://github.com/kubernetes/client-go/blob/62b2cb756b8cea8fba00764ff123993eb44dbd48/kubernetes/clientset.go#L120" rel="noreferrer">https://githu...
<p>Every resource type in Kubernetes (Pods, Deployments, Services and so on) is a member of an <a href="https://kubernetes.io/docs/concepts/overview/kubernetes-api/#api-groups" rel="noreferrer">API group</a>. These logically "group" the different types. Some examples of groups are</p> <ul> <li><code>core</code></li> <...
<p>I'm going to upgrade my Kubernetes cluster to the version <code>1.8.7</code>. Does anybody know which docker version is best compatible with it?</p> <p>This is what I found on the Kubernetes official page, but I suppose it might be for the latest k8s release (<code>1.9</code>)?</p> <blockquote> <p>On each of you...
<p>According to the <a href="https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.8.md/#external-dependencies" rel="nofollow noreferrer">kubernetes v1.8.0 changelog</a></p> <blockquote> <p>Continuous integration builds use Docker versions 1.11.2, 1.12.6, 1.13.1, and 17.03.2. These versions were validated...
<p>I need to be able to run a shell script (my script is for initializing my db cluster) to initialize my pods in Kubernetes,</p> <p>I don't want to create my script inside my dockerfile because I get my image directly from the web so I don't want to touch it.</p> <p>So I want to know if there is a way to get my scri...
<p>It depends what exactly does your init script do. But the <a href="https://kubernetes.io/docs/concepts/workloads/pods/init-containers/" rel="nofollow noreferrer">InitContainers</a> should be helpful in such cases. Init containers are run before the main application container is started and can do some preparation wo...
<p>I have created a development deployment for an application using kops, kubectl, and EC2.</p> <p>When I set up this deployment, I created a Kops IAM user as specified in <a href="https://github.com/kubernetes/kops/blob/master/docs/aws.md" rel="nofollow noreferrer">this</a> guide. Everything has worked fine for me ma...
<p>I think the best way to handle this would be to enter the AWS Console as the Root. Go to IAM and select the kops user. In the Security credentials tab, create a new access key and share the credentials with the other developer by forwarding him/her the csv file. Once he/she downloads the csv have them try the <co...
<p>Im running:</p> <ul> <li><strong>OpenShift Master:</strong> v3.6.0+c4dd4cf</li> <li><strong>Kubernetes Master:</strong> v1.6.1+5115d708d7</li> </ul> <p>I had to restart the master node, and some pods are failing to start.</p> <p>When I <code>describe</code> the problematic pods I see:</p> <pre><code>Events: Fi...
<p>run this command: </p> <p><code>oc get events</code> </p> <p>That should give you more useful information.</p>