prompt
stringlengths
65
38.7k
response
stringlengths
41
29.1k
<p>I have a deployment with 2 replicas of nginx with openconnect vpn proxy container (a pod has only one container). </p> <p>They start without any problems and everything works, but once the connection crashes and my liveness probe fails, the nginx container is restarted ending up in CrashLoopbackoff because the open...
<p><code>restartPolicy</code> applies to all Containers in the Pod, not the pod itself. Pods usually only get re-created when someone <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-lifetime" rel="nofollow noreferrer">explicitly deletes</a> them.</p> <p>I think this explains why the res...
<p>If some nodes down in a cluster and the status become <code>NotReady</code>, can I make it to trigger some action?</p> <p>I tried to use <a href="https://gist.github.com/irake99/2062ea54bef89a072b67461cf955b079" rel="nofollow noreferrer">client-go</a> and curl to watch <code>/api/v1/watch/nodes</code> and get notif...
<p>As of now, there is no way to query for specific updates. There are two ways you can implement this:</p> <ol> <li><p>The NodeStatus has a field called <code>lastTransitionTime</code> which records a change in a field. In your application, you can check every X seconds and then compare last checked time with <code>l...
<p>Using nginx <code>nginx-ingress-controller:0.9.0</code>, below is the permanent state of the google cloud load balancer :</p> <p><a href="https://i.stack.imgur.com/zT3mj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zT3mj.png" alt="enter image description here"></a></p> <p>Basically, the singl...
<p>Your <code>Service</code> is using the <code>service.beta.kubernetes.io/external-traffic: OnlyLocal</code> annotation. This configures it so that traffic arriving at the NodePort for that service will never go a <code>Pod</code> on another node. Since your <code>Deployment</code> only has 1 replica, the only node th...
<p>I'm trying to figure out where a program run in a container stores its logs. But, I don't have SSH access to the machine which deployed container, only <code>kubectl</code>. Suppose I had SSH access, I'd do something like this:</p> <pre><code>ssh machine-running-docker 'docker diff \ $(kubectl describe pod po...
<p>Well, for starters, an app in container should not store it's logs in files inside container. That said, it is sometimes hard to avoid when you work with 3rd party apps not configured for logging to stdout / some logging service.</p> <p>Good old <code>find</code> to the rescue - just <code>kubectl exec</code> into ...
<p>I'm trying to deploy Lagom microservices on Kubernetes by following-up the Chirper Lagom example. So According to the provided guide <a href="https://developer.lightbend.com/guides/lagom-kubernetes-k8s-deploy-microservices/" rel="nofollow noreferrer">link</a>, I configured a kubernetes cluster by installing Minikube...
<p>[Updating based on discussions in comments]</p> <p>The issue here is that the Docker CLI is not able to reach the Docker Engine. Since you are using Minikube, you can point docker CLI to Docker engine inside Minikube. That will ensure that images are built inside minikube VM and also ran there subsequently. You can...
<p>I'm certain I'm missing something obvious. I have looked through the documentation for ScheduledJobs / CronJobs on Kubernetes, but I cannot find a way to do the following on a schedule:</p> <ol> <li>Connect to an existing Pod</li> <li>Execute a script</li> <li>Disconnect</li> </ol> <p>I have alternative methods of...
<p>As far as I'm aware there is no "official" way to do this the way you want, and that is I believe by design. Pods are supposed to be ephemeral and horizontally scalable, and Jobs are designed to exit. Having a cron job "attach" to an existing pod doesn't fit that module. The Scheduler would have no idea if the job c...
<p>I've a question about helm validation of <code>resources</code> field in <code>CronJob</code> chart , any help welcome.</p> <p>I use apiVersion batch/v1beta1</p> <p>I get error when I try to retrive values from values.yaml</p> <p>The error : <code>Error: error validating "": error validating data: found `invalid ...
<p><strong>TL;DR</strong>: Indent by 14 spaces (instead of 12) and remove the additional <code>spec</code> property in your container definition.</p> <hr> <p>Mind the correct indentation in your YAML definitions. For example, the <code>containers</code> property needs to be a sub-property of the CronJob's <code>spec....
<p>I'm new to Kubernetes so I encountered the following issue. These are my steps:</p> <p>1) I ran <code>etcd</code>:</p> <pre><code>docker run --volume=/var/etcd:/var/etcd --net=host -d gcr.io/google_containers/etcd:2.0.12 /usr/local/bin/etcd --addr=127.0.0.1:4001 --bind-addr=0.0.0.0:4001 --data-dir=/var/etcd/data <...
<p>Creating a <a href="https://kubernetes.io/docs/getting-started-guides/scratch/" rel="nofollow noreferrer">kubernetes cluster from scratch</a> is a little more complicated. The master <code>kubelet</code> runs a <a href="https://kubernetes.io/docs/getting-started-guides/scratch/#apiserver-controller-manager-and-sched...
<p><code>Forbidden!Configured service account doesn't have access. Service account may have been revoked. User "system:serviceaccount:default:default" cannot get services in the namespace "mycomp-services-process"</code></p> <p>For the above issue I have created "mycomp-service-process" namespace and checked the issue...
<p>Creating a namespace won't, of course, solve the issue, as that is not the problem at all.</p> <p>In the first error the issue is that <code>serviceaccount</code> default in default namespace <code>can not get services</code> because it does not have access to list/get services. So what you need to do is assign a r...
<p>I often get errors about pods not syncing / ImagePullBackOff errors on my Kubernetes cluster on Google Kubernetes Engine. But I'm not sure how to debug the issue as I can't establish the root cause.</p> <p>In the Google dashboard I can see the ReplicaSet has the warning: Pod errors: ImagePullBackOff</p> <p>If I d...
<p>ImagePullBackOff occurs most of the time due to typos in the image name or not being able to reach the repository:</p> <ul> <li>Check for typos by copy/pasting the image name in a docker pull command (copy/paste so that any error is also copy/pasted: You want to find the error and not confirm your own bias).</li> <...
<p>I have a k8s cluster v1.8. I was trying to setup prometheus on my cluster so basically am trying to monitor services and deployment. But with the below config-map i am not able to view any of my services or deployments.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="fal...
<p>As said in the docs for the configuration job called 'kubernetes-pods' that you pasted above:</p> <blockquote> <p><code>prometheus.io/scrape</code>: Only scrape pods that have a value of <code>true</code></p> </blockquote> <p>So your pods need to have that annotation set to true in order for Prometheus to scrape...
<p>I'd like to deploy pods into my GKE Kubernetes cluster that use images from a private, third-party Docker registry (<em>not</em> GCP's private Docker registry).</p> <p>How do I provide my GKE Kubernetes cluster with credentials to that private repository so that the images can be pulled when required?</p>
<p>You need to create a secret that holds the credentials needed to download images from the private registry. <a href="https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/" rel="noreferrer">This process is explained on Kubernetes documentation</a>, but it looks like</p> <pre><code>kub...
<p>I created the kubernetes cluster and i am not able to connect to the cluster, getting below error.</p> <p>rakesh_pal@sandbox:~$ gcloud beta container clusters get-credentials map-c1 --region us-central1 --project sandboxWarning: you invoked <code>gcloud beta</code>, but with current configurationKubernetes Engine v...
<p>I succeeded after using this command:</p> <p>gcloud config set container/use_v1_api false</p>
<p>Follow <a href="https://blog.hasura.io/sharing-a-local-registry-for-minikube-37c7240d0615" rel="nofollow noreferrer">this</a> guide, I'm trying to start <code>minikube</code> and forward port at the boot time.</p> <p>My script:</p> <pre class="lang-sh prettyprint-override"><code>#!/bin/bash set -eux export PATH=...
<blockquote> <p>POD=$(kubectl get po --namespace kube-system | awk '/kube-registry-v0/ { print $1 }')</p> </blockquote> <p>Be aware that using a <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/" rel="noreferrer">selector</a> is almost certainly better than using text utilities, espe...
<p>What is the simplest way to train tensorflow models (using Estimator API) distributed across a home network? Doesn't look like ml-engine <a href="https://cloud.google.com/sdk/gcloud/reference/beta/ml-engine/local/train" rel="nofollow noreferrer">local train</a> allows you to specify IPs.</p>
<p>Your best bet is to use something like Kubernetes. This is a work in progress, but I believe it does have support for distributed training as well -- <a href="https://github.com/tensorflow/k8s" rel="nofollow noreferrer">https://github.com/tensorflow/k8s</a>.</p> <p>Alternatively for more low-tech automation options...
<h1>Question</h1> <p>It is not clear how to access the dashboard with HTTPS and cannot find a clear documentation (it just tells to use kubectl proxy). So what is the way to access the dashboard with HTTPS?</p> <p><a href="https://github.com/kubernetes/dashboard" rel="noreferrer">Kubernetes Dashboard GitHub</a> tells...
<p>As far as I know, You would not want to expose your k8s dashboard to external world Since It's a graphical way to get access to your k8s cluster that's why the service type of k8s-dashboard is clusterIP instead of LoadBalancer or NodePort( Minikube uses it).</p> <p>Now If you want to access the dashboard without ex...
<p>We have a web application of flask framework written in python. The application code is dockerized and deployed in kubernetes.</p> <p>The application writes to a file in static directory once a user hits an API. I am unable to do so. I know that as when I check the list of files in the static location using another...
<p>You have 32 replicas in your definition. The API call which makes the app to write the file locally hits one pod (replica), and the call that checks for its existence hits a different one. It is expected that the file is not there.</p> <p>If you scale the number of replicas to 1, it will work. You can try for testi...
<p>I'm just getting started with kubernetes and setting up a cluster on AWS using kops. In many of the examples I read (and try), there will be commands like:</p> <pre><code>kubectl run my-app --image=mycompany/myapp:latest --replicas=1 --port=8080 kubectl expose deployment my=app --port=80 --type=LoadBalancer </cod...
<p>The fundamental question is how to apply all of the K8s objects into the k8s cluster. There are several ways to do this job. </p> <ul> <li>Using Generators (Run, Expose)</li> <li>Using Imperative way (Create)</li> <li>Using Declarative way (Apply)</li> </ul> <p>All of the above ways have a different purpose and si...
<p>Is it possible to create a pod that will run a container after the main container terminates? I am imagining something similar to an init container, except that runs at the end rather than at the beginning. (I would use this to look for various metadata files created by the main process and send them to our data war...
<p>No, there is not AFAIK. You would have to use pods hooks for that. You can read about pod hooks <a href="https://blog.openshift.com/kubernetes-pods-life/" rel="noreferrer">on this post</a></p> <p><a href="https://i.stack.imgur.com/aMj6Z.png" rel="noreferrer"><img src="https://i.stack.imgur.com/aMj6Z.png" alt="enter...
<p>I am using OS Ubuntu 16.0.4 and i installed minikube on it. I need to copy some files to minikube, so how can i do that? I tried next command but it asked me on password and i don't know it</p> <pre><code>scp /media/myuser/sourceFolder docker@192.168.99.100:/home/docker/destiationFolder </code></pre> <p><strong>No...
<p>On the host machine you can use the <code>ssh-key</code> and <code>ip</code> subcommands of the <code>minikube</code> command:</p> <pre><code>scp -i $(minikube ssh-key) &lt;local-path&gt; docker@$(minikube ip):&lt;remote-path&gt; </code></pre> <p>So the command from the question becomes:</p> <pre><code>scp -i $(m...
<p>I'm new to Kubernetes and I'm trying to understand some security stuff.</p> <p>My question is about the Group ID (= gid) of the user running the container.</p> <p>I create a Pod using this official example: <a href="https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context...
<p>Unfortunately, setting the primary group ID is currently not supported in Kubernetes, and will default to <code>gid=0</code>.</p> <p>There is an open issue for implementing this: <a href="https://github.com/kubernetes/features/issues/213" rel="noreferrer">https://github.com/kubernetes/features/issues/213</a></p>
<p>I am using kubernetes Replication controller for my application to run in GCP, the application is a dockerized image.</p> <p>I want to configure the Pod creating while replication creation, I am using a cluster of 64cores. </p> <p>Can someone explain what exactly the meaning of the resource portion of the yaml</p>...
<p>The <code>resource</code> block allows you to specify requests and limits for compute resources such as CPU and memory. </p> <p>Requests are considered by the scheduler when it needs to select a node to run the pod. Limits, on the other hand, are a runtime concern that are applied to the workload through the contai...
<p>I have a template that is basically an utility container for running kubectl inside a pod.</p> <p>What I want to do, is to be able to have multiple deployments of that same template, with different names, as in "utilitypod-randomID".</p> <p>Is there a way to do that, via kubectl and some shell scripting, or someth...
<p>You can replace <code>name</code> with <code>generateName</code>, which adds a random suffix. Your template will look like this:</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: v1 kind: Pod metadata: generateName: utilitypod- namespace: blah-dev labels: purpose: utility-pod spec: contai...
<h1>Question</h1> <p>There is a way to create a service account and get token as in <a href="https://stackoverflow.com/questions/42170380/how-to-add-users-to-kubernetes-kubectl">How to Add Users to Kubernetes (kubectl)?</a> but is there a way to get or create a token for a normal user?</p> <h1>Background</h1> <p>Fol...
<p><a href="https://kubernetes.io/docs/admin/authentication/#service-account-tokens" rel="noreferrer">API requests are tied to either a normal user or a service account, or are treated as anonymous requests</a>.</p> <ul> <li>Normal users are assumed to be managed by an outside, independent service (private keys, third...
<h1>Question</h1> <p>It is not clear how to access the dashboard with HTTPS and cannot find a clear documentation (it just tells to use kubectl proxy). So what is the way to access the dashboard with HTTPS?</p> <p><a href="https://github.com/kubernetes/dashboard" rel="noreferrer">Kubernetes Dashboard GitHub</a> tells...
<p>As no time to test the suggestion by Suresh, used below for now.</p> <p>Get the kubernetes-dashboard service account token (given cluster-admin role).</p> <pre><code>$ kubectl get secret -n kube-system | grep kubernetes-dashboard kubernetes-dashboard-token-42b78 kubernetes.io/service-account-token ...
<p>I have created a deployment which create a replica-set and this replica-set create pods. Now I found couple of time the pod is getting deleted (do not know why) and then the replica-set create a new pod.</p> <p>I am unable to find the details for the previous pod. I need to know why the pod was deleted. Kubernetes...
<p>You can use <code>kubectl describe pod ...</code> to see more information</p> <p>EDIT:</p> <p>Correction, I didn't realize you were deleting things yourself, if you manually delete the pod I don't think you can get that information back. If a pod has existed and then someone deletes it the only way that happens is...
<p>I have a Kubernetes deployment on GCE, which I'd like to get automatically updated based on new images being created in Google Container Registry (ideally via a Build Trigger). Is there a way to do that?</p> <p>Thanks in advance.</p> <p>-Mark</p>
<p>I was able to do this using GCR and Cloud Builder with a <code>cloudbuild.yaml</code> file like the below. For it to work, the service account with a name like <code>xyz@cloudbuild.gserviceaccount.com</code> had to have the IAM permissions assigned by clicking Project -> Editor. This is required so that the Cloud ...
<p>I'm running Elasticsearch within Kubernetes and despite setting container limits on CPU use, Elasticsearch is able to exceed the limits and starve other containers.</p> <p>For various reasons, I'm running the containers with:</p> <blockquote> <p>privileged: true</p> </blockquote> <p>Would this allow Elasticsear...
<p>As you can see in <a href="https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities" rel="nofollow noreferrer">https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities</a> the container in a privileged mode has no reason not to respect the limits it is give...
<p>I am playing with <code>Docker</code>, <code>Kubernetes</code>, <code>Google Cloud Platform(GCP)</code> and <code>Gitlab</code> recently to achieve <code>CI/CD</code> from <code>commit</code> to <code>staging</code>. So far I have succeeded <code>testing</code>, <code>building</code> and <code>pushing</code> the im...
<p>A simple <code>gitlab-ci.yml</code> file to build and deploy in GKE with <code>Google Container Registry(GCR)</code>. First, we build image and push it to GCR. With valid credentials, we can easily connect the GKE with GCR and deploy. </p> <pre><code>stages: - build - deploy variables: CONTAINER_TEST_IMAGE:...
<h3>TL;DR:</h3> <p>Kubernetes pods created via terraform don't have a <code>/var/run/secrets</code> folder, but a pod created according to the <code>hello-minikube</code> tutorial does - <em>why is that, and how can I fix it</em>?</p> <p>Motivation: I need traefik to be able to talk to the k8s cluster.</p> <h3>Detai...
<p>Foremost, thank you for an <strong>amazing</strong> question write up; I would use this question as a template for how others should ask!</p> <p>Can you check the <code>automountServiceAccountToken</code> field in the <code>PodSpec</code> and see if it is <code>true</code>?</p> <p>The only other constructive quest...
<p>Been working on a web app with a simple database model that only needs CRUD operations, figured MongoDB would be perfect for it. The most important constraints of the project is that it be able to scale from a small amount of users to a large amount. I’ve been looking at the cloud launcher and I’ve noticed that the ...
<p>I haven't used mongodb with kubernetes but we do use the cloud launcher solution at work. We use 2 nodes(n1-standard-1) and an arbiter(micro) + 100GB storage on each node which comes up around $100 a month. You would need a replicaset in a production environment so this seems to be a reasonable base cost.</p> <p>Ku...
<p>Been working on a web app with a simple database model that only needs CRUD operations, figured MongoDB would be perfect for it. The most important constraints of the project is that it be able to scale from a small amount of users to a large amount. I’ve been looking at the cloud launcher and I’ve noticed that the ...
<p>I have lately been working on a similar solution.</p> <p>GCP announced that they don't charge for Kubernetes cluster management but only for resources used by it (instances, network ...): <a href="https://cloud.google.com/kubernetes-engine/pricing" rel="nofollow noreferrer">https://cloud.google.com/kubernetes-engin...
<p>This is a bit of a beginner's question. I'm attempting to get a simple Hello World Python flask application deployed in a kubernetes cluster on IBM Cloud. The application (<code>main.py</code>):</p> <pre><code>import os from flask import Flask app = Flask(__name__) @app.route('/') def welcomeToMyapp(): return...
<p>The IP address that you need is the external IP address of a worker node in your cluster. The IP address that you have identified is an internal address.</p> <p>To get an external IP address, run <code>bx cs workers &lt;cluster_name&gt;</code></p> <p>Then form the URL as follows: <code>http://&lt;external_node_ip&...
<p>I am attempting to deploy a Neo4j <a href="https://neo4j.com/docs/operations-manual/3.3/clustering/causal-clustering/" rel="nofollow noreferrer">causal cluster</a> in Kubernetes. I've followed <a href="https://github.com/neo4j-contrib/kubernetes-neo4j" rel="nofollow noreferrer">this guide</a> on Github, and deployed...
<p>You can have multiple <code>Service</code>s for the same deployment in Kubernetes.</p> <ul> <li>have a <code>ClusterIP</code> Service, so nodes can continue to communicate with each oter.</li> <li>have a <code>LoadBalancer</code> Service, so you can expose the public port to the Internet.</li> </ul> <p>If you’re l...
<p>I created a deployment in Kubernetes 1.9 running on GKE that makes use of secrets put into environment variables. I uploaded the secrets into GKE using a yaml file with the secrets base64 encoded. </p> <p>What I'm seeing in my container is that the environment variable is there, but the value includes trailing whit...
<p>Your echo is adding the newline. Add -n to omit a trailing newline </p>
<p>I'm trying to setup Jenkins to run in a container on Kubernetes, but I'm having trouble persisting the volume for the Jenkins home directory.</p> <p>Here's my deployment.yml file. The image is based off <code>jenkins/jenkins</code></p> <pre><code>apiVersion: extensions/v1beta1 kind: Deployment metadata: name: j...
<p>You should use <strong>PersistentVolumes</strong> along with <strong>StatefulSet</strong> instead of <strong>Deployment</strong> resource if you wish your data to survive re-deployments|restarts of your pod.</p>
<p>I have created a deployment which create a replica-set and this replica-set create pods. Now I found couple of time the pod is getting deleted (do not know why) and then the replica-set create a new pod.</p> <p>I am unable to find the details for the previous pod. I need to know why the pod was deleted. Kubernetes...
<p>Describe pod is the way to go. I see this kind of thing everyday. Everytime I launch a new deployment I list the pods with <code>kubectl get pods</code>, then once I see the container creating message for the new pod I want to monitorize, I grab the id and then run <code>kubectl describe pod [ID]</code>. Even if the...
<p>CockroachDB has a relatively simple clustering mechanism, you initialize the DB with a command line option pointing at the host name of the other cockroach machines (but, this question is relevant really for any peer to peer clustered db).</p> <p>One of the benefits of Cockroach is you can cluster across regions wi...
<p>This is a good question that I've been meaning to play around with soon. You've been checking into a reasonable set of ideas. The core problem, as you allude to, is that every cockroach process needs to be able to individually address every other cockroach process.</p> <p>I don't know how well cluster federation ha...
<p>Sorry for the dumb question I'm new to cloud computing.</p> <p>I'm trying to do <a href="https://medium.com/google-cloud/how-to-create-google-container-engine-gke-using-the-google-cloud-platform-console-925dd1cc9400" rel="nofollow noreferrer">this</a> tutorial and I've listened to <a href="https://youtu.be/g0dN8Hkh...
<p>Google Container Engine is <strong>renamed</strong> as Google Kubernetes Engine. It’s the same product. </p> <p><a href="https://cloudplatform.googleblog.com/2017/11/introducing-Certified-Kubernetes-and-Google-Kubernetes-Engine.html" rel="noreferrer">https://cloudplatform.googleblog.com/2017/11/introducing-Certifie...
<p>I can't mount GCE PersistentVolumes using Kubernetes 1.8.0, each POD are stuck in ContainerCreating state.</p> <p>This output is from a test environment I put up for this lab. Worth to mention is that I'm using Compute Engine, NOT Kubernetes Engine.</p> <p>I have not configured any cloud settings and I wounder if ...
<p>You need to add the cloud-provider flag to the apiserver, kubelet and controller-manager.</p> <p>You also then need to configure a storageclass for the GCE</p>
<p>Pod created by job gets killed with Message:</p> <pre><code>Normal DeadlineExceeded Job was active longer than specified deadline </code></pre> <p>This is a pod running training process with Tensorflow. The weird thing is this pod is just created with no thing error in <code>kubectl log</code> output.</p>
<p>As stated in <a href="https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#job-termination-and-cleanup" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#job-termination-and-cleanup</a> you can see that <code>DeadlineExceeded</cod...
<p>I'm having an issue right now when trying to create a PHP (Laravel) pod in my Kubernetes cluster. As php-fpm is a service run by the user www-data, he doesn't have access to the environments variables that Docker or Kubernetes sets up, which is the source of my problem.</p> <p>We have beta and production pods, and ...
<p>You could put the <code>clear_env = no</code> in your php-fpm.conf or a file included from it, <a href="https://github.com/docker-library/php/issues/74#issuecomment-79102385" rel="nofollow noreferrer">as discussed here</a>.</p>
<p>I have a running <code>DaemonSet</code> which is running on all nodes. I want to remove it from a node in order to completely drain it, as <code>kubectl drain</code> doesn't get rid of them. Without deleting my <code>DaemonSet</code>, what's a good way to temporarily remove those pods from the node? I've tried drain...
<p>You need to use <code>--ignore-daemonsets</code> key when you drain kubernetes node:</p> <blockquote> <p>--ignore-daemonsets=false: Ignore DaemonSet-managed pods.</p> </blockquote> <p>So, in order to drain kubernetes node with <code>DaemonSets</code> in cluster, you need to execute:</p> <pre><code>kubectl drain...
<p>How to delete all the contents from a kubernetes node?<br/> Contents include deployments, replica sets etc. I tried to delete deplyoments seperately. But kubernetes recreates all the pods again.<br/> Is there there any ways to delete all the replica sets present in a node? </p>
<p>If you are testing things, the easiest way would be</p> <pre><code>kubectl delete deployment --all </code></pre> <p>Althougth if you are using minikube, the easiest would probably be delete the machine and start again with a fresh node</p> <pre><code>minikube delete minikube start </code></pre> <p>If we are talk...
<p>I'm following <a href="https://www.katacoda.com/courses/kubernetes/liveness-readiness-healthchecks" rel="nofollow noreferrer">https://www.katacoda.com/courses/kubernetes/liveness-readiness-healthchecks</a></p> <p>I saw an interesting command to parse json object use flag <code>-o=jsonpath</code> in kubectl as below...
<p>I'm happy that I found a good solution explained in details here: <a href="https://gist.github.com/so0k/42313dbb3b547a0f51a547bb968696ba" rel="nofollow noreferrer">https://gist.github.com/so0k/42313dbb3b547a0f51a547bb968696ba</a></p> <p>Basically you have to install jq or jiq, then type <code>kubectl get no -o json...
<p>My backend, in Rocket (Rust), does not have compression built in. So, it is dependent on the proxy to compress it. Though nginx ingress controller supports it, I thought whether the default one had it too as it has high availability.</p> <p>If it does not have, then how should I setup?</p>
<p><strong>UPDATE(2018-01-31):</strong> It looks like Cloud HTTP(S) Load Balancer <strong>supports</strong> GZIP. You just have to serve compressed content from your backend and the load balancer will pass it on.</p> <p>However, NGINX is confused because of the <code>Via</code> header (it thinks proxies don't support...
<p>I setup my Kubernetes cluster using kops, and I did so from local machine. So my <code>.kube</code> directory is stored on my local machine, but I setup <code>kops</code> for state storage in <code>s3</code>.</p> <p>I'm in the process of setting up my CI server now, and I want to run my <code>kubectl</code> command...
<p>To run <code>kubectl</code> command, you will need the cluster's apiServer URL and related credentials for authentication. Those data are by convention stored in <code>~/.kube/config</code> file. You may also view it via <code>kubectl config view</code> command.</p> <p>In order to run <code>kubectl</code> on your C...
<p>I can't get a rolebinding right in order to get node status from an app which runs in a pod on GKE.</p> <p>I am able to create a pod from there but not get node status. Here is the role I am creating:</p> <pre><code>kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: name: node-reader rules: - api...
<p>Subresource permissions are represented as <code>&lt;resource&gt;/&lt;subresource&gt;</code>, so in the role, you would specify <code>resources: ["nodes","nodes/status"]</code></p>
<p>How can I create, deploy and run and manage <a href="https://en.wikipedia.org/wiki/Cron" rel="nofollow noreferrer">Cron jobs</a> on Hasura?</p>
<p>Hasura suggests two ways to deploy and run Cron jobs.</p> <h3>Cron microservice</h3> <p>Hasura already has a microservice to run Cron jobs. </p> <p>If you already have a Hasura project run:</p> <pre><code>hasura microservice create mycron --template=python-cron </code></pre> <p>Change <code>mycron</code> to wha...
<p><strong>Kubernetes</strong> <strong>Secrets</strong> create files that are mounted as a <strong>volumeMount</strong>.</p> <p>There is possibility to put multiple files in a single Secret.</p> <p>Is there a way to create a Secret that would put files in a <strong>directory structure</strong> (i.e. in a folder) ?</p...
<p>This is actually possible now: You need to use the <code>items</code> field to project the key/value pairs in the secret to specific paths that you want. See the example in the section titled "Projection of secret keys to specific paths" in the secrets documentation, which I've linked and copied below: <a href="http...
<p>I would like how to call a service from any pod inside or outsite the node.</p> <p>I have 3 nodes with deployment and services. I already have a kube-proxy.</p> <p>I exec bash on other pod:</p> <pre><code>kubectl exec --namespace=develop myotherdpod-78c6bfd876-6zvh2 -i -t -- /bin/bash </code></pre> <p>And inside...
<p>It looks to me that something may be incorrect with the Network Overlay you deployed. First of all, I would double check that the pod can access kube-dns and obtain the proper IP of the service.</p> <pre><code>nslookup myservice.develop.svc.cluster.local nslookup myservice # If they are in the same namespace it sho...
<p>I am very new to kubernetes and have just got a stock kubernetes v.1.3.5 cluster up on AWS using kube-up. So far, I have been playing around with kubernetes in understanding it's mechanics (nodes, pods, svc and stuff). Based on my initial (or maybe crude) understanding , I had few questions:</p> <p>1) How does rout...
<p><strong><a href="http://www.markbetz.net/" rel="noreferrer">Mark Betz</a></strong> (<a href="https://twitter.com/markbetz" rel="noreferrer">SRE at Olark</a>) presents Kubernetes networking in three articles:</p> <ul> <li><strong><a href="https://medium.com/google-cloud/understanding-kubernetes-networking-pods-7117d...
<p>I'm using kubectl cp to copy a jar file from my local file system into a the home directory of a POD in my minikube environment. However, the only way I can confirm that the copy succeeded is to issue a new kubectl cp command to copy the file back to a temp directory and compare the checksums. Is there a way to view...
<p>You can execute commands in a container using <code>kubectl exec</code> command.</p> <p><strong>For example</strong>:</p> <p>to check files in any folder:</p> <pre><code>kubectl exec &lt;pod_name&gt; -- ls -la / </code></pre> <p>or to calculate <code>md5sum</code> of any file:</p> <pre><code>kubectl exec &lt;po...
<p>If develop a online real time game with websocket, multiplayers running on the different containers, how to sync data when add or reduce containers if they are playing?</p> <p>Does kubernetes has any good feature on this case?</p>
<p><a href="https://stackoverflow.com/users/5547718/thatbriandude">ThatBrianDude</a> already gave an awesome answer, and mine will not be that good. But I think <a href="https://stackoverflow.com/questions/46952537/how-to-use-kubernetes-to-do-multiplayer-online-game-with-websocket#comment80879143_46952660">your last co...
<p>I am following <a href="https://github.com/kubernetes-incubator/cri-containerd/blob/master/docs/crictl.md#run-a-pod-sandbox-using-a-config-file" rel="nofollow noreferrer">Run a pod sandbox</a> link to create a sandbox using crictl. I am getting below error</p> <pre><code>root@cri-master:~# crictl runs sandbox-confi...
<p>So I posted same question in the cri-containerd github issue and I got this answer. This explains everything</p> <p><a href="https://github.com/kubernetes-incubator/cri-containerd/issues/520" rel="nofollow noreferrer">Unable to create sandbox</a></p> <blockquote> <p>IIRC, calico daemonset watch apiserver to get a li...
<p>I'm running a Kubernetes cluster, which has worked fine for several months. Now, today, when I was about to deploy some updates, I get timeouts from the server.</p> <p>Running <code>$ kubectl get nodes</code> yields</p> <pre><code>Error from server (Timeout): the server was unable to return a response in the time ...
<p>To avoid the timeouts, you can pass this flag <code>--request-timeout='1s'</code>. This will allow further debugging. </p> <p>I see you are running <code>kube-aws</code>,so it will be safe to terminate the master instances (at least one, if you run multiple masters). The ASG will replace them automatically. You can...
<p>If I am able to SSH into the master or any nodes in the cluster, is it possible for me to get 1) the kubeconfig file or 2) all information necessary to compose my own kubeconfig file?</p>
<p>You could find configuration on master node under /etc/kubernetes/admin.conf (on v1.8+).</p> <p>On some versions of kubernetes, this can be found under ~/.kube</p>
<p>If there an use case where kubectl apply should not be use to get a roll-update? </p> <p>Despite the command original intent if we gave to kubectl apply a source file describing the resources of the cluster been updated over time, there any use case on which should not be use?</p>
<p>The update strategy is specified in <code>.spec.strategy</code> in case of a Deployment and <code>.spec.updateStrategy.type</code> for DaemonSets and StatefulSets</p> <p>For Deployments <code>.spec.strategy.type</code> can be “Recreate” or “RollingUpdate”. “RollingUpdate” is the default value.</p> <p>For DaemonSe...
<p>I have attempted to follow <a href="https://crondev.com/kubernetes-nginx-ingress-controller/" rel="nofollow noreferrer">this</a> tutorial to play around with an nginx ingress controller. Some details have changed as I was trying to get it to work - only one backend service instead of two, some port numbers and every...
<p>10.x adresses are internal. So the 404s are expected. The ingress controller doesn't make your internal services external all of a sudden. The ingress service is supposed to proxy requests to deployed services via a single address. Since I see you deployed the controller via node port, try making a request to the no...
<p>According to documentation of both <a href="https://github.com/kubernetes/kops/blob/master/docs/aws.md" rel="nofollow noreferrer">kops</a> and <a href="https://aws.amazon.com/blogs/compute/kubernetes-clusters-aws-kops/" rel="nofollow noreferrer">aws</a>, the dedicated <code>kops</code> user needs <code>IAMFullAccess...
<p>As far as I understand kops design, it's meant to be end to end tool for provisioning you with k8s clusters. If you want to provision your nodes separately and deploy k8s on them I would suggest to use other tool, such as kubespray or kubeadm: </p> <p><a href="https://github.com/kubernetes-incubator/kubespray" rel=...
<p>I am having two dockerized application which needs to run in kubernetes. </p> <p>Here is the scenario which needs to achieve.</p> <p>Docker-1 which is flask application.</p> <p>Docker-2 which is python script will take input from the Docker-1 and execute and need to write some file in a shared volume of the Docke...
<p>First, create a Pod running "Docker-1" application. Then <a href="https://github.com/kubernetes-incubator/client-python" rel="nofollow noreferrer">Kubernetes python client</a> to spawn a second pod with "Docker-2". You can share a volume between your pods in order to return the data to Docker1. In my code sample I'm...
<p>I have deployed a Kubernetes cluster to a custom virtual network on Azure using acs-engine. There is an ASP.NET Core 2.0 Kestrel app running on the agent VMs and the app is accessed over VPN through a Service of the Azure internal load balancer type. Now I would like to enable HTTPS on the service. I have already ob...
<p>While for some reason I still can't access the app through the ingress I was able to create an internal ingress service with the IP I want with the following configuration:</p> <pre><code>apiVersion: v1 kind: Service metadata: annotations: service.beta.kubernetes.io/azure-load-balancer-internal: "true" na...
<p>I my 1.9 cluster created this deployment role for the dev user. Deployment works as expected. Now I want to give exec and logs access to developer. What role I need to add for exec to the pod?</p> <pre><code>kind: Role name: deployment-manager rules: - apiGroups: ["", "extensions", "apps"] resources: ["depl...
<p>The <a href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/#referring-to-resources" rel="nofollow noreferrer">RBAC docs say that</a></p> <blockquote> <p>Most resources are represented by a string representation of their name, such as “pods”, just as it appears in the URL for the relevant API endpoint....
<p>Running a cluster on Google Container engine. </p> <p>Expect it to respect rewrite rule. Running the debug <a href="http://gcr.io/google_containers/echoserver:1.4" rel="noreferrer">echo server</a> it shows it's not respecting the http-rewrite rule as documented here in <a href="https://github.com/kubernetes/ingress...
<p>You could use an Nginx ingress controller as explained in this blog:</p> <p><a href="http://rahmonov.me/posts/nginx-ingress-controller/" rel="nofollow noreferrer">http://rahmonov.me/posts/nginx-ingress-controller/</a></p> <p>Once you follow those steps, you need to add the following annotation to your ingress yaml...
<p>I'm trying to host a Jenkins image on GKE to run a build. Mostly, I've followed <a href="https://cloud.google.com/solutions/jenkins-on-kubernetes-engine-tutorial" rel="noreferrer">Google's tutorial for setting up Jenkins in Kubernetes</a>. I've got a fairly basic set-up with one master node which runs the builds.</p...
<p>You might want to try running it as the <code>1000</code> user:</p> <pre><code>... spec: ... securityContext: # Specify fsGroup for pod, so that the persistent volume is writable for the non-privileged uid/gid 1000 runAsUser: 1000 fsGroup: 1000 ... </code></pre> <p>You may also find <a href="http...
<p><em>As far as I'm concerned, this is more of a development question than a server question, but it lies very much on the boundary of the two, so feel free to migrate to serverfault.com if that's the consensus).</em></p> <p>I have a service, let's call it <code>web</code>, and it is declared in a <code>docker-compos...
<p>The default kubernetes local domain is</p> <pre><code>default.svc.cluster.local </code></pre> <p>which means that the fully qualified name of the <code>web</code> service under kubernetes is <code>web.default.svc.cluster.local</code></p> <p>So, in the <code>docker-compose</code> file, under the trafficserver conf...
<p>Is there a way to obtain log information about what is happening with Kubernetes after creating a pod. The <code>kubectl get pods</code> only provides a basic status message. In the case of downloading a large image this can take time and the <code>kubectl log</code> command does not provide any real information at...
<p>To add to previous answer, if your using a modern worker with systemd you will probably not have a <code>/var/log/docker.log</code> file at all.</p> <p>You can see if downloads are active (on ubuntu/conjure-up) by:</p> <ul> <li>running bandwidth monitoring tools like <code>bmon</code> on the worker (or its hypervi...
<p>I'm a bit confused by some of the Kubernetes documentation on virtual IPs: <a href="https://kubernetes.io/docs/concepts/services-networking/service/#the-gory-details-of-virtual-ips" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/service/#the-gory-details-of-virtual-ips</a>.</p> <b...
<p>The virtual in VIP means that the IP is not attached to a network interface, technical (in the current default config with <code>kube-proxy</code>) this means it's an IPtables entry, purely used to provide a stable communication endpoint. I've written about it in greater detail in the blog post <a href="https://blog...
<p>I'm new to DevOps specifically using golang and microservice architecture.</p> <p>I'm wondering if go applications should or should not be deployed in containers (Docker). In this case, I have a system built with micro-service architecture. For example here, I have 2 web services, A and B. Also, I have another web s...
<blockquote> <p>I'm wondering if go applications should or should not be deployed in containers (Docker)<br> Why should I deploy and run those binaries inside containers like Docker?</p> </blockquote> <p>Of course, provided you separate the build from the actual final image (in order to not include in said final i...
<p>what is the meaning for "<strong>status:</strong>" in the kubernetes manifest file</p> <pre><code>spec: type: LoadBalancer ports: - name: "7000" port: 7000 targetPort: 80 selector: io.kompose.service: ams-app status: loadBalancer: {} </code></pre>
<p>See "<a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/#object-spec-and-status" rel="nofollow noreferrer">Object Spec and Status</a>"</p> <blockquote> <p>Every Kubernetes object includes two nested object fields that govern the object’s configuration: the object spec an...
<p>I tested kubernetes deployment with EBS volume mounting on AWS cluster provisioned by kops. This is deployment yml file:</p> <pre><code>apiVersion: extensions/v1beta1 kind: Deployment metadata: name: helloworld-deployment-volume spec: replicas: 1 template: metadata: labels: app: helloworld ...
<p>I found a solution. It's described <a href="https://stackoverflow.com/questions/47278433/need-help-on-volume-mount-issue-with-kubernetes">here</a>.</p> <p>In kops 1.8.0-beta.1, master node requires you to tag the AWS volume with:</p> <p><code>KubernetesCluster</code>: <code>&lt;clustername-here&gt;</code></p> <p>...
<p>I have a Kafka cluster in <a href="https://kubernetes.io/" rel="nofollow noreferrer">kubernetes</a> with a lot of test data. I want to have some/all of that test data imported into my local Kafka cluster. This, way it would be easier for me to perform tests in the local environment with actual data from kubernetes.<...
<ol> <li><p><a href="https://docs.confluent.io/current/connect/connect-replicator/docs/index.html" rel="nofollow noreferrer">Replicator</a> is a commercial tool that enables you to replicate topics from one cluster to another. Similar to MirrorMaker though, it's designed to replicate <em>entire</em> topics, not just pa...
<p>I created a Kubernetes cluster using AKS service.</p> <p>When I execute <code>kubectl get nodes</code>, I expect to see the Master node. However, I don't. I only see the Agent (Role) nodes.</p> <p>Is it possible to look at the Master node? The reason I want to do this is to check if RBAC is enabled in my cluster, an...
<blockquote> <p>Is it possible to look at Master node? The reason I want to do this is to check if RBAC is enabled in my cluster, and if not, enable it.</p> </blockquote> <p>It is <strong>not</strong> possible, Kubernetes master node managed by Azure, because Azure handles these critical maintenance tasks for you,...
<p>I'm using Kubernetes and I recently updated my admin certs used in the <code>kubeconfig</code>. However, after I did that, all the <code>helm</code> commands fail thus:</p> <pre><code>Error: Get https://cluster.mysite.com/api/v1/namespaces/kube-system/pods?labelSelector=app%3Dhelm%2Cname%3Dtiller: x509: certificate...
<p>As a workaround you can try to disable certificate verification. Helm uses the kube config file (by default <code>~/.kube/config</code>). You can add <code>insecure-skip-tls-verify: true</code> for the <code>cluster</code> section:</p> <pre><code>clusters: - cluster: server: https://cluster.mysite.com insec...
<p>In Kubernetes is it possible to add <code>hostPath</code> storage in Statefulset. If so, can someone help me with some example?</p>
<p>Yes but it is definitely for testing purposes.</p> <p>First you need to create as many Persistent Volume as you need</p> <pre><code>kind: PersistentVolume apiVersion: v1 metadata: name: hp-pv-001 labels: type: local spec: storageClassName: manual capacity: storage: 10Gi accessModes: - ReadWri...
<p>Can I use environment variable in lifecycl.postStart.exe.command? I have a script that has to be run in postStart command. The command contains a secret, can I use valueFrom to get the secret to env, and use the env in postStart command?</p>
<p>Yes, it is possible.</p> <p>Using the example from <a href="https://blog.openshift.com/kubernetes-pods-life/" rel="noreferrer">this post to create hooks</a>, let's read a secret and pass it as environment variable to the container, to later read it in the <code>postStart</code> hook.</p> <pre><code>--- apiVersion...
<p>My microservice has multiple containers, each of which needs access to a different port. How do I expose this service on multiple ports using the Hasura CLI and project configuration files?</p> <p>Edit: Adding the microservice's <code>k8s.yaml</code> (as requested by @iamnat) Let's say I have two containers, <code>...
<p>TL;DR: - Add an API gateway route for each HTTP endpoint you want to expose <a href="https://docs.hasura.io/0.15/manual/hasuractl/hasura_conf_generate-route.html" rel="nofollow noreferrer">[docs]</a></p> <hr> <p>Inside the kubernetes cluster, give your k8s spec this is what your setup will look like:</p> <pre><co...
<h2>Issue</h2> <p>The fluentd daemonset manifest in <a href="https://docs.fluentd.org/v0.12/articles/kubernetes-fluentd" rel="noreferrer">Kubernetes Logging with Fluentd</a> will cause an authorization error if RBAC is enabled.</p> <pre><code>$ kubectl logs fluentd-4nzv7 -n kube-system 2018-01-06 11:28:10 +0000 [info...
<p>When you are defining your daemonset you can also define your RBAC.</p> <pre><code>apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRoleBinding metadata: name: fluentd-service-account roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: fluentd-service-account subjects: - kind: Ser...
<p>I have a Kafka cluster in <a href="https://kubernetes.io/" rel="nofollow noreferrer">kubernetes</a> with a lot of test data. I want to have some/all of that test data imported into my local Kafka cluster. This, way it would be easier for me to perform tests in the local environment with actual data from kubernetes.<...
<p>The way we do it (not on Kubernetes but it does not matter in this case) is:</p> <ol> <li>if we need to duplicate some part of data from our production cluster to a local/test cluster - we start a Flume agent that reads from prod Kafka cluster and pushes into test cluster. This only works with either live data (whe...
<p>I have a test cluster in GKE (it runs my non-essential dev services). I am using the following GKE features for the cluster:</p> <ul> <li>preemptible nodes (~4x f1-micro)</li> <li>dedicated ingress node(s)</li> <li>node auto-upgrade</li> <li>node auto-repair</li> <li>auto-scaling node-pools</li> <li>regional cluste...
<p>I was able to solve this issue through a brute force process, creating several test node-pools in GKE running the same workloads (I didn't bother connecting up ingress, DNS, etc), and varying the options supplied to <code>gcloud beta container node-pools create</code>.</p> <p>Since I was paying for these experiment...
<p>I have a strange error with kube-dns.</p> <p>Environment: Cluster with a single master and a few nodes deployed on AWS with kops. Kubernetes version 1.8.4.</p> <p>Problem is that I have flakiness in DNS name resolution (both cluster-internal or external names) in my pods. After troubleshooting I understood the pro...
<p>I found an <a href="https://github.com/kubernetes/kubernetes/issues/21613" rel="noreferrer">issue on github</a> that looks very similar to this one I am having, and the <a href="https://github.com/kubernetes/kubernetes/issues/21613#issuecomment-343190401" rel="noreferrer">solution</a> posted there seems to work.</p>...
<p>I built an app on node.js using Docker and I'm not sure how to scale it on a Kubernetes cluster so that I take the most out of my cluster hardware.</p> <p>From a performance perspective which of the following is better:</p> <p>clusterize my node app and run as many containers as needed</p> <p>or</p> <p>just run ...
<p>The <a href="https://nodejs.org/api/cluster.html" rel="noreferrer">NodeJS cluster</a> mechanism is useful to allow NodeJS to more effectively use greater than a single core, so depending on your code it may benefit you, but it's highly dependent on your code and the various dependencies and how well they work (or no...
<p>I am running Docker for Windows and Minikube (Kubernetes) to serve an Angular application. The angular application is served using <code>ng serve</code> and is working properly on windows. I created the below Dockerfile:</p> <pre><code># Use an official Nodejs runtime as a parent image FROM node:6.10.3 #Create an ...
<p>This is probably more related to <em>angular-cli</em>. <code>ng serve</code> only binds to <code>localhost</code> by default. Therefore your docker container is not listening on it's public IP address.</p> <p>Try to use:</p> <pre><code>ng serve --host 0.0.0.0 </code></pre>
<p>I have issue with kubernetes dashboard installation, appreciate your comments and solutions.</p> <p><strong>ERROR:</strong> unable to decode "<a href="https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard-head.yaml" rel="nofollow noreferrer">https://raw.githubuse...
<p>If you don't have an <a href="https://kubernetes.io/docs/admin/authorization/rbac/" rel="nofollow noreferrer">RBAC enabled cluster</a>, you won't be able to use RBAC objects, such as Role. That's why when trying to create a <code>Role</code> object, it fails saying it doesn't know anything about <code>Role</code> ob...
<p>Let's say I'm using an GCE <code>ingress</code> to handle traffic from outside the cluster and terminate TLS (<code>https://example.com/api/items</code>), from here the request gets routed to one of two <code>services</code> that are only available inside the cluster. So far so good. </p> <p>What if I have to call...
<blockquote> <p>What if I have to call service B from service A, should I go all the way and use the cluster's external IP/domain and use HTTPS (<a href="https://example.com/api/user/1" rel="noreferrer">https://example.com/api/user/1</a>) to call the service or could I use the internal IP of the service and use HTTP ...
<p>I have created a cluster on <code>aws</code> using <code>kops</code>.</p> <p>However I am unable to find the file used as/by the certificate authority for spawning off client certs.</p> <p>Does <code>kops</code> create such a thing by default?</p> <p>If so, what is the recommended process for creating client cert...
<p>I've done it like <a href="https://gist.github.com/amitkgupta/d5ff7dfc691c0e55162f9196b61964d2#creating-users-in-the-developer-sandbox" rel="noreferrer">this</a> in the past:</p> <ol> <li>Download the <code>kops</code>-generated CA certificate and signing key from S3: <ul> <li><code>s3://&lt;BUCKET_NAME&gt;/&lt;...
<p>I'm trying to create an AWS ELB through a kubernetes Service of type LoadBalancer and I can't figure out the combination of annotations needed to achieve the result I need.</p> <p>This is the closest I can get: <a href="https://i.stack.imgur.com/qQV0c.png" rel="nofollow noreferrer">AWS ELB generated when deploying ...
<p>Here's the incantation for terminating TLS at ELB using the AWS cert</p> <pre><code>apiVersion: v1 kind: Service metadata: annotations: service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http service.beta.kubernetes.io/aws-load-balancer-ssl-cert: arn:aws:acm:foo service.beta.kubernetes.io/...
<p>I want to deploy Identity Server 4 on Kubernetes 1.8, and use this as a Federation Gateway between my web application and Azure Active Directory (to begin with). </p> <p>If I call Identity Server from my web application using the local k8s service name, my users are redirected to the wrong Identity Server URL (cont...
<p>I'm using AKS (Azure managed kubernetes) and have a single client asp.net core 2 web app in the same cluster as my IS4 service with no issues. Both webapps are fronted by Nginx with kube-lego for LetsEncrpyt TLS support, and DNS is provided by Azure DNS.</p> <p>I'm not using the PublicOrigin but instead the client ...
<p>After upgrading my cluster in GKE the dashboard will no longer accept certificate authentication. </p> <p>No problem there's a token available in the .kube/config says my colleague</p> <pre><code> user: auth-provider: config: access-token: REDACTED cmd-args: config config-helper --format...
<p>Ok, very annoying and silly answer - you have to make any request using kubectl for the token to be generated and saved into the kubeconfig file.</p>
<p>Can someone explain how the cpu usage is calculated inside pods with multiple containers for use with an Horizontal Pod Autoscaler? Is it the mean value and how is this calculated?</p> <p>For example: If we have 2 containers:</p> <ul> <li>Container1 requests 0.5 cpu and uses 0 cpu</li> <li>Container2 requests 1 cp...
<p>As of kubernetes 1.9 HPA calculates pod cpu utilization as total cpu usage of all containers in pod divided by total request. So in your example the calculated usage would be 133%. I don't think that's specified in docs anywhere, but the relevant code is here: <a href="https://github.com/kubernetes/kubernetes/blob/v...
<p>I am experimenting with a <code>kubernetes</code> cluster on <code>aws</code>.</p> <p>At the end of the day, I want to expose 2 urls:</p> <ul> <li><code>production.somesite.com</code></li> <li><code>staging.somesite.com</code></li> </ul> <p>When exposing <strong>1</strong> url, things (at least in the cloud lands...
<p>Ingress is for sure one possible solution.</p> <p>You need to deploy in your cluster an <code>Ingress controller</code> (for instance <a href="https://github.com/kubernetes/ingress-nginx" rel="nofollow noreferrer">https://github.com/kubernetes/ingress-nginx</a>) than expose it with a <code>Service</code> of type <c...
<p>I'm trying to enable cors with ingress without success using the following annotation:</p> <pre><code> kubernetes.io/ingress.class: "nginx" nginx.ingress.kubernetes.io/enable-cors: "true" </code></pre>
<p>The correct annotation is <code>ingress.kubernetes.io/enable-cors: "true"</code></p>
<p>The official <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#updating-a-deployment" rel="noreferrer">kubernetes guidelines</a>, instructs on updating the deployment either by performing a command line <code>set</code>:</p> <pre><code>kubectl set image deployment/nginx-deployment nginx=...
<p>You can do it simply by following steps - </p> <ol> <li>Edit the deployment.yaml file </li> <li><p>Run below command - </p> <pre><code>kubectl apply -f deployment.yaml </code></pre></li> </ol> <p>This is what I usually follow. You can use a kubectl patch or edit also. </p>
<p>I'm using <a href="http://zero-to-jupyterhub.readthedocs.io/en/latest/=" rel="nofollow noreferrer">Jupyterhub + Kubernetes</a> to provide a hosted development environment for a large programming class (>100 students). It's running on top of GKE with autoscaling enabled. As additional students log in, more nodes are ...
<p>The solution you're looking for is simply increasing your quotas in console for your GCP project (IAM &amp; admin -> Quotas). It's just a few clicks and usually takes only a few minutes for them to get approved. </p> <p>Right now it's not possible to create GKE nodes without public IPs. Even if it were, it wouldn't...
<p>I am new to all things Kubernetes so still have much to learn.</p> <p>Have created a two node Kubernetes cluster and both nodes (master and worker) are ready to do work which is good:</p> <pre><code>[monkey@k8s-dp1 nginx-test]# kubectl get nodes NAME STATUS ROLES AGE VERSION k8s-dp1 Ready m...
<p>Use <code>kubectl describe pod &lt;name&gt;</code> to see more info</p>
<p>If I have a service that is running on a cluster, can I deploy and add some new pods to the service dynamically?</p> <p>For instance, if the service has the label "app=MyApp", can the new created pods with the same label "app=MyApp" be managed by the service?</p>
<p>Short answer - yes. And this is exactly what a kubernetes <a href="https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/" rel="nofollow noreferrer">replicaSet</a> enables, and these days you're most often encouraged to create one of those through a <a href="https://kubernetes.io/docs/concepts/workloa...
<p>I am trying to connect to a pod running inside a GKE cluster - I can ssh into the nodes within the cluster, but when I try the following command to get into a bash within a pod, I get an error:</p> <pre><code>kubectl --namespace=prod exec -it test-webserver-3998817321-728hj -- /bin/bash </code></pre> <p>-> Error ...
<p>I got exactly the same error message and for me also, it sometimes works and sometimes not.</p> <p>In my case, this was caused by mis configuration of firewall. I restricted most of the outgoing traffic with egress except 443 port. I add a rule which allow outgoing traffic from k8s node to internal IPs(IPs in the ...
<p>I have set up the nginx ingress controller following <a href="https://github.com/kubernetes/ingress-nginx/blob/master/deploy/README.md" rel="noreferrer">this guide</a>.</p> <p>The ingress works well and I am able to visit the <code>defaultbackend</code> service and my own service as well.</p> <p>But when reviewing...
<p>Your assumption is correct. The healthy node is indeed the one running the nginx pod. </p> <p>The guide you're using configures the service with <code>externalTrafficPolicy: Local</code>.(<a href="https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/provider/gce-gke/service.yaml" rel="noreferrer...
<p>I'm very new to Kubernetes. We are using Kubernetes cluster on Google Cloud Platform.</p> <p>I have created Cluster, Services, Pod, Replica controllers.</p> <p>I have created Horizontal Pod Autoscaler and it is based on CPU Params.</p> <h2>Cluster details</h2> <p>Default running node count is set to 3</p> <p>3G...
<p>I don't know how much traffic is hitting your cluster, but I would highly recommend running <a href="https://prometheus.io/docs/introduction/overview/" rel="nofollow noreferrer">Prometheus</a> in your cluster.</p> <p>Prometheus is an open-source monitoring and alerting tool, and integrates very well with Kubernetes...
<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>As I understand, Namespace is a virtual cluster in k8s cluster, therefore it provides isolation and separation of concern. It does not conflict If you have same services or pods in different namespaces. </p> <p>All service are assigned a DNS Record which is unique therefore there is no conflict. for instance, </p> ...