prompt stringlengths 65 38.7k | response stringlengths 41 29.1k |
|---|---|
<p>i followed the instructions to install <a href="https://github.com/NVIDIA/nvidia-docker" rel="nofollow noreferrer">nvidia-docker 2</a> and then installed kubernetes 1.10 via kubeadm (on rhel7): i did the following:</p>
<pre><code>curl -s -L https://nvidia.github.io/nvidia-docker/rhel7.4/nvidia-docker.repo | sudo te... | <p>You can view nodes detail via <code>kubectl get nodes -oyaml</code>, <code>nvidia.com/gpu</code> resources will be listed under <code>status.allocatable</code> and <code>status.capacity</code> alongside with cpu and memory</p>
|
<p>recently I've been unable to connect to the bash on my kubernetes cluster. And I'm at a loss as to why. Have anyone else experienced this?</p>
<p><strong>What happened</strong>:
I can no longer connect to /bin/bash in my running pods. It simply hangs when trying to exec the command. I've verified that bash is insta... | <p>You have to pass <code>-t</code> to <code>kubectl exec</code> command, just like <code>docker exec -i -t <container_name> bash</code>.</p>
<p>From the help command:</p>
<blockquote>
<p>-t, --tty=false: Stdin is a TTY</p>
</blockquote>
|
<p>I want to install kube-prometheus on my existing kubernetes cluster(v1.10). Before that, the doc says I need to change the ip address of contrller/scheduler from <code>127.0.0.1</code> to <code>0.0.0.0</code>. And it also recommand to use <a href="https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-conf... | <p>The only way I know of is to use the <code>--config</code> option.</p>
<p>Generate a yaml file that looks like this:</p>
<pre><code>controllerManagerExtraArgs:
address: 0.0.0.0
schedulerExtraArgs:
address: 0.0.0.0
</code></pre>
<p>and then run:</p>
<pre><code>kubeadm upgrade apply --config /etc/kubeadm.yaml
... |
<p>I have a spring boot application with some properties as below in my application.properties.</p>
<pre><code>server.ssl.keyStore=/users/admin/certs/appcert.jks
server.ssl.keyStorePassword=certpwd
server.ssl.trustStore=/users/admin/certs/cacerts
server.ssl.trustStorePassword=trustpwd
</code></pre>
<p>Here the cert p... | <p>Yes, the second approach is the best one, and it is the only way if you are storing some sensitive data like certificates, keys, etc. That topic is covered in the <a href="https://kubernetes.io/docs/concepts/configuration/secret/#overview-of-secrets" rel="nofollow noreferrer">documentation</a>.</p>
<p>Moreover, you... |
<p>I have a Kubernetes cluster running. All pods are running. This is a windows machine with minikube on it.</p>
<p>However <code>helm ls --debug</code> gives following error</p>
<pre><code>helm ls --debug
[debug] Created tunnel using local port: '57209'
[debug] SERVER: "127.0.0.1:57209"
Error: Get http://localhost... | <p>What worked for me when I was facing the same issue was changing <code>automountServiceAccountToken</code> to <code>true</code>.</p>
<p>Use the following command to edit the tiller-deploy</p>
<pre><code>kubectl --namespace=kube-system edit deployment/tiller-deploy
</code></pre>
<p>And change <code>automountServic... |
<p>I used the below command to generate a key locally.</p>
<blockquote>
<p>openssl genrsa -out testsvc.testns.ing.lb.xyz.io.key.pem 2048</p>
</blockquote>
<p>And the used the below command to generate the CSR(certificate signing request).</p>
<blockquote>
<p>openssl req -new -sha256 -key testsvc.testns.ing.lb.xy... | <p>First, let's clarify what the key, CSR, and certificate are. </p>
<p><code>key</code> - locally generated secret file shown/sent to noone (key.pem)<br>
<code>csr</code> - file (request.pem) generated by key.pem, need to be sent to CA (certificate authority). (You can have your own CA, but usually, it is managed by... |
<p>I have a question about a Helm upgrade. I'm working on a chart foo-1.0.0 which deploys a pod with a docker image bar:4.5.1.</p>
<p>I have a release "myrelease" based on this chart foo in version 1.0.0 (with a bar:4.5.1 running inside).</p>
<p>Now, I make a fix on bar, rebuild the image <strong>bar:4.5.2</strong>, ... | <p>You need to change the <code>tag</code> version in the image section of <code>values.yaml</code>:</p>
<pre><code>image:
repository: bar
tag: 4.5.2
pullPolicy: Always
</code></pre>
<p>and then run the following command:</p>
<pre><code>helm upgrade myrelease repo/foo
</code></pre>
<p>or just run the following:... |
<p>We have a set of deployments (sets of pods) that are all using same docker image. Examples:</p>
<ul>
<li>web api</li>
<li>web admin</li>
<li>web tasks worker nodes</li>
<li>data tasks worker nodes</li>
<li>...</li>
</ul>
<p>They all require a set of environment variables that are common, for example location of th... | <p>You can <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#create-a-configmap" rel="nofollow noreferrer">create a ConfigMap</a> with all the common <code>key:value</code> pairs of env variables.</p>
<p>Then you can reuse the configmap to declare all the values of <code>configM... |
<p>Today I confronted with a misunderstanding about <code>servicePort</code>. </p>
<p>I expected that service can be linked with ingress specifying only <code>servicePort: 80</code>, but both <code>servicePort: 80</code> and <code>servicePort: 8080</code> works.</p>
<p>Can someone help me to understand why both ports... | <p>As I understand,</p>
<p>Each Pod in the cluster has an endpoint which is the <strong>IP</strong> and <strong>targetPort</strong> of Pod.</p>
<p>You can list the endpoints with the following commands.</p>
<pre><code>kubectl get endpoints
</code></pre>
<p>Now If you use service to expose your pod then they have <stron... |
<p>I have a Kubernetes cluster with 2 Slaves. I have 4 docker containers which all use a tomcat image and expose port 8080 and 8443. When I now put each container into a separate pod I get an issue with the ports since I only have 2 worker nodes.
What would be the best strategy for my scenario?</p>
<p>Current error m... | <p>You should not use hostNetwork unless absolutely necessary. Without host network you can have multiple pods listening on the same port number as each will have its own, dedicated network namespace.</p>
|
<p>If I ssh into a Kubernetes node, how do I figure out the UUID for the node so I can query the master API for information specific to the node?</p>
<p>Tried this so far</p>
<pre><code>root 13020 2.5 1.0 410112 41660 ? Ssl Jan25 26:04 /usr/bin/kubelet --logtostderr=true --v=0 --api_servers=http://10.3... | <p>I found current kubernetes node (I check minikube, gke node pool) has file <code>/etc/machine-id</code>, which <code>cat /etc/machine-id</code> is unique for each kubernetes nodes and match with correspond <code>kubectl get nodes -o json | jq -r .items[].status.nodeInfo.machineID</code>. </p>
<p>because it does not... |
<p>Lets say I have a Python code on my local machine that listens on localhost and port 8000 as below:</p>
<pre><code>import waitress
app = hug.API(__name__)
app.http.add_middleware(CORSMiddleware(app))
waitress.serve(__hug_wsgi__, host='127.0.0.1', port=8000)
</code></pre>
<p>This code accepts requests on <code>127.... | <p><strong>Externally</strong></p>
<p>By running:</p>
<pre><code>kubectl run python-app --image=gcr.io/${PROJECT_ID}/python-app:v1 --port 8000
</code></pre>
<p>You are specifying that your pod listen on port 8000.</p>
<p>By running:</p>
<pre><code>kubectl expose deployment python-app --type=LoadBalancer --port 80 ... |
<p>I have three clusters in <code>Google Kubernetes Engine</code>, and I am trying to see Kubernetes dashboard but I get the same <code>access-token</code> for two different clusters.</p>
<p>Using <code>kubectl config view</code> command I get:</p>
<pre><code>- name: gke_PROJECT_ZONE_A_NAME_A
user:
auth-provide... | <p>Restarting the UI service by running <code>kubectl proxy</code>, entering to the UI via <code>http://localhost:8001/ui</code> and refreshing the page cause the access token to refresh.</p>
|
<p>I have got NGINX in place as of now which acts as a load balancer. When i was creating the Ingress for my Nginx Controller, the details that i had provided in Ingress file were updated in the containers nginx.conf file.</p>
<p>For example: </p>
<pre><code>upstream default-hello-8123
{ # Load balance algorithm;... | <p>I assume you have configured your ingress via annotations. If not, read here:</p>
<p><a href="https://github.com/nginxinc/kubernetes-ingress/tree/master/examples/jwt" rel="nofollow noreferrer">https://github.com/nginxinc/kubernetes-ingress/tree/master/examples/jwt</a></p>
<p><strong>IMPORTANT</strong>: this whole an... |
<p>Issue: I am trying to reach a vault cluster which is hosted on my k8's cluster using ingress.Currently using nginx ingress controller <code>0.10.2</code> version.</p>
<p>I am using custom generated TLS certs with Ingress which is pointing to the Vault cluster.I have the TLS certs in the same namespace as ingress.</... | <p>You could try with:</p>
<pre><code>kubernetes.io/ingress.class: "<your_class>"
nginx.ingress.kubernetes.io/secure-backends: "true"
nginx.ingress.kubernetes.io/ssl-passthrough: "true"
</code></pre>
<p>Please keep in mind, that <code>ssl-passthrough</code> requires that additional command-line parameter has to... |
<p>While creating the kubernetes cluster using kubeadm in Centos 7, its creating one year kubeapi certificate. For me this is short time for the cluster. How can I create 5 year certificate during cluster setup?</p>
<pre><code>* SSL connection using TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
* Server certificate:
* ... | <p>After looking at the code, there is no option to change the API certificate expire date. It set to 1 year in the code.</p>
<p><a href="https://github.com/kubernetes/client-go/blob/master/util/cert/cert.go" rel="nofollow noreferrer">https://github.com/kubernetes/client-go/blob/master/util/cert/cert.go</a></p>
<pre>... |
<p>I have an ansible script that I am using to build a kubernetes cluster. If I run <code>kubectl</code> via the shell module:</p>
<pre><code>- name: Ensure kube-apiserver-to-kubelet ClusterRole is applied
shell: "kubectl apply -f kube-apiserver-to-kubelet.yaml"
delegate_to: controller1
run_once: true
</code></p... | <p>It's likely not picking up your kubeconfig (localhost:8080 is the unconfigured default)</p>
<p>I would either use the builtin "k8s_raw" module or specify the --kubeconfig parameter in your shell script</p>
|
<p>I am configuring a StatefulSet where I want the number of replicas (<strong>spec.replicas</strong> as shown below) available to somehow pass as a parameter into the application instance. My application needs <strong>spec.replicas</strong> to determine the numer of replicas so it knows what rows to load from a MySQL... | <p>You could use a yaml anchor to do this:</p>
<p>Check out:
<a href="https://helm.sh/docs/chart_template_guide/yaml_techniques/#yaml-anchors" rel="nofollow noreferrer">https://helm.sh/docs/chart_template_guide/yaml_techniques/#yaml-anchors</a></p>
<pre><code>apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
label... |
<p>I am trying to create Kubernetes cluster by using tool kubeadm. When I am exploring I found that by using kubeadm we can create our Kubernetes clusters and also kops is an advanced type tool. When I am reading about Kubernetes, comments are like - Kubeadm is a cluster set up tool. Not a production runtime tool.</p>
... | <blockquote>
<p>What is the difference between setup tool and production runtime tool in kubernetes?</p>
</blockquote>
<p>Setup tool is a special tool for creating and initializing a Kubernetes cluster. It is not clear for me what you mean by "production runtime tool," and I've never heard about that in Kubernetes, ... |
<p>I am running <code>kubernetes 1.9.4</code> on my <code>gke</code> cluster</p>
<p>I have two pods , <code>gate</code> which is trying to connect to <code>coolapp</code>, both written in <code>elixir</code></p>
<p>I am using <a href="https://github.com/bitwalker/libcluster/issues/54" rel="nofollow noreferrer">libclu... | <p><strong>The default <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/" rel="noreferrer">service account</a> for the <code>staging</code> namespace (in which apparently your Pods using libcluster are running) lacks <a href="https://kubernetes.io/docs/admin/authorization/rbac... |
<p>I'm new to Kubernetes and recently I am using it to deploy hadoop. I want to do a thing that set a specific hostname to pod which is created using <code>statefulSets</code> with <code>hostNetwork = true</code>.</p>
<p>Here is my yaml config file.</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: test-b... | <p><strong>It is not possible</strong> to set the hostname for a Pod that is using <code>hostNetwork</code>. If you try to change the hostname in such a Pod you'll see that you are changing the hostname of the node too; this is because they are sharing the <a href="https://en.wikipedia.org/wiki/Linux_namespaces#UTS" re... |
<p>I am trying to create Kubernetes cluster with different number of nodes using same machine. Here I want to create separate VMs and need to create node in those VMs. I am currently exploring about kubeadm and minikube for these tasks.</p>
<p>When I am exploring I had the following confusions:</p>
<ol>
<li>I need to... | <p>Kubeadm should be a good choice for you. It is quite easy to use by just following the <a href="https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm/" rel="nofollow noreferrer">documentation</a>. <strike>Minikube would give you only single node Kubernetes.</strike> As of minikube 1.10.1, it is possible t... |
<p>I am using the following snippet to create the deployment </p>
<pre><code>oc create -f nginx-deployment.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
... | <p>I remember hitting this one in openshift sometime back. It has something to do with SElinux configuration on the host. </p>
<p>Try this at the host server where you mount to your container volume /usr/share/nginx/html. </p>
<p>sudo chcon -Rt svirt_sandbox_file_t /</p>
|
<p>So, I have built my SonarQube server in Kubernetes (We're using it for GoLang code quality). We have everything working and we're happy with it, but in order to have some resiliency, we want to put the Plugins directory on an NFS Share so they are preserved if/when the pod restarts. As it is now, we have to re-insta... | <p>It seems that this was an issue caused by something on the NFS Server side so can be closed/removed.</p>
<p>Once we fully nail down the issue, I will post the solution on the NFS Side.</p>
<p>Thanks!</p>
|
<p>I ran into issue with expired certificates on k8s cluster. I am running version 1.6.1 for over a year now, meaning that my certificates expired and I have to renew them.
In newer versions this is already done automatically, but I currently can not upgrade my cluster to higher version, so I have to create certificate... | <p><strong>There is a detailed <a href="https://kubernetes.io/docs/concepts/cluster-administration/certificates/" rel="nofollow noreferrer">guide on how to generate certificates</a>.</strong></p>
<p>While you are following that guide look out for a few gotchas:</p>
<ul>
<li>Make sure your CA certificate is valid for ... |
<p>I installed kubernetes on two Centos7 VMs using kubeadm.</p>
<p>I am trying to follow the <a href="https://kubernetes.io/docs/tutorials/stateful-application/cassandra/" rel="nofollow noreferrer">Example: Deploying Cassandra with Stateful Sets</a> or <a href="https://github.com/IBM/Scalable-Cassandra-deployment-on-K... | <p>When you create a persistent Volume you have to make sure that the corresponding <a href="https://kubernetes.io/docs/concepts/storage/storage-classes/" rel="noreferrer">storage class</a> exist.</p>
<blockquote>
<p>A StorageClass provides a way for administrators to describe the “classes” of storage they offer. Di... |
<p>In docker-compose I was used to create volumes in this way:</p>
<pre><code>volumes:
- ./server:/home/app
- /home/app/node_modules
</code></pre>
<p>in order to solve the problem of <code>node_modules</code>.</p>
<p>How could I approach the problem in kubernetes?</p>
<p>I've created the following config</p>
<... | <p>I just transitioned from Docker Swarm to Kubernetes and had the same question. The solution I settled on makes use of init containers (<a href="https://kubernetes.io/docs/concepts/workloads/pods/init-containers/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/workloads/pods/init-containers/</a>).</p>
... |
<p>The goal is to orchestrate both production and local development environments using Kubernetes. The problem is that <code>hostPath</code> doesn't work with relative path values. This results in slightly differing configuration files on each developer's machine to accommodate for the different project locations (i.e.... | <p>As mentioned <a href="https://github.com/kubernetes/kubernetes/issues/52787" rel="noreferrer">here</a> <code>kubectl</code> will never support variable substitution. </p>
<p>You can create a <a href="https://helm.sh/" rel="noreferrer">helm</a> chart for your app (yaml). It supports yaml template variables (among va... |
<p>I'm having problems setting up AWS Integration on a Kubernetes Cluster. I've already set the <em>kubernetes.io/cluster/clustername = owned</em> tag on all Instances, Subnets, VPC, and in a Single SG. I've also passed the <em>--cloud-provider=aws</em> flag to both API Server and Controller Manager, but the Controller... | <p>I was able to fix this by passing the <strong>--cloud-provider=aws</strong> flag to the kubelets. I thought that wasn't needed on Master nodes.</p>
<p>Thanks!</p>
|
<p>I'm running a Kubernetes cluster on bare metal and I'm writing an Ansible task to get the join command from a master node:</p>
<pre><code>- name: Get join command from master
shell: kubeadm token create --print-join-command
when: role == "master"
run_once: true
register: join_command
</code></pre>
<p>When ... | <p>You can get that error if your "kubeadm" cannot connect to the Kubernetes cluster using credentials from the configuration file. You can reproduce it by stopping the <code>docker</code> service on your master node.</p>
<p>There is no difference between running the command using Ansible or shell in your case, so it ... |
<p>I am trying to whitelist IPs that can access my application. I created http-balancer by following this tutorial. <a href="https://cloud.google.com/kubernetes-engine/docs/tutorials/http-balancer" rel="nofollow noreferrer">https://cloud.google.com/kubernetes-engine/docs/tutorials/http-balancer</a></p>
<p>After creati... | <p>I have not worked with Ingress but as per normal nginx rules you need to deny all and then allow the whitelist IPS</p>
<pre><code> `location / {
proxy_pass https://xxx.xx.xx.xx:8080
allow xx.xx.xx.xxx/32;
deny all;
allow xx... |
<p>We are stuck with a big problem of <code>kubernetes</code> Queuing.</p>
<p>We are submitting jobs through Workflow manager i.e. Airflow to cluster manager i.e. AWS Batch. Since there are limitations in AWS batch,
irrespective of a number of jobs submitted to the queue, the batch was concurrently executing the nu... | <p>You can configure container resources in your job yamls. Read the below link on how to achieve this: <a href="https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#how-pods-with-resource-requests-are-scheduled" rel="noreferrer">https://kubernetes.io/docs/concepts/configuration/manage-... |
<p>Given is a microservice that after some time needs to quit itself. This is no error condition but (in that case) normal behavior.
After exiting it should be automatically restarted.</p>
<p>So currently I have a script <code>run_app.sh</code>:</p>
<pre><code>#!/usr/bin/env bash
while true; do ./app ; done
</code></... | <p>Well, your loop <em>does</em> restart your app, so this is not your problem. Your problem is that the signal sent to the docker container is not propagated into the container. Docker just isn't (AFAIK) not meant to be used like this, so it doesn't propagate signals to its app.</p>
<p>You have two ways of handling... |
<p>I am creating a Helm chart. When doing a dry run I get a error:</p>
<pre><code>Error: YAML parse error on vstsagent/templates/vsts-buildrelease-agent.yaml: error converting YAML to JSON: yaml: line 28: found character that cannot start any token
</code></pre>
<p>The dry run also outputs the secret and deployment Y... | <p>I missed 2 dots....</p>
<pre><code> - name: ACCOUNT
valueFrom:
secretKeyRef:
name: {{ template "chart.fullname" . }}
key: ACCOUNT
- name: TOKEN
valueFrom:
secretKeyRef:
name: {{ template "chart.fullname" . }}
key: TOKEN
... |
<p>I'm trying to deploy a scalable web application on google cloud.
I have kubernetes deployment which creates multiple replicas of apache+php pods. These have cpu/memory resources/limits set.</p>
<p>Lets say that memory limit per replica is 2GB. How do I properly configure apache to respect this limit?</p>
<p>I can... | <p>I would recommend doing the following instead of trying to configuring apache to limit itself internally:</p>
<ul>
<li>Enforce resource limits on pods. i.e let them OOM. (but see NOTE*)</li>
<li>Define an autoscaling metric for your deployment based on your load.</li>
<li>Setup a namespace wide resource-quota. This... |
<p>When loading a Pod with a container that has many/large layers, it can take more than 2 minutes on my cluster's machines (slower single thread performance coupled with 7200rpm spinning rust means slow untar/ungzip speeds).</p>
<p>This means Kubernetes will give up on that container, saying "context deadline exceede... | <p>Thanks to <a href="https://stackoverflow.com/users/1382970/bits">bits</a>! It was the <code>--runtime-request-timeout</code> flag that I needed to change. Once I increased it enough, it started working!</p>
|
<p>I have a functional Ingress running with TLS setup and working correctly. I can access <a href="http://whoami.domain.com" rel="nofollow noreferrer">http://whoami.domain.com</a> and <a href="https://whoami.domain.com" rel="nofollow noreferrer">https://whoami.domain.com</a>, and correct certificate is used on the http... | <p>It is currently not possible to set up redirection from <code>http://</code> to <code>https://</code> in Google Cloud Load Balancers. Therefore you cannot do this in GKE Ingress. <a href="https://issuetracker.google.com/35904733" rel="nofollow noreferrer">https://issuetracker.google.com/35904733</a></p>
<p>I person... |
<p>I'm trying to setup my Kubernetescluster with a Ceph Cluster using a storageClass, so that with each PVC a new PV is created automatically inside the ceph cluster.</p>
<p>But it doesn't work. I've tried a lot and read a lot of documentation and tutorials and can't figure out, what went wrong.</p>
<p>I've created 2... | <p>You must use <code>annotation: ReadWriteOnce</code>.
As you can see <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/storage/persistent-volumes/</a> (Persistent Volumes section) RBD devices does not support ReadWriteMany mode. Cho... |
<p>I am using Spring Cloud for Creating Microservice Architecture.</p>
<p>I was using the below feature from the Spring Cloud</p>
<ul>
<li>Zuul – API gateway service that provides dynamic routing, monitoring, resiliency, security, and more - </li>
<li>Ribbon – Client side load balancer</li>
<li>Feign – Declarative R... | <p>Even when you use Spring Cloud, 100 services do NOT mean 100 servers. In Spring Cloud the packaging unit is Spring Boot application and a single server may host many such Spring Boot applications. If you want, you can containerize the Spring Boot applications and other Spring Cloud infrastructure support components.... |
<p>I create a deployment which results in 4 pods existing across 2 nodes.</p>
<p>I then expose these pods via a service which results in the following cluster IP and pod endpoints:</p>
<pre><code>Name: s-flask
......
IP: 10.110.201.8
Port: <unset> 9... | <p>Everything you need is explained in second paragraph "Virtual IPs and service proxies" of this documentation: <a href="https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service" rel="noreferrer">https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service</a></p>
<p>... |
<p>I am trying to run a docker image that I have build locally with Kubernetes.</p>
<p>Here is my command line: </p>
<pre><code>kubectl run myImage --image=myImage --port 3030 --image-pull-policy=IfNotPresent
</code></pre>
<p>I have seen many peoples saying that we need to add the <code>--image-pull-policy=IfNotPres... | <p>The <code>image</code> is not available in <code>minikube</code>.</p>
<p>Minikube uses separate <code>docker daemon</code>. That's why, even though the image exists in your machine, it is still missing inside minikube.</p>
<p>First, send the image to minikube by,</p>
<pre><code>docker save myImage | (eval $(minik... |
<p>We're creating a kubernetes statefulset that is mounting a pre-existing NFS share.</p>
<p>Here's a trimmed down example:</p>
<pre><code>apiVersion: apps/v1beta2
kind: StatefulSet
metadata:
name: hostname
spec:
replicas: 1
selector:
matchLabels:
app: test
template:
metadata:
labels:
... | <p>You are adding <code>PersistentVolumes</code>'s specs into <code>template.spec.volumes</code> (<code>Pos</code>'s volume).</p>
<p>These two are not the same thing. The correct reference for this <code>template.spec.volumes</code> would be <a href="https://kubernetes.io/docs/concepts/storage/volumes/" rel="nofollow ... |
<p>Our Kubernetes 1.6 cluster had certificates generated when the cluster was built on April 13th, 2017.</p>
<p>On December 13th, 2017, our cluster was upgraded to version 1.8, and new certificates were generated [apparently, an incomplete set of certificates].</p>
<p>On April 13th, 2018, we started seeing this messa... | <p>I think you need re-generate the apiserver certificate <code>/etc/kubernetes/pki/apiserver.crt</code> you can view current expire date like this.</p>
<pre><code>openssl x509 -in /etc/kubernetes/pki/apiserver.crt -noout -text |grep ' Not '
Not Before: Dec 20 14:32:00 2017 GMT
Not After : Dec 2... |
<p>I am planning to introduce K8s/Istio into my infra.
Right now I have plenty of services which communicate with each other using RabbitMQ.</p>
<p>Service mesh concept seems to assume all services should be synchronous.</p>
<p>I'd like to keep at least some of my services async and take advantage of Mutual TLS Authe... | <p>Please note that Istio can control non-HTTP protocols on top of TCP, including providing Mutual TLS Authentication. See this example of mTLS for HTTPS (treated as opaque TCP) - <a href="https://preliminary.istio.io/docs/tasks/security/https-overlay.html" rel="nofollow noreferrer">https://preliminary.istio.io/docs/ta... |
<p>I'm looking for a way to mount configs based on label selector.</p>
<p>I will have new configmap's created over time, which I will label with "intendeedtarget"="MainApp".
The configs are created from json file, with filename as key.</p>
<p>E.g. a yml something like this (but working):</p>
<pre><code> volumeMou... | <p>So the short version is no, one cannot specify a whole range of volumeMounts, but there is a work-around available to you: <code>initContainers:</code></p>
<p>I believe it would work like this:</p>
<ol>
<li>The Pod would declare a <code>volume</code> of type <code>emptyDir</code>, named <code>appconfigs</code> <em... |
<p>I'm trying to run confluent kafka image in kubernetes environment & facing </p>
<pre><code>FATAL [KafkaServer id=0] Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
kafka.common.KafkaException: Found directory /var/lib/kafka/data, 'data' is not in the form of topic-partitio... | <p>is it your error?
<a href="https://i.stack.imgur.com/al4yx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/al4yx.png" alt="enter image description here"></a></p>
<p>Fix add this:</p>
<pre><code>log.dirs=/var/lib/kafka/data
</code></pre>
<p>in server.properties</p>
|
<p>Is there any way to make kubernetes distribute pods as much as possible?
I have "Requests" on all deployments and global Requests as well
as HPA. all nodes are the same.</p>
<p>Just had a situation where my ASG scaled down a node and one service became completely unavailable as all 4 pods were on the same node that... | <p>Here I leverage <a href="https://stackoverflow.com/a/41169994/1024794">Anirudh's answer</a> adding example code. </p>
<p>My initial kubernetes <a href="https://github.com/ypapax/say-grpc/blob/master/backend/kubernetes_external_ip.yaml" rel="noreferrer">yaml</a> looked like this:</p>
<pre><code>apiVersion: extensio... |
<p>Im getting a error while running sonar-scanner on a (self-hosted) vsts agent. The agent (visual studio team services) is running on a kubernetes cluster (linux).</p>
<p>In VSTS i added the Sonarqube prepare and run analyses (retrieved via the VSTS marketplace). At the run analyses i get the following error:</p>
<p... | <p>The class <code>org.sonar.api.batch.rule.ActiveRules</code> is defined in <code>sonar-plugin-api</code>, so I think the bug is caused by a plugin.</p>
<p>I see you use <code>C# 5.10.1.1411</code>. I found this issue: <a href="https://github.com/SonarSource/sonar-csharp/issues/307" rel="nofollow noreferrer">ActiveRu... |
<p>I am trying to set up a conventional web app with a database in Kubernetes. I have accomplished it by configuring 2 services and 2 deployments - one for the app and one for the database. Now I would like to make my database accessible only from the app pods, ie not expose it to outside world like a service. Is it po... | <p>There are following ways to expose the pods. </p>
<p>purpose is inter-service communication</p>
<p><strong>Internally expose</strong> </p>
<ul>
<li>service <code>type=clusterIP</code> </li>
<li><strong>Headless-service</strong> <code>clusterIP: None</code> is used for database pods </li>
</ul>
<blockquote>
... |
<p>Who has access to open pod terminals through the openshift web console? What permissions need to be given for this?</p>
| <p>Any user that has <code>edit</code> or <code>admin</code> role in the project which the application is running in, can create a terminal session for pods running in that project.</p>
<pre><code>oc adm policy add-role-to-user edit <collaborator>
</code></pre>
<p>The purpose of the different roles you can gran... |
<p>When i run the helm install command the below line gives me the error:</p>
<pre><code>args: [while [ 1 ]; do echo "hi" ; sleep 1; done;]
</code></pre>
<p>Error:</p>
<pre><code>Error: YAML parse error
converting YAML to JSON: yaml: line 27: did not find expected ',' or ']'
</code></pre>
| <p>Square brackets have special meaning in YAML (they indicate a flow sequence, i.e. an inline array). You need to quote that scalar (string):</p>
<pre class="lang-yaml prettyprint-override"><code>args: [ 'while [ 1 ]; do echo "I am awake" ; sleep 1; done;' ]
</code></pre>
<p>...or make it a block scalar and use th... |
<p>I'm looking to understand how to recreate my cluster. There's a cluster-level setting to specify the IP range for nodes created within it, which I want to use so I can set a decent firewall rule. However, it looks like that can't be changed once the cluster is created.</p>
<p>I have a number of namespaces, deploy... | <p>As you can see the backup and the migration of whole clusters is quite a discussed matter and still an open issue on Kubernetes github as well:</p>
<ul>
<li><a href="https://github.com/kubernetes/kubernetes/issues/24229" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/24229</a></li>
</ul>
... |
<p>I was able to follow the documentation and get a kubernetes cluster up. But I would like to add a second master node I tried this on the second node but seeing an error </p>
<pre><code>[root@kubemaster02 ~]# kubeadm init --apiserver-advertise-
address=10.122.161.XX --pod-network-cidr=10.244.0.0/16 --kubernetes-
... | <p>In your case, please look what is running on the port 10250 :</p>
<pre><code>netstat -nlp | grep 10250
</code></pre>
<p>Because your error is:</p>
<blockquote>
<p>[ERROR Port-10250]: Port 10250 is in use</p>
</blockquote>
<p>In general, you can bootstrap additional master, and have 2 masters. Before running ku... |
<p>I'm currently running on AWS and use <a href="https://github.com/kube-aws/kube-spot-termination-notice-handler" rel="noreferrer">kube-aws/kube-spot-termination-notice-handler</a> to intercept an AWS spot termination notice and gracefully evict the pods.</p>
<p>I'm reading <a href="https://cloud.google.com/kubernete... | <p>Yes you are right, so far there is no built in way to handle <code>ACPI G2 Soft Off</code>.</p>
<p>Notice that if <a href="https://cloud.google.com/compute/docs/instances/preemptible" rel="nofollow noreferrer">normal preemptible</a> instance supports shutdown scripts (where you could introduce some kind of logic to... |
<p>I'm trying to change the <code>client_max_body_size</code> value, so my NGINX ingress will not return the HTTP 413 Content Too Large error (as seen in the logs).</p>
<p>I've tested a few solutions.<br />
Here is my config map:</p>
<pre><code>kind: ConfigMap
apiVersion: v1
data:
proxy-connect-timeout: "15"... | <p>You can use the <a href="https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md#custom-max-body-size" rel="noreferrer">annotation</a> <code>nginx.ingress.kubernetes.io/proxy-body-size</code> to set the max-body-size option right in your Ingress object instead of ch... |
<p>After far as I know: </p>
<ul>
<li>deploymentconfig → replicationcontroller → pod</li>
</ul>
<p>vs.</p>
<ul>
<li>deployment → replicaset → pod</li>
</ul>
<p>Otherwise, do these two resources have additional differences?</p>
<p>The more detail the better.</p>
| <p>A <a href="https://docs.openshift.com/container-platform/3.9/dev_guide/deployments/how_deployments_work.html" rel="noreferrer">DeploymentConfig</a> (DC) in OpenShift is more or less equivalent to a Kubernetes <code>Deployment</code>, nowadays. Main difference (besides that one is using <code>ReplicationController</c... |
<p>In Kubernetes, ReplicaController uses label selectors to specify which pod(s) it will operate on.</p>
<p>Now, my question is, if multiple ReplicaControllers have overlapping label selectors, what will be the behavior of the Kubernetes cluster? Or is it considered some kind of error and should be avoided?</p>
<p>Fo... | <p>The <a href="https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#pod-selector" rel="nofollow noreferrer">Kubernetes docs</a> state the following about overlapping selectors (either from other pods, replication controllers or jobs):</p>
<blockquote>
<p>Also you should not normally crea... |
<p>I am running a 3 nodes bare metal cluster on version <code>1.9.5</code>.</p>
<p>IPs of the 3 nodes are :</p>
<pre><code>[root@node1 new]# kubectl get nodes
NAME STATUS ROLES AGE VERSION IP
node1 Ready master,node 1d v1.9.5 172.16.16.1
node2 Ready node ... | <p>All your configs are fine, except one thing related to annotation:</p>
<pre><code> annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
</code></pre>
<p>You don't need this annotation, because it's processed earlier than routing and you always have the request to <code>/</code> . You have no route for t... |
<p>I am suffering below problem.</p>
<p>I use ubuntu 16.04. I am following guide document, but it does not works for me.</p>
<pre><code># cat /etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
# curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
OK... | <p>You should try to update <a href="https://en.wikipedia.org/wiki/Pretty_Good_Privacy" rel="noreferrer">PGP</a> keys from the keyserver provided by Canonical:</p>
<pre><code>sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 6A030B21BA07F4FB
Executing: /tmp/apt-key-gpghome.F7OvCVWiqu/gpg.1.sh --ke... |
<pre><code>$ kubectl version
Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.6", GitCommit:"9f8ebd171479bec0ada837d7ee641dec2f8c6dd1", GitTreeState:"clean", BuildDate:"2018-03-21T15:21:50Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"... | <p>The issue is that the container does not exist (see the CrashLoopBackOff).</p>
<p>One of the things that I do with init containers (assuming you have the source) is to put a sleep 600 on failure in the entrypoint. At least for debugging. This lets you exec into the container to poke around to see the cause of the ... |
<p>I have my deployment.yaml file within the templates directory of Helm charts with several environment variables for the container I will be running using Helm.</p>
<p>Now I want to be able to pull the environment variables locally from whatever machine the helm is ran so I can hide the secrets that way.</p>
<p>How... | <p>You can <code>export</code> the variable and use it while running <code>helm install</code>.</p>
<p>Before that, you have to modify your chart so that the value can be <code>set</code> while installation. </p>
<p>Skip this part, if you already know, how to setup template fields.</p>
<hr>
<p>As you don't want to ... |
<p>I am currently trying to deploy the following on Minikube. I used the configuration files to use a hostpath as a persistent storage on minikube node.</p>
<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
name: "pv-volume"
spec:
capacity:
storage: "20Gi"
accessModes:
- "ReadWriteOnce"
hostPa... | <p><strong>Your configuration is fine.</strong></p>
<p>Tested under <code>minikube v0.24.0</code>, <code>minikube v0.25.0</code> and <code>minikube v0.26.1</code> without any problem.</p>
<p>Take in mind that <strong>minikube is under active development</strong>, and, specially if you're under windows, is like they s... |
<p>I am using the ingress-nginx system <a href="https://github.com/kubernetes/ingress-nginx" rel="nofollow noreferrer">https://github.com/kubernetes/ingress-nginx</a>. I'm making extensive use of this project. Jenkins, Consul, Prometheus and more are working just fine using the exact same ingress config as appended to ... | <p>Unsealing the vault through the port-forward method will change the state of the kubernetes pod level healthchecking, which is what is queried by ingress-nginx to determine if a backend is valid or not.</p>
<p>Once the vault is unsealed you can access the backend as you expect.</p>
<p>At the time of writing, the v... |
<p>I would like the containers in my pod to share a volume for temporary (cached) data. I don't mind if the data is lost when the pod terminates (in fact, I want the data deleted and space reclaimed).</p>
<p>The <a href="https://kubernetes.io/docs/concepts/storage/volumes/#emptydir" rel="noreferrer">kubernetes docs</a... | <p>From the mount information you've supplied, the <code>emptyDir</code> volume is mounted on a drive partition, so it's working as intended, and isn't mounted in memory. It's likely that the memory usage you see is due to the filesystem buffer cache, so with sufficient memory pressure, it'd eventually get written to t... |
<p>We've currently got a production application using Kubernetes on AWS. Everything's working very well except I think we've made a misconfiguration problem. </p>
<p>We expose different services from within the cluster on domain names and we're now up to about 5 different services. Kubernetes' standard way to expose t... | <p>You can use Ingress controller. Ingress will setup a single AWS load balancer and can be used to expose many services. If you services are all HTTP based, it should work quite well. For more information about ingress you can have a look to the <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/... |
<p>While running the minikube start in windows 10, getting the following error.</p>
<blockquote>
<p>Error : Error restarting cluster: restarting kube-proxy: waiting for kube-proxy to be up for configmap update: timed out waiting for the condition</p>
</blockquote>
<p>Please help me resolve the give issue, I delete... | <p>I faced the same issue on Centos 7</p>
<p><code>minikube delete</code></p>
<p>then </p>
<p><code>minikube start</code></p>
<p>solved my issue</p>
|
<p>I was trying to build with Kubernetes, and I was wanted to use the local image which I pulled in the early days to save time.(So it does not have to pull a image every time a container is created).The problem is that Kubernetes just ignored my local images.</p>
<p>For example. when I run <code>docker images</code>,... | <p>If you are using a Kubernetes cluster, you have to make sure the Docker image you need is available in all nodes, as you don't really know which one will get assigned the Pod.</p>
<p>So: pull/build the needed image from each cluster node.</p>
|
<p>I have an application which will de deployed in an OpenShift/Kubernetes cluster as a pod. I know this is against the principles of Kubernetes, but this pod should only be run once (so ther shall not be parallel processing). There may be a second pod running for the case the first one crashes to immediately take over... | <p>This has to be done by the application, because Kubernetes deliberately does not provide these application-tier primitives out of the box. There are ways to orchestrate things such that Kubernetes will generally keep only one pod running, but the guarantees offered by that orchestration are limited. </p>
<p>Using a... |
<p>I'm currently deploying a K8S cluster through Rancher RKE using AWS EC2 virtual machines (with CentOS 7 and Docker 17.03.2-ce).
Unfortunately after depolying K8S dashboard, I'm not been able to access it from external, through API SERVER (<a href="https://API-server-ip:6443/api/v1/namespaces/kube-system/services/ht... | <p>After several digging I managed to found a solution.</p>
<p>In the generate RKE kubeconfig generated file, both client-certificate-data and client-key-data are present as base64 encoded keys for kube-admin.</p>
<p>In order to use them in my client browser I had first to decode them for obtaining the respective cer... |
<p>I have a multi container pod deployment that exposes port 8080 the port inside the container is accessible through localhost but not the pod IP
when I telnet on the pod local host I'm able to connect but when I telnet on the pod IP that's in /etc/hosts I get connection refused.</p>
<p>deployment.yaml</p>
<pre><co... | <p>The <code>command</code> option in Pod Spec overrides <code>Entrypoint</code> option in Docker Container, that's why you actually run tail instead of your application</p>
<pre><code> - name: "app-container"
...
command: ["tail", "-f", "/dev/null"]
</code></pre>
<p>According to the <a href="https://kubern... |
<p>I have a simple k8s installation with few nodes and ceph (kubernetes.io/rbd) as storageclass. I have a deployment with a single pod which uses a persistent volume from the persistent volume claim (ReadWriteOnce) from this storage class.</p>
<p>A node with this pod have failed (NotReady in <code>get nodes</code> out... | <p>It is a complex problem.</p>
<p>Kubelet daemon, which manages mounts of Volumes, should set the information about a new status of volume to enable the Scheduler to spawn a Pod on the other node. </p>
<p>But, you have the 'NotReady' status, which means Kubernetes cannot communicate with the Kubelet to check the cur... |
<p>I'm in the process of trying to convert a Docker Cloud based setup to k8s.</p>
<p>I've found the k8s kompose tool which can convert a docker compose file into a k8s file. Based on my results I'm wondering if it is possible to define a full stack in a single file.</p>
<p>I'm running <code>kompose convert</code> but... | <p>I'm not sure via the UI but via the command line Kompose gives you the ability to "up" them all as you are used to with docker-compose. I believe Kompose also has support for Healm which might be your easiest route for utilizing all the files in an easy-ish way.</p>
|
<p>I have created two node pools. A small one for all the google system jobs and a bigger one for my tasks. The bigger one should reduce its size to 0 after the job is done.</p>
<blockquote>
<p><strong>The problem is:</strong> Even if there are no cron jobs, the node pool do not
reduce his size to 0.</p>
</blockqu... | <p>Quoting from Google <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-autoscaler" rel="nofollow noreferrer">Documentation</a>:</p>
<blockquote>
<p>"Note: Beginning with Kubernetes version 1.7, you can specify a minimum size of zero for your node pool. This allows your node pool to scale ... |
<p>I'm trying to get this go-micro greeter example working on Kubernetes <a href="https://github.com/micro/examples/tree/master/greeter" rel="nofollow noreferrer">https://github.com/micro/examples/tree/master/greeter</a></p>
<p>I can run this locally in docker fine. However when I attempt to access the greeter api ser... | <p>Everything is fine with your configs.</p>
<blockquote>
<p>http://{{external-ip}}/greeter/say/hello), I get the error:
{"id":"go.micro.api","code":500,"detail":"not
found","status":"Internal Server Error"}</p>
</blockquote>
<p>You missed just the port number 8080 in your request and tried to call rpc service... |
<p>I created a pod with an api and web docker container in kuberneters using a yml file (see below).</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
name: test
labels:
purpose: test
spec:
containers:
- name: api
image: gcr.io/test-1/api:latest
ports:
- containerPort: 8085
name: htt... | <p>To expose a deployment to the public internet, you will want to use a Service. The service type LoadBalancer handles this nicely, as you can just use pod selectors in the yaml file.</p>
<p>So if my deployment.yaml looks like this:</p>
<pre><code>kind: Deployment
apiVersion: apps/v1beta2
metadata:
name: test-dply... |
<p>On NixOS is is easy to set up Kubernetes by a single line of config:</p>
<pre><code>services.kubernetes.roles = ["master" "node"];
</code></pre>
<p>This installs both the master and node components on the local system and therefore creates a nice little working local kubernetes "cluster".</p>
<p>If I want to set ... | <p>Have a look at <a href="https://youtu.be/XgZWbrBLP4I?t=29m16s" rel="nofollow noreferrer">the latter part</a> of <a href="https://stackoverflow.com/users/1612283/offlinehacker">Jaka Hudoklin/offlinehacker</a>'s NixCon '15 presentation about Kubernetes on NixOS at GateHub. It has an example configuration that configur... |
<p>I am seeing the following error in the container when deployed to the kubernetes. I have the line </p>
<pre><code>spec:
containers:
- name: mysql
image: mysql/mysql-server:latest
args:
- "--ignore-db-dir=lost+found"
</code></pre>
<p>in the config, do I need to include anything else</p>
<pre><cod... | <p>This specific error is because <code>--ignore-db-dir</code> is not specified correctly. <code>=</code> should not be used.</p>
<p>From your logs, the following can be seen</p>
<blockquote>
<p>[Server] unknown variable 'ignore-db-dir=lost+found'</p>
</blockquote>
<p>Since this fails, the ignore database director... |
<p>We currently have around 20 jobs. These jobs create one pod each, but we want to make sure that only one of these pods can run at a time, keeping the rest of them in pending status. Increasing the resource limitations makes them to run one by one but I want to be sure that this is always the behaviour.</p>
<p>Is th... | <p>Use <a href="https://kubernetes.io/docs/tasks/administer-cluster/quota-pod-namespace/" rel="nofollow noreferrer">ResourceQuota</a> resource:</p>
<pre><code>apiVersion: v1
kind: ResourceQuota
metadata:
name: pod-demo
spec:
hard:
pods: "5"
</code></pre>
|
<p>I have added a new CRD <code>ApiGateway</code> to Kubernetes and I want to watch for new/changed resources of it.</p>
<p>This works with a simple Rest Client as shown in the example below. </p>
<p>But I´d like to watch for these resources with <code>k8s.io/client-go/kubernetes</code>. </p>
<p>While it is simple t... | <p>If you think about it, <code>client-go</code> knows about <code>deployments</code>, <code>services</code>, <code>pods</code> etc resources. But it doesn't recognize your CRD <code>ApiGateway</code>.</p>
<p>So, <code>client-go</code> can't be used as a client for your custom made resources (wait-for-it), unless you m... |
<p>Is it possible to enable <code>net.ipv4.ip_forward</code> on a container's network namespace?</p>
<hr>
<p><strong>Manual</strong></p>
<p>From the host, I can enable it with manually with</p>
<pre><code>sudo nsenter -t \
$(docker inspect --format '{{.State.Pid}}' $CONTAINER_NAME) \
-n sysctl -w net.ipv4.i... | <p>In case of some sysctl parameters yes; <code>net.*</code> <strong>is namespaced</strong>, so <code>net.ipv4.ip_forward</code> can be enabled per Pod (per container).</p>
<p>Follow the <a href="https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/" rel="noreferrer">Using Sysctls in a Kubernetes Cluster... |
<p>I'm trying to generate a certificate in my local (MacBook) environment which I can package in my Docker image and deploy into my AWS environment via Kubernetes.</p>
<p>I've scoured sources online for a solution to this but I'm unable to find the details I need.</p>
<p>From my macbook:</p>
<pre><code>sudo certbot ... | <p>In order to verify ownership of the domain from your macbook you have these two options as stated in the certbot docs:</p>
<ul>
<li>Use a DNS plugin - <a href="https://certbot.eff.org/docs/using.html#dns-plugins" rel="nofollow noreferrer">https://certbot.eff.org/docs/using.html#dns-plugins</a></li>
<li>Use the manu... |
<p>I'm building a helm chart for my application, and I'm using <code>stable/nginx-ingress</code> as a subchart. I have a single <code>overrides.yml</code> file that contains (among other overrides):</p>
<pre><code>nginx-ingress:
controller:
annotations:
external-dns.alpha.kubernetes.io/hostname: "*.{{ .Rel... | <p>I found the issue on github -- it is not supported yet:
<a href="https://github.com/kubernetes/helm/issues/2133" rel="nofollow noreferrer">https://github.com/kubernetes/helm/issues/2133</a></p>
|
<p><code>kubectl</code> I am looking for a single command or maybe combination of commands for the following yaml file </p>
<pre><code>---
#
# Create a role, `pod-reader`, that can list pods and
# bind the default service account in the `mynamespace` namespace
# to that role.
#
kind: Role
apiVersion: rbac.authorizati... | <p>This assumes the namespace and service account are already created:</p>
<pre><code>$ kubectl create namespace mynamespace
$ kubectl create serviceaccount mysa -n mynamespace
</code></pre>
<p>Create the role with:</p>
<pre><code>$ kubectl create role pod-reader --namespace=mynamespace \
--verb=get,list,watch ... |
<p>I am trying to run <code>pg_dump</code> in a Docker container via <code>kubectl</code> and save the output to my local machine.</p>
<p>Here's what I have so far:</p>
<p><code>kubectl exec -it MY_POD_NAME -- pg_dump -h DB_HOST -U USER_NAME SCHEMA_NAME > backup.sql</code></p>
<p>However this just hangs currently... | <p>Use <code>kubectl port-forward POD_NAME 6000:5342</code> to forward your pod port (assumed to be exposed on <code>5432</code>) onto <code>localhost:6000</code>. </p>
<p>And then run <code>pg_dump</code> directly with hostname as <code>localhost</code> and port as <code>6000</code></p>
<p><code>$ pg_dump -h DB_HOST... |
<p>I am new to kubernetes. I successfully created a headless service for aerospike-kubernetes. I logged into docker container and verified that the mesh contains all the replicas. I have used <a href="https://github.com/aerospike/aerospike-kubernetes/blob/master/aerospike-statefulset.yaml" rel="nofollow noreferrer">htt... | <blockquote>
<p>headless service clusterIP is "none" </p>
</blockquote>
<p>This simply means we don't use the load balancer/reverse proxy mode, but rather DNS Round-Robin mode for the service endpoint.</p>
<p>By default, visibility of the Aerospike cluster is limited to within the Kubernetes environment. You can us... |
<p>I was following <a href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/" rel="nofollow noreferrer">this kubernetes tutorial</a> in order to set up a <code>DNS service</code> and connect together two separate <code>kubernetes pods</code>. The one, which should serve as a gateway, is listenin... | <p>The Kubernetes DNS service works inside a cluster and provide DNS names for pods, not for external services.</p>
<p>Here is an extract from the <a href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/" rel="nofollow noreferrer">instruction</a> you used:</p>
<blockquote>
<p>Every Service defi... |
<p>Is there a practical justification for labelling services besides that this services can be queried?</p>
<p>Suppose I've got a service:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: nginx
labels:
app: nginx
</code></pre>
<p>Can I then use that label for something else than querying t... | <p>I would say that to be able to distinguish easily between different types of objects (in your case Service) using labels. Is the most practical use case. Say you have a cluster with different environments dev, staging, production etc. and you need to find services based on that or any other type of infrastructure ru... |
<p>According to the documentation here:
<a href="https://docs.docker.com/storage/volumes/" rel="nofollow noreferrer">https://docs.docker.com/storage/volumes/</a></p>
<blockquote>
<p>If you start a container which creates a new volume, as above, and the container has files or directories in the directory to be mounte... | <p>Kubernetes <code>Volumes</code> is not the same thing as Docker <code>Volumes</code>.</p>
<p>From the Kubernetes <a href="https://kubernetes.io/docs/concepts/storage/volumes/" rel="nofollow noreferrer">documentation</a>:</p>
<blockquote>
<p>Docker also has a concept of volumes, though it is somewhat looser and less ... |
<p>After following the <a href="https://kubernetes.io/docs/tutorials/stateless-application/hello-minikube/" rel="noreferrer">hello-minikube guide</a> and installing minikube 0.26.1 the dashboard pod is not starting and also the <a href="https://kubernetes.io/docs/getting-started-guides/minikube/#quickstart" rel="norefe... | <p>This has to do with <a href="https://kubernetes.io/blog/2017/03/advanced-scheduling-in-kubernetes" rel="noreferrer">taints and tolerations</a> in k8s versions starting from 1.6.
By default the master node has a <code>NoSchedule</code> taint.</p>
<pre><code># kubectl describe node minikube
Name: miniku... |
<p>When creating a cluster on GKE its possible to create <a href="https://cloud.google.com/compute/docs/instances/creating-instance-with-custom-machine-type#extendedmemory" rel="noreferrer">Custom Instance Types</a>. When adding <code>8GB</code> of memory to an <code>n1-standard-1</code> Kubernetes only shows memory al... | <p>Quotinig from <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture" rel="noreferrer">documentation</a>:</p>
<blockquote>
<p><strong>Node allocatable resources</strong> </p>
<p><strong>Note</strong> that some of a node's resources are required to run the Kubernetes Engine and... |
<p>I am trying to deploy my sample micro service Docker image in Kubernetes cluster having 2 node. I explored everything about Pods, Services, Deployment, StatefulSets and Daemon-sets etc.</p>
<p>I am trying to create a sample deployment and Service for that. Here I explored about how deployment provides the scalabili... | <p><strong>tldr:</strong></p>
<p>you can not access the application using the <strong>clusterIP</strong> from the outside of the cluster. you can access the application using either loadbalancer's IP (<code>type=LoadBalaner</code>) or Node's IP (<code>type=NodePort</code>). </p>
<p><strong>benefit of clusterIP:</str... |
<p>I am trying to configure hostPath as the volume in kubernetes. I have logged into VM server, from where I usually use kubernetes commands such as kubectl.</p>
<p>Below is the pod yaml:</p>
<pre><code>apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: helloworldanilhostpath
spec:
replicas: 1
template:
... | <p><a href="https://kubernetes.io/docs/concepts/storage/volumes/#hostpath" rel="noreferrer"><code>hostPath</code></a> type volumes refer to directories on the Node (VM/machine) where your Pod is scheduled for running (<code>aks-nodepool1-39499429-1</code> in this case). So you'd need to create this directory at least o... |
<p>I have probaly problem with kubernetes DNS as my service cannot communicate to outside world (bitbucker.org).
Actually I found this page:
<a href="https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/administer-cluster/dns-debuggin... | <p>I found the problem. Problem occures when i deploy busybox and try to ping external serwer with name. Problem not exists when I used IP address. So the problem whas in DNS and name resolving. during ping I look into dns logs and see the problem.
Helped me config map for dn:</p>
<pre><code>apiVersion: v1
kind: Confi... |
<p>Is there a practical justification for labelling services besides that this services can be queried?</p>
<p>Suppose I've got a service:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: nginx
labels:
app: nginx
</code></pre>
<p>Can I then use that label for something else than querying t... | <p>One of the uses I've come across for labels is for tearing down an application end to end. So when I deploy to kubernetes, I make sure everything related to the same application is labeled as such. That way I just do <code>kubectl delete all --selector=app=foo</code> to delete all the foo related Services, Deploymen... |
<p>I am trying to build a redis cluster with kubernetes on azure. And I am faced with the exact same problem when running different samples : <a href="https://sanderp.nl/running-redis-cluster-on-kubernetes-e451bda76cad" rel="nofollow noreferrer">sanderp.nl/running-redis-cluster-on-kubernetes</a> or <a href="https://git... | <p>You can use <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/" rel="nofollow noreferrer">statefulsets</a> for deploying your replicas, so your pod will have a unique name always.</p>
<p>Moreover, you will be able to use <code>service</code> DNS-names as host. See this official doc <a h... |
<p>I'm on google kubernetes engine, and I need to run the filebeat daemonset found (<a href="https://www.elastic.co/guide/en/beats/filebeat/master/running-on-kubernetes.html" rel="nofollow noreferrer">https://www.elastic.co/guide/en/beats/filebeat/master/running-on-kubernetes.html</a>). I create the cluster with:</p>
... | <p>As you can read here [1]: "Beginning with Kubernetes version 1.9.x, automatic firewall rules have changed such that workloads in your Kubernetes Engine cluster cannot communicate with other Compute Engine VMs that are on the same network, but outside the cluster. This change was made for security reasons.</p>
<p>Yo... |
<p>Creating a <a href="http://kubernetes.io/v1.1/docs/user-guide/services.html#type-loadbalancer" rel="noreferrer">Kubernetes LoadBalancer</a> returns immediatly (ex: <code>kubectl create -f ...</code> or <code>kubectl expose svc NAME --name=load-balancer --port=80 --type=LoadBalancer</code>).</p>
<p>I know a manual ... | <p>Just to add to the answers here, the best option right now is to use a bash script. For convenience, I've put it into a single line that includes exporting an environmental variable. </p>
<p><strong>Command to wait and find Kubernetes service endpoint</strong></p>
<pre><code>bash -c 'external_ip=""; while [ -z $ex... |
<p>I run <code>istio</code> on <code>Kubernetes</code>. I want to know how the envoy sidecar works. For example, after sidecar is injected into the pod, the original container cannot access the outer network without <code>EgressRule</code>. How does it work?</p>
| <p>All the traffic inside the pod is captured by <a href="https://en.wikipedia.org/wiki/Iptables" rel="noreferrer">iptables commands</a> and directed to the sidecar proxy. Then the sidecar proxy performs routing, according to routing tables it receives from Istio Pilot (a part of the <a href="https://blog.envoyproxy.io... |
<p>I created a gossip cluster in AWS using <strong>kops</strong>, which means my cluster name is ending with <strong>k8s.local</strong> (clusters.test.k8s.local to be exected ),
All is working fine until I tried to create a deployment where the pod name needs to be with a domain at the end (api-manager.iot.test.co.nz)... | <p>No, you cannot create that kind of <code>labels</code> by design.</p>
<p>From the design <a href="https://github.com/kubernetes/community/blob/master/contributors/design-proposals/architecture/identifiers.md" rel="nofollow noreferrer">document</a>:</p>
<blockquote>
<p><a href="http://www.ietf.org/rfc/rfc1035.txt... |
<p>I have multiple teams and each team has bunch of Applications and Each application will have different environments( DEV, STAGE, PROD ). Looking for a way to limit the accesses using namespace.</p>
<p>Say, each team will have their own namespace.</p>
<p>I don't want Application deployed in namespace A access configM... | <p>Namespaces automatically separate resources in the cluster. So if you create a namespace A and B, then if you create a configmap in namespace A it will automatically be unavailable in namespace B.</p>
<p>If you want to restrict users on what they can do in your cluster. For example if you like developers to be able... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.