prompt
stringlengths
65
38.7k
response
stringlengths
41
29.1k
<p>I have a cronjob that runs every 10 minutes. So every 10 minutes, a new pod is created. After a day, I have a lot of completed pods (not jobs, just one cronjob exists). Is there way to automatically get rid of them?</p>
<p>That's a work for labels.</p> <p>Use them on your <code>CronJob</code> and delete completed pods using a <code>selector</code> (<code>-l</code> flag).</p> <p>For example:</p> <pre><code>apiVersion: batch/v1beta1 kind: CronJob metadata: name: my-cron spec: schedule: "*/1 * * * *" jobTemplate: spec: ...
<p>I'm new to Kubernetes and Rancher, but have a cluster setup and a workload deployed. I'm looking at setting up an ingress, but am confused by what my DNS should look like.</p> <p>I'll keep it simple: I have a domain (example.com) and I want to be able to configure the DNS so that it's routed through to the correct ...
<p>You aren't dumb, man. This stuff gets complicated. Are you using AWS or GKE? Most methods of deploying kubernetes will deploy an internal DNS resolver by default for intra-cluster communication. These URLs are only useful inside the cluster. They take the form of <code>&lt;service-name&gt;.&lt;namespace&gt;.svc.clus...
<p>I'm using k8s 1.11.2 to build my service, the YAML file looks like this:</p> <p><strong>Deployment</strong></p> <pre><code>apiVersion: apps/v1beta2 kind: Deployment metadata: name: nginx-test namespace: default labels: - type: test spec: replicas: 1 selector: matchLabels: - type: test templ...
<p><a href="http://www.yamllint.com/" rel="noreferrer">yamllint.com</a> is a dubious service because it does not tell us which YAML version it is checking against and which implementation it is using. Avoid it.</p> <p>More importantly, while your input may be valid YAML, this does not mean that it is a valid input for...
<p>I followed <a href="https://cloud.google.com/container-registry/docs/pushing-and-pulling" rel="nofollow noreferrer">this guide</a> to push a docker image to my Google Cloud Container Registry. However </p> <pre><code>docker push eu.grc.io/&lt;project-id&gt;/&lt;image&gt;:&lt;tag&gt; </code></pre> <p>only returns</...
<p>Typo in your "eu.grc.io". It is "eu.gcr.io"</p>
<p>I got app that logs to file my_log/1.log, and then I use filebeat to collect the logs from the file</p> <p>Now I use k8s to deploy it into some nodes, and use hostpath type Volumes to mounts my_log file to the local file syetem, /home/my_log, suddenly I found a subtle situation:</p> <p>what will it happened if mor...
<blockquote> <p>how kubernetes deal with file write locker accross multi pods when hostpath Volumes concerned</p> </blockquote> <p>It doesn't.</p> <p>Operating System and File System are handling that. As an example let's take <code>syslog</code>. It handles it by opening a socket, setting the socket to server mode...
<p>I'm trying to access .NET Web API which I docker-ized and mounted in an Kubernet Cluster on Microsoft Azure.</p> <p>The application works fine on local docker machine. The cluster is running, my deployment was correct and the pods where created. Everything I check is fine, but I cannot access my application through...
<p>You can use the command <code>kubectl get service</code> to get all the information of services and check your service <code>ohmioapi</code>, the result will like this:</p> <p><a href="https://i.stack.imgur.com/C4gC1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/C4gC1.png" alt="enter image desc...
<p>I've a huge pipeline with different developer groups with several permission levels.(<strong>For using Jenkins Kubernetes Plugin .</strong>) </p> <p>For example <strong>QA</strong> teams and <strong>Developer</strong> teams has different service accounts at kubernetes cluster. </p> <p>So I need create some connect...
<p>If you want one jenkins to talk to kubernetes API with different service accounts you need to create multiple Jenkins "clouds" in configuration, each with different credentials. Then in your pipeline you set the "cloud" option to choose the right one</p>
<p>After some readings, it seems there is no sustainable solution for <strong>auto-scaling</strong> Redis on Kubernetes without adding a controller like <a href="https://github.com/adenda/maestro/wiki/Kubernetes-Redis-controller-for-autoscaling-a-Redis-cluster" rel="nofollow noreferrer">Maestro</a>. Unfortunatly the pr...
<p>If you want to autoscale anything on Kubernetes, it requires some type of controller. For general autoscaling, the community is rallying around the <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/" rel="nofollow noreferrer">Horizontal Pod Autoscaler</a>. By default, you configure i...
<p>I'm running my workloads on AWS EKS service in the cloud. I can see that there is not default Ingress Controller available (as it is available for GKE) we have to pick a 3rd party-one.</p> <p>I decided to go with <a href="https://docs.traefik.io/user-guide/kubernetes/" rel="nofollow noreferrer">Traefik</a>. After f...
<p>Have you tried with annotations like in this example?</p> <pre><code>apiVersion: v1 kind: Service metadata: name: traefik-proxy annotations: service.beta.kubernetes.io/aws-load-balancer-ssl-cert: "arn:aws:acm:REGION:ACCOUNTID:certificate/CERT-ID" service.beta.kubernetes.io/aws-load-balancer-backend-prot...
<p>I have the following pods <code>hello-abc</code> and <code>hello-def</code>.</p> <p>And I want to send data from <code>hello-abc</code> to <code>hello-def</code>.</p> <p>How would pod <code>hello-abc</code> know the IP address of <code>hello-def</code>?</p> <p>And I want to do this programmatically.</p> <p>What'...
<p><strong>Preface</strong></p> <p>Since you have defined a service that routes to each deployment, if you have deployed both services and deployments into the same namespace, you can in many modern kubernetes clusters take advantage of kube-dns and simply refer to the service by name. </p> <p>Unfortunately if <code>...
<p>Is it possible to directly modify the file mounted by <code>configMap</code>? We have an application that reads a configuration file that was <code>configMap</code> type and the application should able to edit the file and the changes should be persisted if the <code>configMap</code> is shared with other pods and wh...
<p>Yes a configmap is <a href="https://github.com/kubernetes/kubernetes/issues/62099" rel="noreferrer">not intended to be writeable</a>. If you're interacting with files from a configmap then you could instead put the files in a writeable volume and <a href="https://stackoverflow.com/questions/45681206/what-would-be-an...
<p>I have deployed a k8s cluster using "kubeadm init" successfully before. I re-install the k8s when meet a problem. Now I re-deploy the k8s cluster failed!</p> <p>linux os</p> <pre><code>uname -a Linux kube-master 4.15.0-33-generic #36-Ubuntu SMP Wed Aug 15 16:00:05 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux </code></p...
<p>After <code>kubeadm init</code> you should copy <em>admin.conf</em> file into the home directory of the user who will use the <code>kubectl</code> command and set the config path into the <code>KUBECONFIG</code> system variable:</p> <pre><code>sudo cp /etc/kubernetes/admin.conf $HOME/ sudo chown $(id -u):$(id -g) $...
<p>I am learning Kubernetes with Docker to launch a simple Python web application. I am new to all the above technologies. </p> <p>Below is the approach I was planning on:</p> <ol> <li>Install Kubernetes.</li> <li>Have a cluster up and running locally.</li> <li>Install Docker.</li> <li>Create Python Application</li> ...
<p>The blog you refer illustrates how to configure the CLI (Command Line Interface) on your Win10 computer, so that you can connect to a Kubernetes cluster.</p> <p>The cluster is running on others machines. In the following picture you see a simplified schema.</p> <p><a href="https://i.stack.imgur.com/hOw0v.png" rel=...
<p>I am trying to deploy a kubeless function using serverless. I created a kubernetes cluster using minikube and I am trying to follow this <a href="https://medium.com/bitnami-perspectives/deploying-a-kubeless-function-using-serverless-templates-2d03f49b70e2" rel="nofollow noreferrer">link</a> following which </p> <ol...
<p>I found the issue. I had to deploy kubeless to the Kubernetes cluster I had to do this for that:</p> <pre><code>$ export RELEASE=$(curl -s https://api.github.com/repos/kubeless/kubeless/releases/latest | grep tag_name | cut -d '"' -f 4) $ kubectl create ns kubeless $ kubectl create -f https://github.com/kubeless/ku...
<p>I have a strange issue where I am trying to apply a PodAntiAffinity to make sure that no 2 pods of the specific deploymentConfig ever end up on the same node:</p> <p>I attempt to edit the dc with:</p> <pre><code>spec: replicas: 1 selector: app: server-config deploymentconfig: server-config strategy: ...
<p>This seems to work, the syntax is wildly different and the "scheduler.alpha.kubernetes.io/affinity" annotation needs to be added to work:</p> <pre><code>spec: replicas: 1 selector: app: server-config deploymentconfig: server-config strategy: activeDeadlineSeconds: 21600 resources: {} rolli...
<p>In a container running with host networking option it is possible to use a host network interface and its IP from the container and contact external network <em>from</em> this interface and IP. So if a host has several IPs configured, the container can choose which one it uses.</p> <p>Can I have a similar setup wit...
<p>As I wrote in <a href="https://stackoverflow.com/questions/51943950/egress-ip-adress-selection/51944171">Egress IP adress selection</a> :</p> <blockquote> <p>One of the things that could help you solve it is Istio Egress Gateway so I suggest you look into it.</p> <p>Otherwise, it is still dependent on partic...
<p>The following deployment file is working if I'm uploading it from my local machine.</p> <pre><code>kind: Deployment apiVersion: apps/v1 metadata: name: api namespace: app spec: replicas: 2 selector: matchLabels: run: api template: metadata: labels: run: api spec: cont...
<p>Thanks to <strong>@csanchez</strong> I figured out that I was needed to get credentials under jenkins user. For that I just ran this command:</p> <pre><code>gcloud container clusters get-credentials cluster-1 --zone=my-cluster-zone --project myproject </code></pre>
<p>We have hundreds of deployment and in the config we have imagePullPolicy set as “ifnotpresent” for most of them and for few it is set to “always” now I want to modify all deployment which has <strong>ifnotpresent</strong> to <strong>always</strong>.</p> <p>How can we achieve this with at a stroke?</p> <p>Ex:</p> ...
<p>Kubernetes doesn't natively offer mass update capabilities. For that you'd have to use other CLI tools. That being said, for modifying existing resources, you can also use the <code>kubectl patch</code> function.</p> <p>The script below isn't pretty, but will update all deployments in the namespace.</p> <pre><code...
<p>I have a kubernetes cluster with a few nodes set up. I want to make sure that pods are distributed efficiently on the nodes.</p> <p>I'll explain:</p> <p>Let's assume that I have two nodes: <code> Node 1 - 2gb ram Node 2 - 2gb ram </code></p> <p>And I have these pods: <code> Pod 1 - 1gb ram on Node 1 Pod 2 - 100mb...
<p>The Kubernetes <a href="https://github.com/kubernetes-incubator/descheduler" rel="noreferrer">descheduler</a> incubator project will eventually be integrated into Kubernetes to accommodate rebalancing. This could be prompted by under/overutilization of node resources as your case suggests or for other reasons, such ...
<p>I would like to be able to access and manage a GKE (kubernetes) cluster from a Google Cloud function written in python. I managed to access and retrieve data from the created cluster (endpoint, username, and password at least), however I dont know how to use them with the kubernetes package api.</p> <p>Here are my ...
<p>You can use a bearer token rather than using basic authentication:</p> <pre><code>from google.auth import compute_engine from google.cloud.container_v1 import ClusterManagerClient from kubernetes import client def test_gke(request): project_id = &quot;my-gcp-project&quot; zone = &quot;my-zone&quot; clu...
<p>I'm trying to set up a local k8s cluster and on <code>minikube</code> with installed <code>istio</code> and I have an issue with enabling distributed tracing with Jaeger. I have 3 microservices <code>A -&gt; B -&gt; C</code>. I am propagating the all the headers that are needed:</p> <pre><code>{"x-request-id", "x-b...
<p>Some web frameworks return empty string if a non-existent header is queried. I have seen this in Spring Boot and KoaJS.</p> <p>If any of the tracing headers is not sent by Istio, this header logic causes us to send empty string for those non-existent headers which breaks tracing.</p> <p>My suggestion is after gett...
<h1>this is my network policy:</h1> <pre><code>apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: deny namespace: openstack spec: podSelector: matchLabels: {} policyTypes: - Egress - Ingress </code></pre> <p>I apply this policy and login into 1 pod and it still can connect to google.c...
<p>Before using <code>NetworkPolicy</code>, you need to install a <code>CNI</code> plugin that supports network policies.</p> <p>I use <code>Weave Net</code>, but you can use some other:</p> <p><a href="https://kubernetes.io/docs/tasks/administer-cluster/network-policy-provider/weave-network-policy/" rel="nofollow no...
<p>I am novice to Kubernetes. Recently my Docker registry url is changed from <code>dockerhub.abc.com</code> to <code>dockerhub.def.com</code>. Is it possible that i can change this in properties of Kubernetes pod so that next time,it pulls from new registry?</p>
<p>If you're using secrets to hold your authorization token for your Docker registry, you can refer to <a href="https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/#create-a-secret-in-the-cluster-that-holds-your-authorization-token" rel="nofollow noreferrer">using private registry</a></...
<p><strong>Values.yaml</strong></p> <pre><code>cpulimit: 200m memlimit: 512M </code></pre> <p><strong>configmap.yaml</strong></p> <pre><code>mem_pool_size = {{ ((.Values.memlimit)) mul 0.8 }} --&gt; not working mem_pool_size = {{ .Values.memlimit mul 0.8 }} --&gt; not working mem_pool_size = {{ .Values.memlimit * 0...
<p>In helm templates this is done via <a href="https://docs.helm.sh/chart_template_guide/#template-functions-and-pipelines" rel="nofollow noreferrer">pipelines</a>. Some of them are defined via Go template language and some others are part of <a href="http://masterminds.github.io/sprig/" rel="nofollow noreferrer">Sprig...
<p>In a container running with host networking option it is possible to use a host network interface and its IP from the container and contact external network <em>from</em> this interface and IP. So if a host has several IPs configured, the container can choose which one it uses.</p> <p>Can I have a similar setup wit...
<p><code>hostNetwork=true</code> in pod specification exposes host network to the pod, and container can access network interfaces:</p> <pre><code>apiVersion: v1 kind: Pod metadata: name: lookup spec: hostNetwork: true containers: - name: lookup image: sbusso/lookup_ips:latest ports: - cont...
<p>My application is deployed on a Kubernetes Cluster that runs on Google Cloud. I want to fetch logs written by my application using <a href="https://cloud.google.com/logging/docs/reference/v2/rest/v2/logs/list" rel="nofollow noreferrer">Stackdriver's REST APIs for logging</a>.</p> <p>From the above documentation pag...
<p>you need to request per <a href="https://cloud.google.com/logging/docs/reference/v2/rest/v2/MonitoredResource" rel="nofollow noreferrer">MonitoredResource</a>, which permits instance names and alike... for GCE that would be <code>gce_instance</code> while for GKE it would be <code>container</code>. individual pods o...
<p>I am trying to get dns pod name resolution working on my EKS Kubernetes cluster v1.10.3. My understanding is that creating a headless service will create the necessary pod name records I need but I'm finding this is not true. Am I missing something?</p> <p>Also open to other ideas on how to get this working. Could ...
<p>Internally, I suggest using the service DNS records to point to the pod, which you already confirmed works. This of course does not require you to have a Headless service to use service DNS.</p> <p>The kube-dns automatic records work in the following way:</p> <p>pod -> service in the same namespace: curl <a href="...
<p>I'm dynamically provisioning a EBS Volume (Kubernetes on AWS through EKS) through PersistentVolumeClaim with a StorageClass </p> <pre><code>apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: k8sebs parameters: encrypted: "false" type: gp2 zones: us-east-1a provisioner: kubernetes.io/aws-ebs re...
<p>Seems like at this point in time is not something possible yet.</p> <p>Found these:</p> <p><a href="https://github.com/kubernetes/kubernetes/pull/49390" rel="noreferrer">https://github.com/kubernetes/kubernetes/pull/49390</a></p> <p><a href="https://github.com/kubernetes/kubernetes/issues/50898" rel="noreferrer">...
<p>This setup is running on an Amazon EKS cluster.</p> <p>I am getting an error where the hostname on a pod does not resolve to the cluster ip.</p> <pre><code>$ curl -vvv myservice:10000 * Rebuilt URL to: myservice:10000/ * Hostname was NOT found in DNS cache </code></pre> <p>The env vars have the right service name...
<p>I created an ingress rule for all traffic throughout my worker-node security group and it started working. It looks like there was an issue with containers on a different host than the host that had the kube-dns pods. There is probably a better solution but as of now this has resolved my issue.</p> <p>EDIT: The pre...
<p>I'm kind of a newbie at using GCP/Kubernetes. I want to deploy both a GRPC service and a client to GCP. </p> <p>I have read a lot about it and have tried several things. There's something on cloud endpoints where you compile your proto file and do an api.config.yaml. (<a href="https://cloud.google.com/endpoints/doc...
<p>To deploy a grpc application to GKE/Kubernetes:</p> <ol> <li>Learn about gRPC, follow one of the quickstarts at <a href="https://grpc.io/docs/quickstart/" rel="noreferrer">https://grpc.io/docs/quickstart/</a></li> <li>Learn about how to build Docker images for your application. <ul> <li>Follow this Docker tutorial...
<p>I want to change kubelet logs directory location. For achieving same I have modified <code>/etc/systemd/system/kubelet.service.d/10-kubeadm.conf</code> file contents as follows(as mentioned in <a href="https://stackoverflow.com/questions/46045943/how-to-change-kubelet-working-dir-to-somewhere-else">how to change kub...
<p>I have tried on some machines of mine on GCloud with <code>v1.11.2</code> and I noticed the same your problem.</p> <p>The parameter <code>--log-dir</code> in kubelet seems to have no effect.</p> <p>It is worth opening an issue in kubelet project.</p>
<p>I am looking for some good examples about structuring namespaces in Kubernetes clusters, and an appropriate way to label my pods for long term maintainability.</p> <p>Can you recommend some resources, or examples from real world applications that follow some solid practices?</p>
<p>Namespaces:</p> <ul> <li><p>I recommend grouping resources by namespaces for "resources you can just delete altogether".</p></li> <li><p>Most notably, Kubernetes Policy objects (like RBAC, PodSecurityPolicy, NetworkPolicy, ResourceQuota) are per-namespace. So "namespaces" are often for organizational/team boundary....
<p>I have a pod with only one container that have this resources configuration:</p> <p><code> resources: limits: cpu: 1000m memory: 1000Mi </code></p> <p>From the node where the pod is scheduled I read this:</p> <p><code> CPU Requests CPU Limits Memory Requests Memory Limits 1 (50%) 1 (50%) 10...
<p>Container’s request is set to match its limit regardless if there is a default memory request for the namespace.(<a href="https://kubernetes.io/docs/tasks/administer-cluster/manage-resources/memory-default-namespace/#what-if-you-specify-a-container-s-limit-but-not-its-request" rel="nofollow noreferrer">Kubernetes Do...
<p>I'm creating a Multi-Tenancy Kubernetes infrastructure. I created a Helm Chart with my app, and now I need automate the helm chart installation when a new namespace is created.</p> <p>For example, when the namespace <code>client1</code> is create I need to run <code>helm install myrepo/myapp --name client1</code...
<p>You can either keep running a script which executes <code>kubectl get namespace</code> every since a while and compares the current result with the old result. When you find out a new namespace created, you can then execute <code>helm install myrepo/myapp --name client1</code>. Or you can run an application in your ...
<p>If there's something wrong with the way I phrased the question please tell, so I can be better next time or edit the question.</p> <p><strong>What I did.</strong></p> <p>Use rancher to create an cluster with Amazon EKS.</p> <p>Deployed a nodejs app in 'default' namespace.</p> <p>Installed MongoDB replicaset from...
<p>So you have to include the namespace in the hoststring if if you want to access it as well as reference the cluster domain, which you aren't doing.</p> <p>To quote from <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#stable-network-id" rel="nofollow noreferrer">this document</a></p> ...
<p>I want to run a flink job on kubernetes, using a (persistent) state backend it seems like crashing taskmanagers are no issue as they can ask the jobmanager which checkpoint they need to recover from, if I understand correctly.</p> <p>A crashing jobmanager seems to be a bit more difficult. On this <a href="https://c...
<p>Out of the box, Flink requires a ZooKeeper cluster to recover from JobManager crashes. However, I think you can have a lightweight implementation of the <code>HighAvailabilityServices</code>, <code>CompletedCheckpointStore</code>, <code>CheckpointIDCounter</code> and <code>SubmittedJobGraphStore</code> which can bri...
<p>I've configured my Kubernetes to use one wildcard SSL certificate to all my apps using cert-manager and letsencrypt, now the problem is that I can't configure subdomain redirects cause Ingress is kinda "stiff". Here's how I'm trying to achieve this:</p> <pre><code>apiVersion: extensions/v1beta1 kind: Ingress metada...
<p>Well, for anyone who's having this kind of trouble, I've managed to solve it (not the best solution, but it's a start). For this, I'll be using cert-manager and letsencrypt.</p> <p>First, I've created a ClusterIssuer to issue for my certs with letsencrypt:</p> <pre><code>apiVersion: certmanager.k8s.io/v1alpha1 kin...
<p>I am novice to Kubernetes. Recently my Docker registry url is changed from <code>dockerhub.abc.com</code> to <code>dockerhub.def.com</code>. Is it possible that i can change this in properties of Kubernetes pod so that next time,it pulls from new registry?</p>
<p>In general you'll find it easiest if you explicitly qualify your image names to include the repository name, and not depend on a default value that isn't the official Docker Hub</p> <pre><code>image: dockerhub.abc.com/dist/image:1.2.3 </code></pre> <p>in which case you can just change the image name in your deploy...
<p>I have created a managed Kubernetes cluster in Azure, but it's only for learning purposes and so I only want to pay for the compute whilst I'm actually using it.</p> <p>Is there a easy way to gracefully shut down and start up the VMs, availablity sets and load balancers?</p>
<p>You could use the <a href="https://learn.microsoft.com/en-us/cli/azure/?view=azure-cli-latest" rel="nofollow noreferrer">Azure CLI</a> to <a href="https://learn.microsoft.com/en-gb/azure/aks/start-stop-cluster" rel="nofollow noreferrer">stop the the entire cluster</a>:</p> <pre><code>az aks stop --name myAksCluster ...
<p>We are using Kubernetes <code>v1.9.5</code> on bare metal, deployed with <code>kubespray</code>, network driver - <code>flannel</code>. </p> <p>When doing HTTP request from pod to another service, if that service has no endpoint, request hangs for <strong>exactly 130 seconds</strong> (I checked in via <code>NodeJS<...
<p>It looks like the iptables will DROP packet if its destined to a non-existent end-point and DROP will never send a message back to the requester (<a href="http://www.chiark.greenend.org.uk/~peterb/network/drop-vs-reject" rel="nofollow noreferrer">DROP/REJECT</a>) . This will result in retires from requester. Retries...
<p>I have a Kubernetes service running and we have an external API's dependent on this service.</p> <p>We would like to be notified if there is any service restart. Is there any possibility to hit an API endpoint on every service restart?</p>
<p>Hi and welcome to the community!</p> <p>There are multiple ways of achieve this. A really simple one (as pointed out by Thomas) is an Init Container. Refer to the <a href="https://kubernetes.io/docs/concepts/workloads/pods/init-containers/" rel="nofollow noreferrer">Kubernetes docs</a> for more on how to get those ...
<p>I use Google Kubernetes Engine and I intentionally put an error in the code. I was hoping the rolling update will stop when it discovers the status is <code>CrashLoopBackOff</code>, but it wasn't.</p> <p>In this <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/" rel="noreferrer">page</a...
<p>Turns out I just need to set <code>minReadySeconds</code> and it stops the rolling update when the new replicaSet has status <code>CrashLoopBackOff</code> or something like <code>Exited with status code 1</code>. So now the old replicaSet still available and not updated.</p> <p>Here is the new config.</p> <pre><co...
<p>I am fresh to Kubernetes. </p> <p>My understanding of <code>secret</code> is that it encodes information by <code>base64</code>. And from the resources I have seen, it is claimed that <code>secret</code> could protect sensitive information. I do not get this. </p> <p>Besides encoding information with <code>base64<...
<p>The thing which protects a <code>Secret</code> is the fact that it is a distinct resource type in kubernetes, and thus can be subject to a different RBAC policy than a <code>ConfigMap</code>.</p> <p>If you are currently able to read <code>Secret</code>s in your cluster, that's because your <code>ClusterRoleBinding<...
<p>I am trying to install <code>traefik</code> as an ingress controller on <code>GKE</code> (google cloud kubernetes engine) and when I try:</p> <pre><code>kubectl apply -f https://raw.githubusercontent.com/containous/traefik/master/examples/k8s/traefik-rbac.yaml </code></pre> <p>I have this error: </p> <blockquo...
<p>So for everyone who is trying to install traefik on GKE, and you get stuck with that error message, just do that first <a href="https://stackoverflow.com/a/46316672/1747159">https://stackoverflow.com/a/46316672/1747159</a></p> <pre class="lang-sh prettyprint-override"><code># Get password value $ gcloud container c...
<p>I am a scientist who is exploring the use of Dask on Amazon Web Services. I have some experience with Dask, but none with AWS. I have a few large custom task graphs to execute, and a few colleagues who may want to do the same if I can show them how. I believe that I should be using <a href="https://dask.pydata.org...
<h3>Use Helm or Dask-Kubernetes ?</h3> <p>You can use either. Generally starting with Helm is simpler.</p> <h3>How to include custom packages</h3> <p>You can install custom software using pip or conda. They don't need to be on PyPI or the anaconda default channel. You can point pip or conda to other channels. Her...
<p>I need some help on nginx-php application deployment. I am totally new into kubernetes trying to run a php code. I am running this on minikube. </p> <p>This is my Dockerfile file</p> <pre><code>FROM php:7.2-fpm RUN mkdir /app COPY hello.php /app </code></pre> <p>This is my web.yaml file which includes Deployment ...
<p>Seems like nginx unable to access default page.</p> <p>Either add <code>index hello.php</code> to nginx configuration </p> <pre><code> location / { index hello.php; try_files $uri $uri/ =404; } </code></pre> <p>Or, access your application via absolute URL <code>http://192.168.99.100:...
<p>I am having two linux machines where I am learning Kubernetes. Since resources are limited, I want to configure the same node as master and slave, so the configuration looks like</p> <p>192.168.48.48 (master and slave) 191.168.48.49 (slave)</p> <p>How to perform this setup. Any help will be appreciated. </p>
<p>Yes, you can use <code>minikube</code> the <a href="https://kubernetes.io/docs/tasks/tools/install-minikube/" rel="nofollow noreferrer">Minikube install</a> for single node cluster. Use <code>kubeadm</code> to install Kubernetes where 1 node is master and another one as Node. Here is the <a href="https://kubernetes....
<h2>Background</h2> <p>I'm running a Kubernetes cluster on Google Cloud Platform. I have 2 Node-Pools in my cluster: <code>A</code> and <code>B</code>. <code>B</code> is cheaper (depends on hardware). I prefer that my deployment will run on <code>B</code>. Unless no free resources in <code>B</code>. In that case, new ...
<p>You can taint pool A. Then configure <em>all</em> your pods to tolerate the taint, but with a tolerationSeconds for the duration you want. This is in addition to the config you already did for pool B.</p> <p>The effect will be that the pod is scheduled to A if it won't fit on B, but then after a while will be evict...
<p>I am trying to follow the kubernetes tutorial for single-Instance stateful application: <a href="https://kubernetes.io/docs/tasks/run-application/run-single-instance-stateful-application/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/run-application/run-single-instance-stateful-application/</a></p> <p...
<p>The container is exiting with a <strong>Exit Code 137</strong>, that means a <em>SIGTERM</em> (equivalent to a <code>kill -9 &lt;process&gt;</code>)is sent to the process executed in the container. Usually that means the <strong>OOM Killer</strong> came in to kill it because it was using more memory than the availab...
<p>As per the <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration-memory.html#setup-configuration-memory" rel="nofollow noreferrer">official es docs</a>, disabling swapping is one of the best performance boosts available to Elasticsearch.</p> <p>However, it's proving to be diff...
<p>I think, the ulimits in my yaml weren't being recognized, so I followed <a href="https://github.com/kubernetes/kubernetes/issues/3595" rel="nofollow noreferrer">this post</a> and created an image with a custom entrypoint that set the settings.</p>
<p>I have a UI application written in Angular, which has a backend running in NodeJS. I also have two other services which will be invoked from the NodeJS backend. These applications are running in docker containers and are deployed to a Kubernetes cluster in AWS. </p> <p>The flow is like this:</p> <p>AngularUI -> No...
<p>The ELB has a static DNS hostname, like <code>foobar.eu-west-4.elb.amazonaws.com</code>. When you have a domain at hand, create an A record (alias) that points to this DNS hostname. E.g.</p> <pre><code>webservice.mydomain.com -&gt; mywebservicelb.eu-west-4.elb.amazonaws.com </code></pre> <hr> <p>You can also use ...
<p>I have a simple deployment with 2 replicas.</p> <p>I would like that each of the replicas have same storage folder in them (shared application upload folder)</p> <p>I've been playing with claims and volumes, but haven't got the edge still, so asking for a quick help / example.</p> <pre><code>apiVersion: apps/v1 ...
<p>First of all, you need to decide what type of a Persistent Volume to use. Here are several examples of an on-premise cluster:</p> <ul> <li><p><strong>HostPath</strong> - local Path on a Node. Therefore, if the first Pod is located on Node1 and the second is on Node2, storages will be different. To resolve this prob...
<p>I have two containers inside one pod. One is my application container and the second is a CloudSQL proxy container. Basically my application container is dependent on this CloudSQL container. </p> <p>The problem is that when a pod is terminated, the CloudSQL proxy container is terminated first and only after some s...
<p>This is not directly possible with the Kubernetes pod API at present. Containers may be terminated in any order. The Cloud SQL pod may die more quickly than your application, for example if it has less cleanup to perform or fewer in-flight requests to drain.</p> <p>From <a href="https://kubernetes.io/docs/concepts/w...
<p>I cannot talk to a pod from side car container... any help will be appreciated!</p> <p>Here's my deployment</p> <pre><code>--- apiVersion: extensions/v1beta1 kind: Deployment metadata: name: sidecar-deployment spec: replicas: 1 template: metadata: labels: app: sidecar spec: con...
<p>If your sidecar image exposes the port (recheck your dockefile), you must connect with <code>curl localhost:port/sidecar</code></p> <p>If you have problem connecting from inside the container <strong>using the service</strong> it may be related to <a href="https://kubernetes.io/docs/tasks/debug-application-cluster/...
<p>I am hosting an application on GKE and would like to be able to let users from my organization access this application from the web. I would like them to be able to log-in using their Google Account IAM credentials.</p> <p>Is there a way to configure a service exposing the clusters web endpoint such that to access ...
<p>Okay, I managed to make it work perfectly. But it took a few steps. I am including the manifest here that is required to setup the <a href="https://cloud.google.com/iap/" rel="nofollow noreferrer">IAP</a> <a href="https://cloud.google.com/iap/docs/enabling-kubernetes-howto" rel="nofollow noreferrer">using an ingress...
<p>I successfully deployed Kafka to Kubernetes on local Docker (gcp &amp; minikube) using <a href="https://github.com/Yolean/kubernetes-kafka" rel="nofollow noreferrer">Yolean/kubernetes-kafka</a> &amp; <a href="https://github.com/helm/charts/tree/master/incubator/kafka" rel="nofollow noreferrer">Helm chart</a></p> <...
<p>The service is exposing the pod to the internal Kubernetes network. In order to expose the service (which exposes the pod) to the internet, you need to set up an Ingress that points to the service.</p> <p>Ingresses are basically the equivalent of Apache/Nginx for Kubernetes. You can read up on how to do it at the f...
<p>I'm trying to setup kubernetes (from the tutorials for centos7) on three VMs, unfortunately the joining of the worker fails. I hope someone already had this problem (found it two times on the web with no answers), or might have a guess what's going wrong.</p> <p>Here is what I get by kubeadm join:</p> <pre><code>[...
<p>It seems that your <code>kubeadm token</code> has been expired as per <code>kubelet</code> logs attached.</p> <blockquote> <p>Sep 02 21:19:56 k8s-worker1 kubelet[3082]: F0902 21:19:56.814469<br> 3082 server.go:262] failed to run Kubelet: cannot create certificate signing request: Unauthorized</p> </blockquote...
<p>I am following the steps in the getting started guide for <a href="https://github.com/kubeflow/website/blob/master/content/docs/started/getting-started-minikube.md" rel="nofollow noreferrer">kubeflow</a> and i got stuck at verify the setup works.</p> <p>I managed to get this:-</p> <pre><code>$ kubectl get ns NAME ...
<p>Yes you're missing something here and that is to use the correct namespace. Use:</p> <pre><code>$ kubectl -n kubeflow-admin get all </code></pre>
<p>I am setting up VerneMQ (a MQTT broker) in a cluster configuration. Therefore I am launching 4 replicas in a stateful set. Apparently VerneMQ wants to communicate with the other brokers in a cluster via DNS like this:</p> <pre><code>echo "Will join an existing Kubernetes cluster with discovery node at ${kube_pod_n...
<p>The service must be headless for kube-dns to service domain names like that. See <a href="https://stackoverflow.com/a/46638059">https://stackoverflow.com/a/46638059</a></p>
<p>I'm new to Kubernetes and Rancher. I have builde node docker image with below commands:</p> <pre><code>FROM node:10 RUN mkdir -p /usr/src/app WORKDIR /usr/src/app COPY package.json /usr/src/app RUN npm cache clean RUN npm install COPY . /usr/src/app EXPOSE 3000 CMD ["npm","start"] </code></pre> <p>I have put docke...
<blockquote> <p>But when I'm trying with above IP and Port it's giving message : "This site can’t be reached"</p> </blockquote> <p>Correct, those <code>ClusterIP</code>s are "virtual," in that they exist only inside the cluster. The address you will want to use is <em>any</em> of the <code>Node</code>'s IP addresses...
<p>I have got the following services:</p> <pre><code>ubuntu@master:~$ kubectl get services --all-namespaces NAMESPACE NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE default kubernetes 100.64.0.1 &lt;none&gt; 443/TCP 48m kube-system kube-dns ...
<p>The offical wiki is a little bit confusing so I reordered it here:</p> <p>If you use the <a href="https://github.com/kubernetes/dashboard/blob/master/aio/deploy/recommended/kubernetes-dashboard.yaml" rel="noreferrer">recommended</a> yaml to deploy the dashboard, you should only access your dashboard by https, and yo...
<p>I am trying to switch my local dev environment to run in minikube. I have all the container images built and I have all the YAML configs and I have all the services I need running and I can access them using the URL returned from <code>minikube service web --url</code> (web is the name of my front facing nginx serve...
<p>There are multiple ways. But i found out solution this way.</p> <pre><code>~ → 🐳 $ minikube status minikube: Running cluster: Running kubectl: Correctly Configured: pointing to minikube-vm at 192.168.99.100 </code></pre> <p>Here we can connect with the service using 192.168.99.100 and nodeport. Say for Dashboard...
<p>While I can create custom objects just fine, I am wondering how one is supposed to handle large payloads (Gigabytes) for an object.</p> <p>CRs are mostly used in order to interface with garbage collection/reference counting in Kubernetes.</p> <p>Adding the payload via YAML does not work, though (out of memory for ...
<p>In general the limit on size for any Kube API object is ~1M due to etcd restrictions, but putting more than 20-30k in an object is a bad idea and will be expensive to access (and garbage collection will be expensive as well).</p> <p>I would recommend storing the data in a object storage bucket and using an RBAC pro...
<p>After connecting my Gitlab repo to my self-putup Kubernetes cluster via Operations > Kubernetes, I want to install Helm Tiller via the GUI; but I get:</p> <blockquote> <p>Something went wrong while installing Helm Tiller</p> <p>Kubernetes error: configmaps "values-content-configuration-helm" already exists</...
<p>Find the <code>gitlab-managed-apps</code> namespace with <code>kubectl get cm --all-namespaces</code>:</p> <pre><code>NAMESPACE NAME DATA AGE gitlab-managed-apps values-content-configuration-helm 3 7d ... </code></pre> <p>deleting this namespace solves the issue:</p> <pre...
<p>I want to manually delete iptables rules for debugging. I have several rules created by kube-proxy based on service <code>nettools</code>:</p> <pre><code># kubectl get endpoints nettools NAME ENDPOINTS AGE nettools 172.16.27.138:7493 1h </code></pre> <p>And its iptables rules:</p> <pre><code...
<p>There are multiple tables in play when dealing with <code>iptables</code>. <code>filter</code> table is the default if nothing is specified. The rules that you are trying to delete are part of the <code>nat</code> table.</p> <p>Just add <code>-t nat</code> to your rules to delete those rules.</p> <p>Example:</p> ...
<p>trying to get into istio on kubernetes but it seems i am missing either some fundamentals, or i am doing things back to front. I am quite experienced in kubernetes, but istio and its virtualservice confuses me a bit.</p> <p>I created 2 deployments (helloworld-v1/helloworld-v2). Both have the same image, the only th...
<p>Found the solution, one of the prerequisites (i forgot) is that a proper routing requires named ports: @see <a href="https://istio.io/docs/setup/kubernetes/spec-requirements/" rel="noreferrer">https://istio.io/docs/setup/kubernetes/spec-requirements/</a>. </p> <p>Wrong:</p> <pre><code>spec: ports: - port: 80 ...
<p>I am trying to run my kafka and zookeeper in kubernetes pods. </p> <p>Here is my <code>zookeeper-service.yaml</code>:</p> <pre><code>apiVersion: v1 kind: Service metadata: annotations: kompose.cmd: kompose convert kompose.version: 1.1.0 (36652f6) creationTimestamp: null labels: io.kompose.service...
<blockquote> <p>What could be the reason for this ? and solutions ?</p> </blockquote> <p>The reason is hidden behind following log line:</p> <pre><code>INFO Connecting to zookeeper on zookeeper:2181 (kafka.server.KafkaServer) </code></pre> <p>Kafka is searching for <code>zookeeper</code> while it should search for...
<p>I have a node JS app which i am deploying to kubernetes. </p> <p>I have made changes to node JS app and am redeploying the app to K8s. </p> <p>However, I notice that the deployment is not making through. </p> <p>I checked my docker hub and yes the latest image is being deployed. This is my service.yaml file below...
<p>If I understood the question you should update the <em>Deployment</em> instead. The <em>service</em> is just a kind of LB which dispatch traffic between your pods.</p> <p>First, you should add <code>imagePullPolicy: Always</code> to the deployment to force k8s to download the newest image.</p> <p>If you want to up...
<p>Hei,</p> <p>I'm looking for the documentation for Kubernetes's configuration files. The ones used by kubectl (e.g. <code>kubectl create -f whatever.yaml</code>).</p> <p>Basically, the Kubernetes equivalent of this <a href="https://docs.docker.com/compose/compose-file/" rel="nofollow noreferrer">Docker Compose</a> ...
<p>You could use the <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/" rel="nofollow noreferrer">official API docs</a> but a much more user-friendly way on the command line is the <code>explain</code> command, for example, I never remember what exactly goes into the spec of a pod, so I do:<...
<p>I'm tying to create a deployment with 3 replicas, whcih will pull image from a private registry. I have stored the credentials in a secret and using the imagePullSecrets in the deployment file. Im getting below error in the deploy it.</p> <p>error: error validating "private-reg-pod.yaml": error validating data: [V...
<p>Image section should be placed in container specification. ImagePullSecret should be placed in spec section so proper yaml file looks like this (please note indent):</p> <pre><code>apiVersion: extensions/v1beta1 kind: Deployment metadata: name: test-pod-deployment labels: app: test-pod spec: replicas: 3 ...
<p>I want to profile my play application on my Kubernetes cluster.</p> <p>I am using VisualVM, and the steps that I have taken are as follows:</p> <ol> <li>Image is built on ubuntu latest</li> <li><p>Running my play application with the following args:</p> <pre><code>"-Dcom.sun.management.jmxremote", "-Dcom.sun.mana...
<p>It can be executed in the same form as QA below.</p> <p><a href="https://stackoverflow.com/questions/35184558/multiple-app-nodes-how-to-expose-jmx-in-kubernetes">multiple app nodes how to expose jmx in kubernetes?</a></p> <p>Please set <code>java.rmi.server.hostname</code> System Property.</p> <pre><code>"-Dcom.s...
<p>we do have deployed a Kubernetes Cluster behind a proxy and successfully configured docker daemon to use our proxy for puling images as described at the following page: <a href="https://docs.docker.com/config/daemon/systemd/#httphttps-proxy" rel="noreferrer">https://docs.docker.com/config/daemon/systemd/#httphttps-p...
<p>The reason of that state is that environment variables with proxy are feature of docker client. Docker is divided into 2 parts: API exposed on socket by docker daemon and docker client CLI using which you can run container docker run.... so that command will hit docker daemon API making 'something'. Sadly Kubernetes...
<p>I'm trying to setup a Kubernetes system in our lab at work. I have gone through all the steps, but fail when trying to do the kubeadm. </p> <p>It appears to be an issue with pulling the images:</p> <p>[root@kubemaster ~]# kubeadm config images pull --kubernetes-version=v1.11.2 failed to pull image "k8s.gcr.io/k...
<p>There are 2 possibilities why you have problem with trust for official google's site:</p> <ol> <li>Your company is doing man-in-the-middle by decrypting your traffic and dynamically issuing self-signed certificate for Google domains which you want to access from within your company's network</li> <li>You don't have...
<p>I am unable to make the auto-scaling work with targetcpuutilization setting. My configuration is as follows:</p> <pre><code>apiVersion: autoscaling/v2beta1 kind: HorizontalPodAutoscaler metadata: name: pod namespace: pod spec: minReplicas: 1 maxReplicas: 5 scaleTargetRef: apiVersion: apps/v1 ...
<p>It looks like the metrics server can't receive metrics from the Kubelet endpoint because of an invalid certificate.</p> <p>Try adding following argument to the metrics-server: <code>--kubelet-insecure-tls</code></p>
<p>I'm trying to add centralized logging to my kubernetes cluster using EFK. I found out that my logs from pods that are written to system out are stored in journald in my master node. But I want to store those logs in elasticsearch.</p> <p>Can I change docker config to redirect logs to var logs? I try to avoid to log...
<p>Please try this <a href="https://www.elastic.co/blog/shipping-kubernetes-logs-to-elasticsearch-with-filebeat" rel="nofollow noreferrer">link</a></p> <p>The basic idea is to run Filebeat as a daemonset, which will collect and ship logs from containers and push to Elasticsearch.</p>
<p><s>I am facing a problem with my current k8s setup. In production, I spin up three replicas of each of our services and put them in a pod. When the pods speak to each other, we would like the pods to speak to each container in the pod in a round-robin fashion. Unfortunately, the connection between pods is never term...
<p>I'm assuming that you have a microservice architecture underneath your pods, right? Have you considered the use of <a href="https://istio.io" rel="nofollow noreferrer">Istio</a> with Kubernetes? It's open sourced and developed by Google, IBM and Lyft -- intention is to give developers a vendor-neutral way (which see...
<p>I have created an AKS kubernetes cluster with <code>az</code> CLI :</p> <pre><code>az aks create \ --name abcdefAKSCluster \ --resource-group abcdef \ --node-count 5 \ --generate-ssh-keys \ --service-principal &lt;...&gt; \ --client-secret &lt;...&gt; \ --location westeurope </code></pre...
<p>Unfortunately, Windows container is not yet supported on AKS.</p>
<p>I have generated a python script that opens a deployment config_file.yaml, modifies some parameters and saves it again, using pyyaml. This python script will be executed in the master node of a Kubernetes cluster.</p> <p>Once is generated the new file, my intention is to execute </p> <pre><code>kubectl apply -f co...
<p>I do not know anything about Kubernetes but I think I might help.</p> <p>I am basically suggesting that you run the command directly from Python script, not having Python running a bash script which runs a command.</p> <pre><code>import os command = 'kubectl apply -f config_file.yaml' password = 'yourpassword' p ...
<p>We have set up a kubernetes cluster for our laravel application on google cloud platform. Containers:</p> <ul> <li>application code + php-fpm</li> <li>apache2</li> <li>others not related to the issue</li> </ul> <p>(We run under nginx-ingress-controller but this seems unrelated to the issue)</p> <p>We run a jmeter...
<p>Ok. We found out that we had no opcache enabled. As documented about composer optimize-autoloader:</p> <blockquote> <p>On PHP 5.6+, the class map is also cached in opcache which improves the initialization time greatly. If you make sure <em>opcache is enabled</em>, then the class map should load almost instantly ...
<p>I have a problem that my pods in minikube cluster are not able to see the service through the domain name.</p> <p>to run my minikube i use the following commands (running on windows 10):<br> <code>minikube start --vm-driver hyperv;</code><br> <code>minikube addons enable kube-dns;</code><br> <code>minikube addons e...
<p>So, you want to expose your app on Minikube? I've just tried it using the default <code>ClusterIP</code> service type (essentially, removing the <code>ExternalName</code> stuff you had) and with <a href="https://gist.github.com/mhausenblas/37e43f1755f2895a2f87719bb4144daa" rel="nofollow noreferrer">this YAML file</a...
<p>I am trying to determine the default CPU and memory allocation for Minikube (version &gt; 1.0).</p> <p>When running the following:</p> <pre><code>$ minikube config get memory &amp;&amp; minikube config get cpu Error: specified key could not be found in config </code></pre> <p>values are not returned unless explicitl...
<p>The default memory constant is <code>2048</code> (megabytes) as seen <a href="https://github.com/kubernetes/minikube/blob/232080ae0cbcf9cb9a388eb76cc11cf6884e19c0/pkg/minikube/constants/constants.go#L102" rel="noreferrer">here</a>. </p> <p>This doesn't automatically change with the vm-driver.</p>
<p>I am configuring Jenkins on Kubernetes system. It works fine to build. But in order to deploy, we need to call kubectl or helm. Currently, I am using</p> <ul> <li>lachlanevenson/k8s-kubectl:v1.8.8</li> <li>lachlanevenson/k8s-helm:latest</li> </ul> <p>It is fail and throw exception: "Error from server (Forbidden): ...
<p>The Kubernetes (k8s) master, as of Kubernetes v1.8, by default implements <a href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/" rel="nofollow noreferrer">role-based access control (RBAC)</a> security controls on accesses to its API. The RBAC controls limit access to the k8s API by your workloads to...
<p>My namespace has some custom metadata labels. Some have the labels some don't. Is there any way to get the namespaces which has a particular label using kubectl?</p>
<p>Yes. Like so:</p> <pre><code>$ kubectl create ns nswithlabels $ kubectl label namespace nswithlabels this=thing $ kubectl describe ns/nswithlabels Name: nswithlabels Labels: this=thing Annotations: &lt;none&gt; Status: Active No resource quota. No resource limits. $ kubectl get ns -l=this ...
<p>I am trying to use local persistent volume mentioned in <a href="https://kubernetes.io/blog/2018/04/13/local-persistent-volumes-beta/" rel="noreferrer">https://kubernetes.io/blog/2018/04/13/local-persistent-volumes-beta/</a> for creating my statefulset pod. But when my pod tries to claim volume. I am getting followi...
<p>it was a silly mistake. I was mentioning <code>my-node</code> in node name values in <code>pv</code> files. Modifying it to correct node name solved my issue.</p>
<p>I have created a Kubernetes read-only many persistent volume from a gcePersistentDisk like so:</p> <pre><code>apiVersion: v1 kind: PersistentVolume metadata: name: ferret-pv-1 spec: capacity: storage: 500Gi accessModes: - ReadOnlyMany persistentVolumeReclaimPolicy: Retain gcePersistent...
<p>The PV/PVC access mode is only used for binding PV/PVCs.</p> <p>In your pod template, make sure that you set <code>spec.volumes.persistentVolumeClaim.readOnly</code> to <code>true</code>. This ensures the volume is attached in readonly mode.</p> <p>Also in your pod template, make sure that you set <code>spec.conta...
<p>I have 3-node kubernetes, host names are host_1, host_2, host_3.</p> <pre><code>$ kubectl get nodes NAME STATUS ROLES AGE VERSION host_1 Ready master 134d v1.10.1 host_2 Ready &lt;none&gt; 134d v1.10.1 host_3 Ready &lt;none&gt; 134d v1.10.1 </code><...
<p>It seems that the one node where the PV is available has a taint that your StatefulSet does not have toleration for.</p>
<p>Download the file <a href="https://github.com/openshift/origin/blob/master/examples/hello-openshift/hello-pod.json" rel="nofollow noreferrer">https://github.com/openshift/origin/blob/master/examples/hello-openshift/hello-pod.json</a> and execute the following commands:</p> <pre><code>oc cluster up oc create -f hell...
<p>Your command <code>curl 172.17.0.6:8080</code> would work from inside a pod.</p> <p>If you want to connect from your terminal (localhost), you have these ways:</p> <ol> <li><p><code>oc port-forward &lt;pod_name&gt; 9999:8080</code> and in another terminal <code>curl localhost:9999</code>, <a href="https://docs.ope...
<p>Am working on Azure Resource Manager Templates(ARM Templates) and VSTS CI&amp;CD. With the help of ARM Templates, I want to deploy AKS (Azure kubernete Service). So before going to deploy, I need to validate my ARM Template in the CI-Build by applying a PowerShell task. But here, at the time of validating my ARM Tem...
<p>Not sure how does your powershell script look like. But according to the screenshot, the powershell script is executed successfully without any error code return. You can update your powershell script to check the validate result and set the exit code to "1" if the result is "InvalidTemplate". This will make the pow...
<p>I'm trying to specify Local SSD in a Google Cloud as a <code>PersistedVolume</code>. I followed the <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/persistent-volumes/local-ssd#example_local_pvs" rel="nofollow noreferrer">docs</a> to set up the <a href="https://cloud.google.com/kubernetes-engine/docs...
<p><code>ReadOnlyMany</code> doesn't make sense for local SSDs</p> <p>As per the docs:</p> <blockquote> <p>ReadOnlyMany – the volume can be mounted read-only by many nodes</p> </blockquote> <p>You can't mount a local SSD on many nodes because it's local to one node only.</p>
<p>I'd like to solve the following problem using command line:</p> <p>I'm trying to run the following PoC script from a GCE VM in project-a.</p> <pre><code>gcloud config set project project-b gcloud compute instances create gce-vm-b --zone=us-west1-a gcloud compute ssh --zone=us-west1-a gce-vm-b -- hostname </code></...
<p>"Permission denied (publickey)" means it is unable to validate the public key for the username. </p> <p>You haven't specified the user in your command, so the user from the environment is selected and it may not be allowed into the instance gce-vm-b. Specify a valid user for the instance in your command according t...
<p>My PersistentVolumeClaim will not use the PersistentVolume I have prepared for it.</p> <p>I have this <code>PersistentVolume</code> in <code>monitoring-pv.yaml</code></p> <pre><code>apiVersion: v1 kind: PersistentVolume metadata: name: monitoring-volume labels: usage: monitoring spec: capacity: stora...
<p>When I reviewed my question and compared it to a working solution, I noticed that I had missed <code>storageClassName</code> that was set to <code>manual</code> in an example without a namespace that I was able to use.</p> <p>My updated <code>PersistentVolume</code>now looks like this:</p> <pre><code>apiVersion: v...
<p>I have a container with a backend processing application that only connects to other services, but does not expose any ports it listens to. For example in my case it connects to a JMS broker and uses the Rest API of another service. </p> <p>I want to deploy that container along with the JMS broker and the server wi...
<p>Simply remove the entire <code>Service</code> object. Since you have an app that doesn't need to communicate via the network, you don't need a service. Think of the service as a kind of specialized load-balancer in front of an (HTTP?) API your pods expose. Since you don't have that API, you don't need it. The <code>...
<p>What is the best way to mount an external directory in a pod such that:</p> <ol> <li>the pod access to the directory is readonly</li> <li>whole directory tree is accessible in the pod</li> <li>any change to the directory contents or creation of new files and directories in this directory is reflected to the pod ins...
<p>Using configMap-s one can achieve all requirements (1) thru (4) except for part of (3) - changes to existing files content (by changing their configMap-s) will be reflected in the pods (almost) instantly but new files or directories won't.</p> <p>The following script - see <a href="https://github.com/apimastery/API...
<p>On doing K8s updates on GCP we lose the link between the nodes and their external IPs. That causes some issues afterwards on K8s apps communicating with other clouds secured by firewalls. </p> <p>I have to assign them manually afterwards again. Why is this? Can I prevent this somehow? </p>
<p>First of all, ensure you have set your IP to static in the cloud console -> Networking -> External IP addresses.</p> <p>Once it's set to static you can assign your Service to the static IP using the <code>loadBalancerIP</code> property. Note that your Service should be a LoadBalancer type. See <a href="https://kube...
<p>my pvc.yaml</p> <pre><code>kind: PersistentVolumeClaim apiVersion: v1 metadata: name: database-disk labels: stage: production name: database app: mysql spec: accessModes: - ReadWriteOnce resources: requests: storage: 20Gi </code></pre> <p>running <code>kubectl apply -f pvc.yaml</c...
<p>You forgot to specify the <code>volumeMode</code>. Add the <code>volumeMode</code> option and it should work.</p> <p>Like this:</p> <pre><code>kind: PersistentVolumeClaim apiVersion: v1 metadata: name: database-disk labels: stage: production name: database app: mysql spec: accessModes: - Read...
<p>I have asked myself this question and invested time researching it. Running out of time. Can someone point me in the right direction? I have created a kubernetes cluster on minikube, with its Ingress, Services and Deployments. There is a whole configuration of services in there. Can, now, I point this kubectl comma...
<p>Yes, you can use different clusters via the <a href="https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/" rel="nofollow noreferrer">context</a>. List them using <code>kubectl config get-contexts</code> and switch between them using <code>kubectl config use-context</code>.<...
<p>I'm running Openshift Container Platform 3.9 where I'm deploying three containers; a postgres database container, a qpid message broker container, and a server that needs to connect to both.</p> <p>I need to set environment variables at pod creation in order to allow all three containers to connect. For example, I ...
<p>the quick answer is: you don't</p> <p>If you want to consume some service, define a <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">Service</a> object for it so you get a fixed dns name you can use to refer to that service. And thenm you know the values of DB_HOS...
<p>What is the best way to preload large files into a local PersistentVolume SSD before it gets used by Kubernetes pods?</p> <p>The goal is to have multiple pods (could be multiple instances of the same pod, or different), share the same local SSD drive in a read-only mode. The drive would need to be initialized someh...
<p>Basically, you can add an <code>init</code> container to your pod that initializes the SSD: add data, etc.</p> <pre><code>apiVersion: v1 kind: Pod metadata: name: "test-ssd" spec: initContainers: - name: "init" image: "ubuntu:14.04" command: ["/bin/init_my_ssd.ssh"] volumeMounts: - mountPath: ...
<p>In my cluster, I have one node vm1, with label "kubernetes.io/hostname: vm-1". Can I configure to assign all Pod slaves to vm-1 node? I tries to set "Node Selector" in Jenkin > Configuration > cloud but it does not work.</p> <p>Thanks,</p>
<p>All you need to do is specify this in the <code>Deployment</code> of your jenkins slave with <code>nodeAffinity</code>, like so:</p> <pre><code>--- apiVersion: apps/v1 kind: Deployment metadata: name: jenkins-slave namespace: ci labels: app: jenkins role: slave spec: selector: matchLabels: ...
<p>Is there a way to add node labels when deploying worker nodes in EKS. I do not see an option in the CF template available for worker nodes.</p> <p><a href="https://amazon-eks.s3-us-west-2.amazonaws.com/1.10.3/2018-06-05/amazon-eks-nodegroup.yaml/" rel="noreferrer">EKS-CF-Workers</a></p> <p>The only option I see ri...
<p>With the new EKS-optimized AMIs(amazon-eks-node-vXX) and Cloudformation template refactors provided by AWS it is now possible to add node labels as simple as providing arguments to the <code>BootstrapArguments</code> parameter of the <code>[amazon-eks-nodegroup.yaml][1]</code> Cloudfomation template. For example <co...