prompt
stringlengths
65
38.7k
response
stringlengths
41
29.1k
<p>I am trying to deploy a "Hello world" Spring Boot app on Kubernetes (Minikube). The app is really simple, just one method, which is mapped on a GET resource. I even do not specify a port.</p> <p>I am now trying to deploy the app on Minikube, and making it available using a Service:</p> <pre><code>kind: Service api...
<blockquote> <p>For me, it looks like the Service sets a property server.port as environment variable</p> </blockquote> <p>No, kubernetes it is exposing "docker compatible" <a href="https://docs.docker.com/network/links/#environment-variables" rel="noreferrer">link env-vars</a> which, because your <code>Service</cod...
<p>I just setup kubernetes using minikube on my local mac.</p> <p>Created a service with type NodePort and able to access my service outside the cluster using the url <code>&lt;Cluster_IP&gt;:&lt;NodePort&gt;</code>.</p> <p>Enabled ingress on my minikube and able to route calls from outside the cluster to the service...
<p>It is by far the best approach to use your infrastructure potential to the fullest. If you have a network loadbalancer where you can configure VIP and point it to your nodes (NodePort) then for http(s) services I would strongly advise doing just that. </p> <p>For convenience I would configure one IP and point it to...
<p>My goal is to model a hybrid/heterogeneous Kubernetes cluster, where I have the following setup:</p> <ul> <li>Master node runs on AWS (cloud) - ip-172-31-28-6</li> <li>Slave node runs on my laptop - osboxes</li> <li>Slave node runs on a Raspberry Pi - edge-1</li> </ul> <p>Running a Kubernetes cluster with three VM...
<p>You definitely have a problem with networking between Kubernetes master and nodes.</p> <p>But, first of all, that is not a best idea to create that kind of hybrid installation. You must have a stable networking between master(s) and nodes, or it will cause many problems. But that is a hard to achieve using Internet...
<p>My goal is to model a hybrid/heterogeneous Kubernetes cluster, where I have the following setup:</p> <ul> <li>Master node runs on AWS (cloud) - ip-172-31-28-6</li> <li>Slave node runs on my laptop - osboxes</li> <li>Slave node runs on a Raspberry Pi - edge-1</li> </ul> <p>Running a Kubernetes cluster with three VM...
<ol> <li>This message explains one of the crashes:</li> </ol> <p><code>FATA: 2018/03/21 09:11:26.881117 Inconsistent bridge state detected. Please do 'weave reset' and try again </code></p> <p>Since it's slightly complicated to run the <code>weave</code> command on a Kubernetes node, just reboot the node and the brid...
<p>I am trying to follow the instructions at <a href="https://docs.docker.com/docker-for-windows/kubernetes/#use-docker-commands" rel="nofollow noreferrer">https://docs.docker.com/docker-for-windows/kubernetes/#use-docker-commands</a> for running a docker-compose.yml file against kubernetes on Docker for Windows.</p> ...
<p>Due to the lack of support for a <code>build</code> there would be no <code>image</code> to run for the <code>web</code> service containers. </p> <p>Compose can manage the build for you on a single Docker host. As Swarm and Kubernetes are normally run across multiple nodes, an <code>image</code> should reference a ...
<p>Using test config with Ignite 2.4 and k8s 1.9:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util" ...
<p>@Denis was right. </p> <p>Kubernetes using RBAC access controlling system and you need to authorize your pod to access to API. </p> <p>For that, you need to add a <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/" rel="nofollow noreferrer">Service Account</a> to your pod....
<p>Im using kubernetes cluster on AWS to run spark jobs ,im using spark 2.3 ,now i want to run spark-submit from AWS lambda function to k8s master,would like to know if there is any REST interface to run Spark submit on k8s Master?</p>
<p>Unfortunately, it is not possible for Spark 2.3, in case you are using native Kubernetes support.</p> <p>Based on description from deployment instruction, submission process contains several steps:</p> <ul> <li>Spark creates a Spark driver running within a Kubernetes pod.</li> <li><p>The driver creates executors w...
<p>I am trying to deploy my microservices using Kubernetes. And also I have one Ubuntu 16.04 machine as AWS Ec2. In that AWS Ec2 I need to use Kubernetes and deploy my microservices developed using Spring Boot. I already explored the architecture of Kubernetes. But when I am learning how to install Kubernetes in Ubuntu...
<p>Let's clarify one by one.</p> <blockquote> <p>Can I use one ubuntu 16.04 machine for both master and worker for my microservice deployment?</p> </blockquote> <p>Yes, you can use one server for all components, but if you will run your master and node in different VMs or containers. Theoretically, it is possible t...
<p>I have a kubernetes cluster that is running on AWS EC2 instances and weave as networking(cni). I have disabled the docker networking(ipmask and iptables) as it is managed by weave(to avoid network conflicts). <br></p> <p>I have deployed my Jenkins on this cluster as K8s pod and this jenkins uses jenkins kubernetes ...
<p>Ok finally after lot of struggle I find the solution.<br> So when ever K8s starts a pod it starts a sidecart container whose role is basically to provide network to pod containers.<br> So while running docker build if I pass it's container ID as network then my intermediate contexts start getting internet connectivi...
<p>I have 3 nodes in kubernetes cluster. I create a <code>daemonset</code> and deployed it in all the 3 devices. This <code>daemonset</code> created 3 pods and they were successfully running. But for some reasons, one of the pod failed. </p> <p>I need to know how can we restart this pod without affecting other pods i...
<p><code>kubectl delete pod &lt;podname&gt;</code> it will delete this one pod and Deployment/StatefulSet/ReplicaSet/DaemonSet will reschedule a new one in its place</p>
<p>Can someone please let me know what are the steps that needs to be followed to mount an Azure fileshare that has files in it, and will need to mount it on a pod in Kubernetes.</p>
<p>As I see in the <a href="https://learn.microsoft.com/en-us/azure/storage/files/storage-how-to-use-files-linux" rel="nofollow noreferrer">documentation</a>, Azure using SMB protocol for access a data:</p> <blockquote> <p>Azure Files can be mounted either via SMB 2.1 and SMB 3.0. For connections coming from clients...
<p>We have a Kubernetes 1.7.8 clusters deployed with Kops 1.7 in HA with three masters. The cluster has 10 nodes and around 400 pods.</p> <p>The cluster has heapster, prometheus, and ELK (collecting logs for some pods).</p> <p>We are seeing a very high activity in the masters, over 90% of CPU used by the api-server.<...
<p>Regarding the Kubernetes architecture this is a normal behavior because all kubernetes cluster components are calling the api-server to watch for changes. </p> <p>That is why you have more than 5000 WATCH entries in your logs. Please take a look how the <a href="https://kubernetes.io/docs/admin/high-availability/bu...
<p>I am experimenting with GKE cluster upgrades in a 6 nodes (in two node pools) test cluster before I try it on our staging or production cluster. Upgrading when I only had a 12 replicas nginx deployment, the nginx ingress controller and cert-manager (as helm chart) installed took 10 minutes per node pool (3 nodes). I...
<p>That is a bit complex question and I am definitely not sure that it is like how I thinking, but... Let's try to understand what is happening.</p> <p>You have an upgrade process and have 6 nodes in the cluster. The system will upgrade it one by one using Drain to remove all workload from the pod.</p> <p>Drain proce...
<p>I have nodejs code running inside a pod. From inside the pod I want to find the zone of the node where this pod is running. What is the best way do do that? Do I need extra permissions?</p>
<p>I have not been able to find a library but I post the code that does it below. The getContent function was slightly adapted from this <a href="https://www.tomas-dvorak.cz/posts/nodejs-request-without-dependencies/" rel="nofollow noreferrer">post</a> This code should work inside a GKE pod or and GCE host.</p> <p>Use...
<p>I saw some example where the Kubernetes cluster is installed with ingress controller and then the ingress class is added with annotations and host as below.</p> <pre><code>apiVersion: extensions/v1beta1 kind: Ingress metadata: annotations: kubernetes.io/ingress.class: nginx spec: rules: - host: testsvc.k8...
<p>The DNS for all the hostnames in your given example (e.g. <code>testsvc.k8s.privatecloud.com</code>) would point to the machine or load-balancer through which traffic will reach the Ingress controller's nginx, as is described in <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="nofollow...
<p>Posting this question on behalf of a customer:</p> <p>We are trying to integrate Kubernetes OIDC authentication with Azure AD. According to the documentation in order to use User groups we need to pass the following option to the Kubernetes API service: <code>--oidc-groups-claim user_roles</code> Api service uses <...
<p>First,as I known, AAD <code>id_token</code> only supports <code>role</code> claim, NOT <code>user_role</code>. It can be added into <code>id_token</code> by adding <code>appRoles</code> property of the AAD application manifest. And bit in theconfig is needed to match the audience from tokens retrieved by the Azure A...
<p>Working on getting development environment setup in Minikube and ran across an issue pulling images from the <code>https://quay.io/v2/</code> registry. </p> <p>I have ran the command:<br> <code>eval $(minikube docker-env)</code> . </p> <p>Which allows me to build my local <code>Dockerfile</code> in Minikube and i...
<blockquote> <p>as it seems like it cant resolve the URL</p> </blockquote> <p>What lead you to believe that, when the error clearly states that it has a <code>Client.Timeout exceeded while awaiting headers</code>? It resolved the registry to an IP address, and even apparently opened a network connection to what it t...
<p>I saw some example where the Kubernetes cluster is installed with ingress controller and then the ingress class is added with annotations and host as below.</p> <pre><code>apiVersion: extensions/v1beta1 kind: Ingress metadata: annotations: kubernetes.io/ingress.class: nginx spec: rules: - host: testsvc.k8...
<p>In addition to @Matthew L Daniel answer. The kubernetes Ingress works as a proxy between external network and your cluster. The behavior of the ingress is explained in the <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="nofollow noreferrer">object ingress</a>. For example: </p> <pre>...
<p>I'm doing a prototype where one service depends on an availability of other. Scenario:</p> <ul> <li>Service A is assumed to be already available in a local network. It was either deployed by K8S or manually (or even a managed one provided by AWS etc.).</li> <li>Service B depends on environment variable <code>SERVIC...
<p>You can use <a href="https://kubernetes.io/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/" rel="nofollow noreferrer">attach handlers to lifecycle events</a> for update your environment variables on start.</p> <p>Here is an example: <code> apiVersion: v1 kind: Pod metadata: name: appB spec: c...
<p>I've created a Kubernetes deployment. However, there seem to be additional pods running - that I'm hoping to be able to delete the unnecessary ones. </p> <p>I see no need to run the dashboard container. I'd like to remove it to free up CPU resources.</p> <p>How can I disable this container from starting up? Prefe...
<h2>Update 2023-03</h2> <p>To have a clean removal you must to delete a lot of objects. Overtime removing the dashboard has been a common problem, so you can now do this:</p> <pre><code>kubectl delete -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml </code></pre> <p>If you do...
<p>I'm receiving the following error when the runner is trying to retrieve a resource:</p> <pre><code>checking failed - Expected to find variables: git </code></pre> <p>my resource looks similar to:</p> <pre><code>- name: resource-repo type: git source: uri: https://[url] branch: master tag_filter: '...
<p>Based on information from the <a href="https://github.com/kubernetes/charts/tree/master/stable/concourse#kubernetes-secrets" rel="nofollow noreferrer">documentation</a>:</p> <blockquote> <p>By default, this chart will use Kubernetes Secrets as a credential manager. For a given Concourse team, a pipeline will look...
<p>We have deployed a K8S cluster using ACS engine in an Azure public cloud. We are able to create deployments and services but when we enter a pod using "<strong>kubectl exec -ti (pod name) (command)</strong>" we are receiving the below error,</p> <blockquote> <p><strong>Error from server: error dialing backend: di...
<p>Verify the node on which your pod is running can be resolved and reached from inside the API server container. If you added entries to <code>/etc/resolv.conf</code> on the master node verify they are visible in the APIserver container, if they are not, restarting the API server pod might be helpful </p>
<p>My service dispatches to multiple replicas of a deployment. Usually the load will of course be balanced round-robin style (K8s default).</p> <p>But what happens if one of the backend instances is temporarily offline, i.e. it closes its port (<code>80</code> in that case) for some time but the pod still running? Wil...
<p>I think you're looking for <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#define-readiness-probes" rel="nofollow noreferrer">readiness probes</a>. By configuring a readiness probe for your pod, Kubernetes will periodically check your pod to figure out if it's a...
<p>I'm getting the following error</p> <pre><code>Error: found in requirements.yaml, but missing in charts/ directory: dependency-chart </code></pre> <p>when I try to install a chart. The chart has a dependency on <code>dependency-chart</code>. </p> <p><code>requirements.yaml</code>:</p> <pre><code>dependencies: - ...
<p>I've started debugging the Helm project locally and I stumbled upon this:</p> <pre><code>// If a .helmignore file matches, skip this file. if rules.Ignore(n, fi) { return nil } </code></pre> <p>This reminded me that, for some reason, I've added <code>charts/</code> to the <code>.helmignore</code> file. And tha...
<p>There is a cluster Kubernetes and IBM Cloud Private with two workers. I have one deployment which creates two pods. How can I force deployment to install its pods on two different workers? In this case if I lost one icp worker I always have other with need pod.</p>
<p>If you want pods to not schedule on the same node, the correct concept that you will want to use is inter-pod anti-affinity. <a href="https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#inter-pod-affinity-and-anti-affinity-beta-feature" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/con...
<p>We decided to move our apps from Service:LoadBalancer to Ingress, and I've chosen <strong>Nginx Ingress Controller</strong>, as I'm familiar with it, and because it's one of the most popular controllers in Kubernetes world</p> <p>Previously we had Nginx => Uwsgi combination that stands behind ELB. We compile nginx ...
<ol> <li>There's nothing wrong in principle with having 2 or more nginx in a proxy chain, other than, as alluded to in the question and in the below, the extra complexity.</li> <li>It is a pain to maintain consistent configuration across multiple proxies, and in particular to have upstream configuration bleed into ingr...
<p>I have a backend nodeJS application running in a kubernetes cluster. Now I want to run two cron jobs to be scheduled every month. The cron jobs are in a JS file. How do I create a job that runs those JS files in the pod running that service every month using Kubernetes ? <br> This link gives a basic understanding of...
<p>Unfortunately, you cannot run the <a href="https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/" rel="nofollow noreferrer">CronJob</a> inside a container of your application.</p> <p>The only thing you can do is create a container which will contain your cronjob and necessary environment for running ...
<p>A <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">service</a> dispatches to multiple replicas of a <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/" rel="nofollow noreferrer">deployment</a> (default round-robin).</p> <p>The backend i...
<p>It depends on the type of Service. </p> <p>If the Service is a ClusterIP or NodePort, it's instantiated as iptables rules. Packets destined for the now offline pod will be undeliverable, causing the request to timeout. </p> <p>If the Service is a LoadBalancer, the implementation is an application, like nginx or an...
<ol> <li>I use a local kubernetes bundled with docker on Mac OS.</li> <li>I've installed the <a href="https://github.com/jnewland/local-dev-with-docker-for-mac-kubernetes" rel="nofollow noreferrer">nginx-ingress-controller</a>.</li> <li>I managed to send external http <a href="https://kubernetes.io/docs/concepts/servic...
<p>This is not well supported via the ingress mechanism and is an <a href="https://github.com/kubernetes/kubernetes/issues/23291" rel="noreferrer">open issue</a>.<br> There is a work around for tcp or udp traffic using nginx-ingress which will map an exposed port to a kubernetes service using a configmap.<br> See <a hr...
<p>I noticed every node in a cluster has an external IP assigned to it. That seems to be the default behavior of Google Kubernetes Engine.</p> <p>I thought the nodes in my cluster should be reachable from the local network only (through its virtual IPs), but I could even connect directly to a mongo server running on a...
<p>GKE recently added a new feature allowing you to create <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/private-clusters" rel="nofollow noreferrer">private clusters</a>, which are clusters where nodes do not have public IP addresses. </p>
<p>I'm new to Kubernetes and I'm having trouble with a Deployment that specifies the backend database for the system. For some reason, the Pod hosting the database container gets randomly recreated, and so the data get wiped out. I'm adding a config for the database deployment to use a separate <code>emptyDir</code> vo...
<p>Kubernetes' Deployment abstraction is not a good fit for stateful programs such as a database. It's not entirely impossible to that right, but that's not the right tool for the job.</p> <p>I suggest you look into <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/" rel="nofollow noreferr...
<p>I installed minikube on my windows laptop and everything was fine, but when I tried to run <code>kubectl get pod</code> or any other kubectl commands I am getting this message:</p> <pre><code>kubectl get pod error: You must be logged in to the server (Unauthorized) </code></pre> <p>I do not know what am I doing wr...
<p>First, as reported <a href="https://github.com/kubernetes/minikube/issues/2317#issuecomment-351497305" rel="nofollow noreferrer">here</a> or <a href="https://github.com/kubernetes/minikube/issues/2464#issuecomment-361143511" rel="nofollow noreferrer">here</a>, check if the issue persists in the latest version (0.25....
<p>We are using Dockers and Kubernetes to containerize my .Net web application and scale up to 8-9 replicas. So we installed Dockers (in my Win 10 machine) and used Linux containers.</p> <p>Orchestration is done by Kubernetes. I would like to get the name/id of the container in which my web application is running to se...
<p>You can expose Pod fields as environment variables, the field <code>metadata.name</code> will contain the name of the Pod.</p> <p>Documentation and example: <a href="https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/#use-container-fields-as-values-for-environment-v...
<p>K8s has this feature to <a href="https://kubernetes.io/docs/tasks/administer-cluster/encrypt-data/" rel="nofollow noreferrer">encrypt secret data</a>, which requires modification of kube-apiserver config, how can i do this in GKE?</p>
<p>Short answer is, you can't.</p> <p>The Kubernetes Engine master is managed by Google, so you can't change its runtime parameters. Nonetheless, while the data may not be encrypted inside the etcd running on the master node, <a href="https://cloud.google.com/security/encryption-at-rest/default-encryption/#encryption_...
<p>I have a Elastic search setup.</p> <p>I need to deploy the same in kubernetes</p> <p>Purpose : Automatically scale up the ES server with all its data to 3 instances if the CPU/RAM reaches 90% and scale it down to one instance with all its data</p> <p>Using <code>ReplicationController</code> scaling can be possib...
<p>You will want <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/" rel="nofollow noreferrer"><code>StatefulSet</code></a>s (<a href="https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/" rel="nofollow noreferrer">tutorial</a>) for part of that problem (they honor ...
<p>I am using the Kubernetes-client java client to create Deployments on a Kubernetes cluster. THis is the code</p> <pre><code>Deployment deployment = new DeploymentBuilder() .withNewMetadata() .withName("first-deployment") .endMetadata() .withNewSpec() .withReplicas(3) ...
<p>Maybe a better way to check this is to have a loop and sleep inside to loop and continuously keep checking the status until all pods are up are running. I had done something similar to check if all the required pods were up by checking the status. But you might also want to consider adding the liveness and readiness...
<p>normally I think it's a best practice for an incorrectly configured application to simply die on startup with a detailed error message describing the problem.</p> <p>For example, if an expected environment variable is missing, meaning the application can't run properly, instead of letting it run in a zombie state w...
<p>You can customise a container's termination message by writing to <code>/dev/termination-log</code> by default. When your container terminates you can use <code>kubectl get pods &lt;podName&gt; -o go-template="{{range .status.containerStatuses}}{{.lastState.terminated.message}}{{end}}"</code> to retrieve the message...
<p>Background:</p> <p>I'm using Drone to test an application. Drone is deployed to Kubernetes, with with a <code>docker</code> (dind / docker-in-docker) container side-carred.</p> <p>After the test completes, I use drone again to build &amp; push several docker images of about ~40mb each to us.gcr.io</p> <p>When Dro...
<p>I contacted GCR support about this issue, as it seemed to only happen with GCR, and they informed me that the IAM account that was attempting to push to the registry was actually the default service account for GCE instances, and not the account that I provided to my Dockerfile.</p> <p>However, that did not explain...
<p>I have a use case where I need a Docker container under kubernetes to access a hostPath. I'm using minikube, and the container is able to access a folder in the minikube VirtualBox VM. But I can't figure out how to get it to access a folder on the host itself.</p> <p>I do these commands on the host to create /opt/f...
<p>The problem is the firewall, in Ubuntu this worked for me:</p> <pre><code>sudo ufw allow in on virbr1 sudo ufw reload </code></pre> <p>But you need to figure out the correct interface name via <code>ifconfig</code>.</p> <p>In my case I did <code>minikube ip</code> to realize the interface was <code>virbr1</code><...
<p>In this <a href="https://kubernetes.io/docs/tasks/debug-application-cluster/debug-service/#does-the-service-work-by-ip" rel="nofollow noreferrer">doc</a> they use <code>u@node$</code> to define that the command is done from a node in a cluster. But how do you get to the node from kubectl?</p> <p>It is well describe...
<p>The apiserver can be used as a HTTP proxy (as described <a href="https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster#accessing-services-running-on-the-cluster" rel="nofollow noreferrer">here</a>) to hit endpoints on Nodes, but I assume you need an SSH session which won't help.</p> <p>On GKE y...
<p>I'm a noob with Kubernetes. I'm trying to follow some recipes to get a small cluster up and running, but I'm having troubles ...</p> <p>I have a master and (4) nodes, all running Ubuntu 16.04</p> <p>installed docker on all nodes:</p> <pre><code>$ sudo apt-get update $ sudo apt-get install -y \ apt-transport-...
<blockquote> <p><code>--service-cluster-ip-range=10.96.0.0/12</code></p> </blockquote> <p>Line 76 of your pastebin shows the Service CIDR to be that, which squares with how kubernetes thinks of the world: <code>.1</code> in the Service CIDR is always kubernetes (IIRC <code>kube-dns</code> gets a pretty low IP assign...
<p>I'm trying to use minikube and kitematic for testing kubernetes on my local machine. However, kubernetes fail to pull image in my local repository (<code>ImagePullBackOff</code>).</p> <p>I tried to solve it with this : <a href="https://stackoverflow.com/questions/38748717/can-not-pull-docker-image-from-private-repo...
<p>Use the minikube docker registry instead of your local docker</p> <p><a href="https://kubernetes.io/docs/tutorials/stateless-application/hello-minikube/#create-a-docker-container-image" rel="noreferrer">https://kubernetes.io/docs/tutorials/stateless-application/hello-minikube/#create-a-docker-container-image</a></p...
<p>I have an app deployment called 'backend-app' running in pods that are on several different nodes. I also have a service that exposes the 'backend-app' to be accessed by other cluster internal pods as my 'frontend-app' pods.</p> <p>If I use DNS to connect to the 'backend-app' from my different app deployment called...
<p>For each Service with <a href="https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport" rel="nofollow noreferrer"><code>type: NodePort</code></a> a port is opened on all nodes (the same port on each). The port is open whether a pod of that service is running on a node or not. The load balancin...
<p>Recently we've experienced issues with both Non-Production and Production clusters where the nodes encountered 'System OOM encountered' issue.</p> <p>The nodes within the Non-Production cluster don't seem to be sharing the pods. It seems like a given node is running all the pods and putting a load on the system.</p...
<p>"I would recommend you manage container compute resources properly within your Kubernetes cluster. When creating a Pod, you can optionally specify how much CPU and memory (RAM) each Container needs to avoid OOM situations.</p> <p>When Containers have resource requests specified, the scheduler can make better decisi...
<p>I'm a newbie here, and i am in the process of preparing my development and production environment for a webapp Microservices architecture. I have injected environment variables through my deployment files in order to control the environment by which the app will be running. For example a Microservice running in deve...
<p>Typically you want that applications running on the <code>dev</code> environment don't interfere with applications running on the <code>production</code> environment. Using Kubernetes, you can get this kind of isolation <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/" rel="nofo...
<p>I am working on an application that is hosted on Kubernetes on google cloud, it uses Ingress to manage the routing to each service, then inside each service there's some extra routing using golang.</p> <p><strong>My problem is:</strong> when I try sending an API request to <code>/api/auth/healthz</code> I am expect...
<p><strike>based on your ingress rules the path for requests should be: <code>/api/auth/healthz</code> not <code>/api/auth-service/healthz</code></strike></p> <p>The ingress path <code>/api/auth/</code> is kept in the request uri passed to the application server. </p> <p>Adding <code>rewrite-target</code> to the ...
<p>I have a Spring Boot app running with Spring Actuator enabled. I am using the Spring Actuator health endpoint to serve as the readiness and liveliness checks. All works fine with a single replica. When I scale out to 2 replicas both pods crash. They both fail readiness checks and end up in an endless destroy/re-cre...
<blockquote> <p>The curl command hangs. It appears the entire minikube server hangs, dashboard quits responding</p> </blockquote> <p>So in that case, I would guess the VM backing <code>minikube</code> is sized too small to handle all the items that are deployed inside it. I haven't played with minikube in order to k...
<p>I have my kubernetes cluster setup on AWS where I am trying to monitor several pods, using cAdvisor + Prometheus + Alert manager. What I want to do it launch an email alert (with service/container name) if a container/pod goes down or stuck in Error or CarshLoopBackOff state or stcuk in anyother state apart from run...
<p>Prometheus collects <a href="https://github.com/kubernetes/kube-state-metrics/blob/master/docs/pod-metrics.md" rel="noreferrer">a wide range of metrics</a>. As an example, you can use a metric <code>kube_pod_container_status_restarts_total</code> for monitoring restarts, which will reflect your problem.</p> <p>It co...
<p>I have a requirement where i push bunch of key value pairs to a text/json file. Post that, i want to import the key value data into a configMap and consume this configMap within a POD using kubernetes-client API's.</p> <p>Any pointers on how to get this done would be great.</p> <p>TIA</p>
<p>You can do it in two ways.</p> <h3>Create ConfigMap from file as is.</h3> <p>In this case you will get ConfigMap with filename as a key and filedata as a value.</p> <p>For example, you have file <code>your-file.json</code> with content <code>{key1: value1, key2: value2, keyN: valueN}</code>. </p> <p>And <code>yo...
<p>Is there a way to download the container image from kuberentes pod? Let say we have multiple containers running in a Pod and we want to download the container so we can do some stuff offline in that container. The reason we want to download from Kubernetes pod directly since most of the environment settings are alre...
<p>You cannot do it by Kubernetes itself, by any special command, etc. Here is a <a href="https://github.com/kubernetes/kubernetes/issues/14561" rel="noreferrer">discussion</a> about it.</p> <p>But you still can use <code>docker commit</code> <a href="https://docs.docker.com/engine/reference/commandline/commit/" rel="...
<p><strong>The environment:</strong> I have a kubernetes cluster set up with namespaces for "dev", "sit" and "prod". In each of these namespaces i have multiple services of type:LoadBalancer which target a specific deployment of a dockerised application (i have multiple applications) so i can access each of these by ju...
<p>I now want to be able to support multiple versions of all applications (ip:/v1/, ip:/v2/ etc.) </p> <p>That is exactly what Ingress can do, but the problem is that you want to use IP addresses for routing, but Ingress is using DNS names for that. </p> <p>I think the best way to implement this is to use an Ingres...
<p>I'm deploying a helm chart that consists of a service with three replica containers. I've been following <a href="https://kubernetes.io/docs/tutorials/stateless-application/expose-external-ip-address/" rel="nofollow noreferrer">these directions</a> for exposing a service to an external IP address.</p> <p>How do I...
<p>You need to create a new service for every pod in you stateful set. To distinguish pods you need to label them with their names like described <a href="https://github.com/kubernetes/kubernetes/issues/44103#issuecomment-326851272" rel="nofollow noreferrer">here</a><br> When you have separate services you can use them...
<p>We're hosting a lot of different applications on our Kubernetes cluster already - mostly Java based.</p> <p>For PHP-FPM + Nginx our approach is currently, that we're building a container, which includes PHP-FPM, Nginx and the PHP application source code. But this actually breaks with the one-process-per-container d...
<p>This is a good question because there is an important distinction that gets elided in most coverage of container architecture- that between multithreaded or event-driven service applications and multiprocess service applications. </p> <p>Multithreaded and event-driven service applications are able with a single pro...
<p>Best practice for managing 3 or 4 secrets for a single Kubernetes deployment. </p> <p>We have a deployment with some secrets repeated in all namespaces, and others that are environment specific. </p> <p>We are trying to decide between one secret file and changing only the ones that need to be, OR running 2+ secret...
<blockquote> <p>running 2+ secrets where one is foo-dev-secrets and the other is foo-universal-secrets</p> </blockquote> <p>As a for-your-consideration, a well-constructed RBAC policy would ensure that only accounts with the correct permissions would be able to read secrets if they are decomposed, which would (of co...
<p>I am using a x509 authentication for a user in Kubernetes, which works fine. However, while provide access to the deployments does not seem to be working fine, as shown below:</p> <p>Roles:</p> <pre><code># kubectl get rolebindings devops-rb -n demo -o yaml apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBindin...
<p>replicasets and deployments exist in the "extensions" and "apps" API groups, not in the legacy "" group</p> <p>try:</p> <pre><code>rules: - apiGroups: - "" resources: - pods - secrets - services - persistentvolumeclaims verbs: - get - list - watch - apiGroups: - extensions - apps resource...
<p>Is there a hard limit on the number of service accounts that can be created in Kubernetes?</p> <p>I couldn't find any documentation where this is stated.</p>
<p>It depends on the storage behind a service account registry, as coded in <a href="https://github.com/kubernetes/kubernetes/tree/master/pkg/registry/core/serviceaccount" rel="nofollow noreferrer"><code>kubernetes/kubernetes/pkg/registry/core/serviceaccount</code></a></p> <pre><code>// storage puts strong typing arou...
<p>I am trying to setup NetworkPolicy to control access to pods running in acs cluster. The cluster is created using acs-engine and networkPolicy=azure. </p> <p>The contents of the json file used to create the cluster:</p> <pre><code>{ "apiVersion": "vlabs", "properties": { "orchestratorProfile": { "orc...
<p>After exploring I found that Azure CNI policy does not support Kubernetes network policies. The solution is to use CNI that supports it eg Calico.</p> <p><a href="https://learn.microsoft.com/en-us/azure/virtual-network/container-networking" rel="nofollow noreferrer">Container networking capabilities of Azure CNI</a...
<p>I created a namespace inside Kubernetes and tried to create a container using the following command: </p> <p><code>kubectl run busybox -it ----image=busybox -- sh</code></p> <p>But now, everytime I delete the pod using <code>kubectl delete pods --all</code>, it deletes the pod that was just created and it automati...
<p>The reason it does this is because <code>kubectl run</code> implicitly creates a deployment for the pod. Deployments are tasked with ensuring a certain number of pods are always running, so when Kubernetes detects a misalignment in the number of pods the deployment <em>should</em> be running vs the number that are a...
<p>My application has some aggregation/window operation, so it has some state store which stores in the <code>state.dir</code>. AFAIK, it also writes the changelog of state store to the broker, so is that OK to consider the Kafka Stream application as a stateless POD?</p>
<blockquote> <p>My application has some aggregation/window operation, so it has some state store which stores in the <code>state.dir</code>. AFAIK, it also writes the changelog of state store to the broker, so is that OK to consider the Kafka Stream application as a stateless POD?</p> </blockquote> <p><strong>Statel...
<p>I have three namespaces dev, test and staging. test and staging have no pods in them. In dev I have nginx, ingress and a frontend service. For all requests to the nginx it's forwarded to the frontend service. </p> <p>But the issue is nginx in dev trying to find frontend service in test and staging namespaces also. ...
<p>Specify <code>--force-namespace-isolation=true</code> argument when deploying nginx pod. And update image to <code>quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.12.0</code></p>
<p>We recently upgraded from nginx ingress controller from 0.8.2 to 0.11.0, and started getting 502 bad gateway error on large file uploads around 10 MB or higher, we have set the <strong>client_max_body_size</strong> to <strong>500m</strong> through <strong>proxy-body-size</strong> in the configmap and <strong>verifie...
<p>It looks like you may need to set the bigger file size globally for all Ingress rules.</p> <p>This can be achieved by using <strong><a href="https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md#custom-max-body-size" rel="nofollow noreferrer">proxy-body-size</a></...
<p>I am writing a spark job which uses kubernetes instead of yarn.</p> <pre><code>val spark = SparkSession.builder().appName("Demo").master(????).getOrCreate() </code></pre> <p>So what should be my master, is it kubernetes or something else</p> <p>Thanks</p>
<p>I should be in the format of <code>k8s://https://&lt;k8s-apiserver-host&gt;:&lt;k8s-apiserver-port&gt;</code></p> <p><strong>From the Doc <a href="https://spark.apache.org/docs/latest/running-on-kubernetes.html" rel="nofollow noreferrer">here</a></strong></p> <blockquote> <p>URL with the format k8s://. Prefixing...
<p>I have created a deployment with two replicas in my K8S cluster with the volumes section to clone a git repo. The repo is cloned, the pods are created, deployment is created. I can login to the pod and run git commits are things look ok.</p> <p>My assumption: If I do a git push to the repository managed by gitRepo ...
<p>After some research, I think I understand the scope of gitRepo volumes now. My requirement to auto-update the pods/deployments when changes happen to git repo can be handled using a microservice such as this: <strong><a href="https://github.com/fabric8io/gitcontroller" rel="nofollow noreferrer">https://github.com/fa...
<p>We have default Ingress <code>apiVersion: extensions/v1beta1</code> serving multiple Pods in Google Kubernetes Engine. The problem appears on our website when we click link which will go through the same Ingress with large header size. It works with smaller header size.</p> <p>I have tried switching to ingress-ngin...
<p>The default load balancer witch is Ingress in GKE, block request to the backend services if requested URL and headers size is longer than about 15KB for the general <a href="https://cloud.google.com/compute/docs/load-balancing/http/#illegal_request_handling" rel="nofollow noreferrer">security reason</a>. Please cons...
<p>I have saved a docker image as a tar file locally using the command,</p> <pre><code>docker save -o ./dockerImage:version.tar docker.io/image:latest-1.0 </code></pre> <p>How to specify this file in my pod.yaml to use this tarball and start the pod instead of pulling / already pulled image to launch the container.</...
<p>There's no direct way to achieve that in Kubernetes.</p> <p>See the discussions here: <a href="https://github.com/kubernetes/kubernetes/issues/1668" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/1668</a></p> <p>They have finally closed that issue because of the following reasons:</p> <...
<p>I have a multi-regional testing setup on GKE k8s 1.9.4. Every cluster has:</p> <ul> <li>an ingress, configured with <code>kubemci</code></li> <li>3 node pools with different node labels: <ul> <li>default-pool <code>system</code> (1vCPU / 2GB RAM)</li> <li>frontend-pool <code>frontend</code> (2vCPU / 2GB RAM)</li> ...
<p>Seems like <a href="https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/" rel="noreferrer">taints and tolerations</a> did the trick. </p> <p>Create a cluster with a default node pool (for monitoring and <code>kube-system</code>):</p> <pre><code>gcloud container --project "my-project-id" clusters...
<p>I'm new to kubernetes and have setup a service with a few pods. I got this working, however I would like to remove or override the <code>Host</code> Header in the request. Can be overridden from the service somehow? I read into ingress but that will just reroute based on rules</p> <p>Thanks in advance</p>
<blockquote> <p>I read into ingress but that will just reroute based on rules</p> </blockquote> <p>With the addition that many of them offer support for <a href="https://github.com/kubernetes/ingress-nginx/blob/nginx-0.12.0/docs/user-guide/annotations.md#configuration-snippet" rel="nofollow noreferrer">custom config...
<p>I am on Jenkins 2.73.2.1 and using Kubernetes-jenkins plugin 1.4 to spin up dynamic slaves . However ,I am not able to start up parallel builds. Jenkins always puts it to build queue and executes one at a time.</p> <p>I have tried setting this while starting jenkins but it doesn't help either:</p> <pre><code>-Dhud...
<p>The solution that worked for us was combination of above JVM arguments as well as selecting "use jobs matching the current label only" in kubernetes container template section.</p> <p>We were able to run the required jobs parallelly in different pods</p>
<p>I have two kubernetes deployments say backend and frontend. frontend deployment depends on the backend deployments. Means after backend deployment pods are ready then the pods for frontend should be created. How can I specify this in the deployment yaml?</p>
<p>The solution you are looking for is <strong>Init container</strong>. Pod can have one or more Init containers and they run one after another before main Pod containers are started. Please be aware that each Init container runs until completion.</p> <p>So you can use Init containers to check availability of your bac...
<p>I created a 200G disk with the command <code>gcloud compute disks create --size 200GB my-disk</code></p> <p>then created a PersistentVolume</p> <pre> apiVersion: v1 kind: PersistentVolume metadata: name: my-volume spec: capacity: storage: 200Gi accessModes: - Read...
<p>When you use PVCs, K8s manages persistent disks for you.</p> <p>The exact way how PVs can by defined by provisioner in storage classes. Since you use GKE your default SC uses kubernetes.io/gce-pd provisioner (<a href="https://kubernetes.io/docs/concepts/storage/storage-classes/#gce" rel="nofollow noreferrer">https:...
<p>When trying to run <code>minikube</code> with hyperkit, I was getting errors about xhyve not being installed. I installed that and reran <code>minikube start --vm-driver hyperkit</code> with no issues.</p> <p>I was under the impression that hyperkit was a replacement for xhyve, not a supplement to it.</p> <p>When ...
<p><a href="https://www.docker.com/docker-mac" rel="noreferrer">Docker for Mac</a> changed virtualization layer few times last years, and it can confuse users after updates of environment.</p> <p>If the process list shows both <a href="https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#hyperkit-driver"...
<p>I am trying to set some environment variables in docker container, Below is the env definition part from the kubernetes pod definition.</p> <pre><code> env: - name: NRIA_LICENSE_KEY value: NRIA_LICENSE_KEY -name: NRIA_DISPLAY_NAME val...
<pre><code>- name: NRIA_DISPLAY_NAME value: abc-$HOSTNAME </code></pre> <p>should have two changes made to it:</p> <ol> <li><p>Ensure the thing you wish to have substituted is <em>also</em> present in the <code>env:</code> block -- I know you might think <code>$HOSTNAME</code> is universally populated, but that's ...
<p>I'm deploying a helm chart that consists of a service with three replica containers. I've been following <a href="https://kubernetes.io/docs/tutorials/stateless-application/expose-external-ip-address/" rel="nofollow noreferrer">these directions</a> for exposing a service to an external IP address.</p> <p>How do I...
<p>Just adding the official Kubernetes documentation about creating a service:</p> <p><a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/service/</a></p> <p>A Service in Kubernetes is a REST object, similar to a ...
<p>Trying to catch up with the Spark 2.3 documentation on how to deploy jobs on a Kubernetes 1.9.3 cluster : <a href="http://spark.apache.org/docs/latest/running-on-kubernetes.html" rel="noreferrer">http://spark.apache.org/docs/latest/running-on-kubernetes.html</a></p> <p>The Kubernetes 1.9.3 cluster is operating prop...
<p>Try to alter the pod network with one method except Calico, check whether kube-dns work well.</p> <p>To create a custom service account, a user can use the kubectl create serviceaccount command. For example, the following command creates a service account named spark:</p> <pre><code>$ kubectl create serviceaccount...
<p>I have two containers inside a Pod with label app=read-write. container-1 is reading on 7110 port and container-2 is listening on 7111. Now I need to connect with these containers via Services NodePorts. I create two separate services to assign NodePorts on each port (7110 and 7111).</p> <pre><code>--- apiVersion: ...
<p>The solution was rather simple, I've added two labels (with different keys) in both services, Instead of <code>app:read</code> and <code>app:write</code>, I've added <code>read: read-service</code> and <code>write: write-service</code> in my services. and in the Pod I've added both of these keys under label and se...
<p>I am pulling an image from a private repository on gitlab and running a cronjob in kubernetes. Since it is a private repo I would also have to supply the imagePullSecrets. but I noticed it gives an error because a cronjob doesn't accept the imagePullSecrets tag. It gives the following error. Does that mean I can't u...
<p>The <code>imagePullSecrets</code> field is not a per container field - you need to set that at <code>CronJob.spec.jobTemplate.spec.template.spec.imagePullSecrets</code> instead of <code>CronJob.spec.jobTemplate.spec.template.spec.containers.imagePullSecrets</code>. You can see an example for a Pod <a href="https://k...
<p>I am trying to deploy a service in Kubernetes available through a network load balancer. I am aware this is an alpha feature at the moment, but I am running some tests. I have a deployment definition that is working fine as is. My service definition without the nlb annotation looks something like this and is working...
<p>It seems there was a rule missing in the k8s nodes security group, since the NLB forwards the client IP.</p>
<p>I have a Spring boot application which is configured with https with the below properties.</p> <pre><code>server.ssl.keyStore=/users/admin/certs/appcert.jks server.ssl.keyStorePassword=certpwd server.ssl.trustStore=/users/admin/certs/trustcert server.ssl.trustStorePassword=trustpwd </code></pre> <p>These applicati...
<p>Since those keystores are password protected, arguably you could just bundle them into the docker image and reference them relative to the image's root, then inject the passwords via enviroment variables that are set from <code>Secret</code>s:</p> <pre><code>apiVersion: v1 kind: Secret metadata: name: spring-ssl ...
<hr> <p>I'm trying to translate a bunch of docker-compose files into kubernetes yamls. I have used <a href="https://github.com/kubernetes/kompose" rel="nofollow noreferrer">kompose</a>, which has gotten me part way, but I'm getting stuck on one particular part for multiple containers.</p> <p>This is one of the conta...
<p>When declaring a Pod, specify the volume at <code>spec.volumes</code>, and then the volume mount at <code>spec.containers[*].volumeMounts</code>:</p> <pre><code>apiVersion: v1 kind: Pod metadata: name: server1-backend-mysql spec: containers: - image: mysql name: mysql volumeMounts: - mountPath: /v...
<p>I have deployed kubernetes on a virt-manager vm following this link </p> <p><a href="https://kubernetes.io/docs/setup/independent/install-kubeadm/" rel="nofollow noreferrer">https://kubernetes.io/docs/setup/independent/install-kubeadm/</a> </p> <p>When i join my another vm to the cluster i find that the kube-dns ...
<p>In addition to what @justcompile has wrote you will need a minimum of <strong>2 CPU cores</strong> in order to run all pods from the <em>kube-system</em> namespace without issues. </p> <p>You need to verify how much resources you have on that box and compare it with CPU reservations which each of Pods make. </p> <...
<p>i want to use local volume that is mounted on my node on path: /mnts/drive. so i created a storageclass (as shown in documentation for local storageclass), and created a PVC and a simple pod which uses that volume.</p> <p>so these are the configurations used:</p> <pre><code>kind: StorageClass apiVersion: storage.k...
<p>If you want to use local volume that is mounted on the node on <code>/mnts/drive</code> path, you just need to use <a href="https://kubernetes.io/docs/concepts/storage/volumes/#hostpath" rel="nofollow noreferrer">hostPath</a> volume in your pod:</p> <blockquote> <p>A hostPath volume mounts a file or directory fro...
<p>I'm using the official stable ZooKeeper Helm chart for Kubernetes <a href="https://github.com/kubernetes/charts/blob/b40c8c395d8acfa428a865d8aeb9c607e0cce69c/incubator/zookeeper/templates/statefulset.yaml#L39" rel="nofollow noreferrer">which pulls a ZooKeeper Docker image</a> from Google's sample images on Google Co...
<p>Please do not use images from <code>gcr.io/google-samples</code> for production use.</p> <p>These images are used solely for GKE tutorials on cloud.google.com and they are not actively maintained, in the sense that we don't rebuild them for security vulnerabilities for the components on the images etc.</p> <p>Sour...
<p>I am using <a href="https://kubernetes.io/docs/concepts/storage/volumes/#mount-propagation" rel="nofollow noreferrer">Mount propagation</a> feature of Kubernetes to check the health of mount points of certain type. I create a daemonset and run a script which would do a simple <code>ls</code> on these mount points. I...
<p>In brief, <strong>Mount propagation</strong> allows sharing volumes mounted by a Container to other Containers in the same Pod, or even to other Pods on the same node.<br> Mount propagation of a volume is controlled by <code>mountPropagation</code> field in <code>Container.volumeMounts</code>. Its values are:</p> <...
<p>Usually ingress rewrite target works as follows:</p> <pre><code>nginx.ingress.kubernetes.io/rewrite-target: / </code></pre> <p>This will rewrite the target of your service names as they are in the root directory. So if I have this:</p> <pre><code>apiVersion: extensions/v1beta1 kind: Ingress metadata: name: demo...
<p>Unfortunately, Ingress based on free version of Nginx do not have that feature.</p> <p>But, if you can use <a href="https://github.com/nginxinc/kubernetes-ingress" rel="nofollow noreferrer">Nginx Plus based Ingress</a>, you can do it by annotation.</p> <p>Here is an <a href="https://github.com/nginxinc/kubernetes-in...
<p>I created a cluster with kops in the AWS.</p> <pre><code>sudo kops create cluster --name=k8s.ehh.fun --state=s3://kops-state-ehh000 --zones=us-east-1a --node-count=3 --node-size=t2.micro --master-size=t2.micro --dns-zone=k8s.ehh.fun </code></pre> <p>And now a Would like to change the node-count without destroy the...
<p>You can change the node count by editing the <code>nodes</code> instance group:</p> <pre><code>kops edit instancegroup nodes </code></pre> <p>This will open an editor in which you can edit your instance group's specification and increase the code count. After saving and exiting, call:</p> <pre><code>kops update c...
<p>I've a <code>Deployment</code> object where I expose the POD ID using the <a href="https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/" rel="noreferrer">Downward API</a>. That works fine. However, I want to set up another env variable, log path, with reference to the...
<p>The correct syntax is to use <code>$(FOO)</code>, as is described in the <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#envvar-v1-core" rel="noreferrer">v1.EnvVar <code>value:</code> documentation</a>; the syntax you have used is &quot;shell&quot; syntax, which isn't the way kubernetes...
<p>I'm running a Kubernetes cluster and HA redis VMs on the same VPC on Google Cloud Platform. ICMP and traffic on all TCP and UDP ports is allowed on the subnet 10.128.0.0/20. Kubernetes has its own internal network, 10.12.0.0/14, but the cluster runs on VMs inside of 10.128.0.0/20, same as redis VM. </p> <p>However,...
<p>I've tried to reproduce your issue with the same configuration, but it works fine. I've create a network called "myservernetwork1" with subnet 10.128.0.0/20. I started a cluster in this subnet and created 3 firewall rules to allow icmp, tcp and udp traffic inside the network.</p> <pre><code>$ gcloud compute firewal...
<p>I'm trying to update the deployment from the application of Go in Cluster, but it fails with an authorization error.</p> <p>GKE Master version 1.9.4-gke.1</p> <pre class="lang-go prettyprint-override"><code>package main import ( "fmt" "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/...
<p>From <a href="https://stackoverflow.com/questions/49495189/unable-to-list-deployments-resources-using-rbac">Unable to list deployments resources using RBAC</a>.</p> <blockquote> <p>replicasets and deployments exist in the "extensions" and "apps" API groups, not in the legacy "" group</p> </blockquote> <pre><code...
<p>I am trying to mount a config file created as a secret to a specific path in a pod. However, the mount path on the pod is always generated as a directory. Could someone tell me what am I doing wrong? </p> <pre><code>&gt; kubectl get secrets config NAME TYPE DATA AGE config Opaque 1 29m...
<p>The syntax you want is to select just the secret's <code>items:</code>, and not try to use <code>subPath</code> in that manner. It's <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.10/#secretvolumesource-v1-core" rel="nofollow noreferrer">documented in <code>SecretVolumeSource</code></a></p...
<p>I have defined a parent chart called base-microservice and is available at mycompany.github.com/pages/base-microservice</p> <p>Structure is as follows :</p> <pre><code> base-microservice - templates - deployment.yaml - ingress.yaml - service.yaml - Chart.yaml - values...
<p>You may want to read the <a href="https://helm.sh/docs/chart_template_guide/subcharts_and_globals/" rel="noreferrer">Subcharts and Global Values</a> doc page within Helm's repo. It covers Creating a Subchart, Adding Values and a Template to the Subchart, Overriding Values from a Parent Chart, Global Chart Values, an...
<p>I am looking for any code example that deploys Helm chart without via CLI call. The reason behind this is:</p> <ol> <li>My company got couple existing pipelines written with AWS CodePipeline / CodeBuild / CodeDeploy. They don't like to investigate more time on re-writing all pipelines.</li> <li>My company does not ...
<p>You can find my fork of pyhelm with examples and Python3 support.</p> <pre><code>git clone git@github.com:andriisoldatenko/pyhelm.git cd pyhelm &amp;&amp; python setup.py install </code></pre> <h2>How to use Pyhelm</h2> <h3>First you need repo_url and chart name to download chart</h3> <pre><code>from pyhelm.repo...
<p>I'm new to k8s and trying to run 3-nodes (master + 2 workers) cluster (v1.9.6) in Vagrant (Ubuntu 16.04) from scratch without any automation. I believe this is a right way to get hands-on experience for the beginner like me. To be honest, I've already spent on this more than a week and feel desperate.</p> <p>My pro...
<p>According to the <a href="https://kubernetes.io/docs/reference/generated/kube-apiserver/" rel="nofollow noreferrer">kube-apiserver</a> documentation:</p> <pre><code>--bind-address ip The IP address on which to listen for the --secure-port port. The associated interface(s) must be reachable by the rest of the cl...
<p>I am running a dotnet core app using Kubernetes with Docker.</p> <p>The setup is as follows:</p> <p><strong>APP</strong></p> <p>In the dotnet core app, I have Kestrel server listening on port 8080 by setting the following in Program.cs:</p> <pre><code>public static IWebHost BuildWebHost(string[] args) =&gt; WebH...
<p>use "targetPort" to indicate what port your pod is listening on. Your yaml spec should be something like:</p> <pre><code>--- apiVersion: v1 kind: Service metadata: name: myApp spec: selector: app: myApp ports: - name: http port: 8080 targetPort: 8080 nodePort: 30001 </code></pre>
<p>So when I run <code>kubectl get all --all-namespaces</code> on different machines, I get different output and I can't understand why.</p> <p>First machine (output trimmed for brevity):</p> <pre><code>kube-system po/kubernetes-dashboard-5569448c6d-w2bdb 1/1 Running 0 ...
<p>The answer lies in the details you mentioned above. The difference in kubectl version displays in different output format between the two machines.</p>
<p>Fresh Kubernetes (1.10.0) cluster stood up using kubeadm (1.10.0) install on RHEL7 bare metal VMs</p> <pre><code>Linux 3.10.0-693.11.6.el7.x86_64 #1 SMP Thu Dec 28 14:23:39 EST 2017 x86_64 x86_64 x86_64 GNU/Linux kubeadm.x86_64 1.10.0-0 installed kubectl.x86_64 ...
<p>Right so I got this going by changing from flannel to weave container networking, and a kubeadm reset and restart of the VMs.</p> <p>Not sure what the problem was flannel and my VMs but happy to have got it going. </p>
<p>I want to create a 3 node Mongo Replica set in Kubernetes. I have created a headless service as below </p> <pre><code>apiVersion: v1 kind: Service metadata: name: mongo labels: name: mongo spec: ports: - port: 27017 targetPort: 27017 clusterIP: None selector: role: mongo </code></pre> <p>I ...
<p>If you see the logs of any Pod, you will see a warning:</p> <blockquote> <p>[initandlisten] ** WARNING: This server is bound to localhost. <br/> [initandlisten] ** Remote systems will be unable to connect to this server. </p> </blockquote> <p>So, you have to provide <code>"--bind_ip"</code> flag to en...
<p>I have a ingress like the below one.</p> <blockquote> <p>kubectl get ing test-ingress -o yaml</p> </blockquote> <pre><code>apiVersion: extensions/v1beta1 kind: Ingress metadata: annotations: kubectl.kubernetes.io/last-applied-configuration: | {"apiVersion":"extensions/v1beta1","kind":"Ingress","metad...
<p>You should give the port in your Service spec a "name", and refer to that in your Ingress:</p> <pre><code>--- apiVersion: v1 kind: Service metadata: name: myApp spec: selector: app: myApp ports: - name: http port: 80 targetPort: 80 --- apiVersion: extensions/v1beta1 kind: Ingress metadata: na...
<p>I need to map a volume while starting the container, I am able to do it so with yaml file. </p> <p>Is there an way volume mapping can be done via command line without using yaml file? just like<br> <code>-v</code> option in docker?</p>
<blockquote> <p>without using yaml file</p> </blockquote> <p>Technically, yes: you would need a json file, as illustrated in "<a href="https://stackoverflow.com/q/37555281/6309">Create kubernetes pod with volume using <code>kubectl run</code></a>"</p> <p>See <a href="https://kubernetes.io/docs/reference/generated/k...
<p>I am trying to upgrade my 1.9.0 cluster to 1.10. kubeadm upgrade plan command giving below error message. How to resolve this error message</p> <pre><code> kubeadm upgrade plan [preflight] Running pre-flight checks. [upgrade] Making sure the cluster is healthy: [upgrade/config] Making sure the configuration is corr...
<p>This is followed by <a href="https://github.com/kubernetes/kubernetes/issues/61764" rel="nofollow noreferrer">kubernetes issue 61764</a>, which mentions the <a href="https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.10.md#before-upgrading" rel="nofollow noreferrer"><strong>Before upgrading</strong> se...
<p>I installed <code>ingress-nginx</code> in a cluster. I tried exposing the service with the <code>kind: nodePort</code> option, but this only allows for a port range between <code>30000-32767</code> (AFAIK)... I need to expose the service at port <code>80</code> for http and <code>443</code> for tls, so that I can li...
<p>If you want on IP for 80 port from a service you could use the externalIP field in service config yaml. You could find how to write the yaml here <a href="https://kubernetes.io/docs/concepts/services-networking/service/#external-ips" rel="nofollow noreferrer">Kubernetes External IP</a></p> <p>But if your usecase is...