prompt stringlengths 65 38.7k | response stringlengths 41 29.1k |
|---|---|
<p>I'm using k8s v 1.7. Following the guide in <a href="https://kubernetes.io/docs/concepts/cluster-administration/sysctl-cluster/" rel="nofollow noreferrer">docs</a>, my deployment has the following in its spec:</p>
<pre><code>annotations:
security.alpha.kubernetes.io/unsafe-sysctls: net.core.somaxconn=16384
</code... | <p>I tried with this and it seemed to work</p>
<pre><code>minikube start --extra-config=kubelet.AllowedUnsafeSysctls=net.core.somaxconn
</code></pre>
<p>Extracted from here: <a href="https://github.com/kubernetes/kubernetes/blob/master/cmd/kubelet/app/options/options.go" rel="nofollow noreferrer">https://github.com/k... |
<p>As per the documentation at - <a href="https://github.com/spring-cloud-incubator/spring-cloud-kubernetes/#configmap-propertysource" rel="nofollow noreferrer">https://github.com/spring-cloud-incubator/spring-cloud-kubernetes/#configmap-propertysource</a>, it is possible to make ConfigMaps available during application... | <p>As you can see in <a href="https://github.com/fabric8io/spring-cloud-kubernetes/blob/master/spring-cloud-kubernetes-core/src/main/java/io/fabric8/spring/cloud/kubernetes/config/ConfigMapPropertySource.java" rel="nofollow noreferrer">ConfigMapPropertySource.java</a>, only one ConfigMap will be used by this property s... |
<p>We have two pods in Kubernetes that for sake of conversation we'll call pod1 and pod2. I created pv1 and pvc1 on pod 1 and it's working fine.
In my opinion, the documentation is not clear enough about this scenario or I couldn't find the right wiki.
How can I access pv1 and pvc1 from pod2?</p>
| <p>From the k8s documentation:</p>
<blockquote>
<p>A <strong>PersistentVolume (PV)</strong> is a piece of storage in the cluster that
has been provisioned by an administrator. It is a resource in the
cluster just like a node is a cluster resource. PVs are volume plugins
like Volumes, but have a lifecycle indep... |
<p>I'm running a gunicorn+flask service in a docker container with Google Container Engine. I set up the cluster following the tutorial at <a href="http://kubernetes.io/docs/hellonode/" rel="nofollow">http://kubernetes.io/docs/hellonode/</a></p>
<p>The <code>REMOTE_ADDR</code> environmental variable always contains an... | <p>If anyone gets stuck on this there is a better approach.
You can use the following annotations depending on your kubernetes version:</p>
<pre><code>service.spec.externalTrafficPolicy: Local
</code></pre>
<p>on 1.7</p>
<p>or </p>
<pre><code>service.beta.kubernetes.io/external-traffic: OnlyLocal
</code></pre>
<p... |
<p>I've been working at this, and I'm not making any progress.</p>
<p>The issue is that when I create a service out of a deployment, the ClusterIp that's created for the service isn't accessible within MiniKube as I expect it should be.</p>
<p>I can verify that it's not accessible by sshing into a different pod than ... | <p>A Service gets its Virtual IP address using the ClusterIP. That IP address is used for communicating with the Service and is accessible only within the cluster. </p>
<p>Make sure that you connect to a service not only by its IP but also with the port that service exposed.</p>
<p>In your case:</p>
<pre><code>$ kub... |
<p>For exmaple, I created network at docker</p>
<pre><code>docker network create hello-rails
</code></pre>
<p>Then, I have mySQL, which is connected to this network</p>
<pre><code>docker run -p 3306 -d --network=hello-rails --network-alias=db -e MYSQL_ROOT_PASSWORD=password --name hello-rails-db mysql
</code></pre>
... | <p>In Kubernetes you would solve this by creating two services.</p>
<p>The MySQL service will look something like this:</p>
<pre><code>kind: Service
apiVersion: v1
metadata:
name: mysql
spec:
selector:
app: mysql
ports:
- port: 3306
</code></pre>
<p>In your rails server, you can access the MySQL service ... |
<p>I don't understand why a separate resource group is created for all of the infrastructure associated with an ACS cluster, and not the Resource Group I specify when creating the cluster? This leave my defined Resource Group with one lonely entity (the ACS Cluster definition) and a whole new Resource Group whose name ... | <p>This is the new design of the ACS (v2) in some selected regions. In the past (the v1), the created resources are in the same resource group as container service resource is. It makes it really hard to clean up those resources when you delete the container service resource. With those being in a new resource group (p... |
<p>I've found jsonpath examples for testing multiple values but not extracting multiple values.</p>
<p>I want to get <code>image</code> and <code>name</code> from <code>kubectl get pods</code>.</p>
<p>this gets me <code>name</code>
<code>
kubectl get pods -o=jsonpath='{.items[*].spec.containers[*].name}' | xargs -n ... | <p>Use below command to get name and image:</p>
<pre><code>kubectl get pods -Ao jsonpath='{range .items[*]}{@.metadata.name}{" "}{@.spec.template.spec.containers[].image}{"\n"}{end}'
</code></pre>
<p>It will give output like below:</p>
<pre class="lang-none prettyprint-override"><code>name image
</c... |
<p>I have a Pod that occasionally needs to call itself by its own host-name. I have a Deployment set up that ultimately creates the Pod, and a Service in place. I'm able to use the service name from a different Pod within my cluster, but the Pod cannot call itself using its host-name. This is something that works w... | <p>This is a known bug in newer versions of kubernetes / minikube and is being tracked here: </p>
<p><a href="https://github.com/kubernetes/kubernetes/issues/20475" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/20475</a></p>
<p>The current accepted workaround (<a href="https://github.com/k... |
<p>I have configured minikube in my local machine and going to use kubernetes externally. I have created a Service Account in kubernetes and using it's secret I can get the access token using below command.</p>
<pre><code>kubectl get secret <service-account-secret> -o yaml -n mynamespace
</code></pre>
<p>My que... | <p>The client already does that for you.</p>
<p>If you just create an empty Config object:</p>
<pre><code>Config config = new ConfigBuilder().build();
</code></pre>
<p>or create the client, like:</p>
<pre><code>KubernetesClient client = new DefaultKubernetesClient();
</code></pre>
<p>from within a pod, it will aut... |
<p>I'd like to show entries that have <code>.metadata.labels.app</code> set to <code>"myapp"</code>value.</p>
<p>Command:</p>
<pre><code>kubectl get pods -o go-template --template="{{range .items}}{{if eq .metadata.labels.app "myapp"}}{{.metadata.name}} {{end}}{{end}}"
</code></pre>
<p>It gives an error:</p>
<block... | <p>I haven't used kubetcl before, but I am familiar with shell commands in general, from which I can tell you one thing that's going wrong, and maybe that's all you need. (I'm also somewhat familiar with Go templates, and your string comparison looks fine to me.) By using double quotes around your template and within... |
<p>I'm wondering if there is a proper naming convention for generated pod names in Kubernetes. By generated pod names I mean the name displayed in both <code>kubectl get pods</code> or, for instance, by querying the heapster api:</p>
<pre><code>$ curl -s http://192.168.99.100:32416/api/v1/model/namespaces/kube-system/... | <p>if you use deployment then the naming convention as follows:</p>
<p>|--- Deployment: < name ><br>
│<code>-----</code>└─ Replica Set: < name >-< rs ><br>
│<code>--------</code>└─ Pod: < name >-< rs>-< RandomString ></p>
|
<p>I have Docker, Kubernetes(1.7) and Nginx all running on my RHEL7 server with my own services being inside a docker container and being picked up by Kubernetes. I know Kubernetes is working right with docker because I can call a get request of the Kubernete pod using its own IP:PORT addresses and it works. I set up N... | <p>There are some issues with your setup as far as I can see:</p>
<ul>
<li><p><code>KUBEIPADDRESS</code> in the URL you call: an IP address won't work because you configured your Ingress to listen on <code>testhost</code>. So you need to call <code>http://testhost/customer</code>, and configure your network to resolve... |
<p>I try to run minikube v0.22.1 and kubectl v1.7.5 on MacOS with Virtualbox.</p>
<pre><code>$ minikube start
Starting local Kubernetes v1.7.5 cluster...
Starting VM...
Getting VM IP address...
Moving files into cluster...
Setting up certs...
Connecting to cluster...
Setting up kubeconfig...
Starting cluster component... | <p>If you run </p>
<pre><code>kubectl config get-contexts
</code></pre>
<p>Do you get the following?</p>
<pre><code>CURRENT NAME CLUSTER AUTHINFO NAMESPACE
* minikube minikube minikube
</code></pre>
<p>If not that means your kubectl context is not correctly setup. To setup the context corr... |
<p>I can already do spot deployments with kops but it requires manually editing a the instance groups (nodes)</p>
<pre><code>$ kops edit ig --name=test.dev.test.com nodes
machineType: t2.medium
maxSize: 2
minSize: 2
=>
machineType: t1.nano
maxSize: 1
minSize: 1
</code></pre>
<p>Need to look into a way ... | <p>You could use Argo minion-manager. This is part of open-source workflow engine for Kubernetes <a href="http://argoproj.io" rel="nofollow noreferrer">Argo</a> , but can be run on any kubernetes cluster. Minion-manager runs as deployment and periodically updates spot instance prices using the AWS pricing API.</p>
<p>... |
<p>I want to have full control of what I do with my single node cluster (savings...lol), but somehow I can't do this even if I delete the deployment it respawns ..</p>
| <p>As mentioned in another answer, you cannot delete them directly via the Kubernetes API; however, you can delete them indirectly via the Google Container Engine API. </p>
<p>To remove the dashboard, run <code>gcloud container clusters update $CLUSTER_NAME --update-addons=KubernetesDashboard=DISABLED</code>. </p>
<p... |
<p>I could create the container:</p>
<pre><code>$ kubectl run hello-minikube --image=gcr.io/google_containers/echoserver:1.4 --port=
deployment "hello-minikube" created
</code></pre>
<p>And I'm now trying to expose a service:</p>
<pre><code>$ kubectl expose deployment hello-minikube --type=NodePort
error: couldn't f... | <p>You get this error because you didn't set the container port from the command <code>kubectl run hello-minikube --image=gcr.io/google_containers/echoserver:1.4 --port=</code> as such the expose command doesn't know which container port to map to a node port and then error </p>
<p>You have to set exact container port... |
<p>I installed kubernetes by following this <a href="https://blog.alexellis.io/kubernetes-in-10-minutes/" rel="nofollow noreferrer">tutorial</a>.</p>
<p>One of my containers tries to get resources from an external domain, such as google.com. But it fails because kubernetes dns doesn't use external name resolving.</p>
... | <p>What are the results of <code>nslookup google.com</code> in the container and the node?</p>
<p>If the pod's dnsPolicy is ClusterFirst, google.com DNS query should be forwarded to the upstream DNS which the node specified.</p>
<p>It would be also useful to show the kube-dns container config and logs.</p>
<p><a hre... |
<p>I'm creating an environment-variable with</p>
<pre><code> env :
- name: GCE_ENV
value: my-value
</code></pre>
<p>Is there a way to consume that from Java / Scala?</p>
<pre><code> "echo $GCE_ENV" !!
</code></pre>
<p>Did not grab it; I guess the JVM console session doesn't get it set?</p>
<p>Log... | <p>Getting env variable from Java is done through: </p>
<pre><code>System.getenv("GCE_ENV")
</code></pre>
|
<p>There is an error during fission setup on minikube.
I went through this instruction: <a href="http://fission.io/docs/v0.2.1/install/" rel="nofollow noreferrer">http://fission.io/docs/v0.2.1/install/</a>
On this command:</p>
<pre><code>helm install --namespace fission --set serviceType=NodePort https://github.com/f... | <p>Finally I was figured out that the problem was due to installation of old minikube version: v0.16.0.</p>
<p>After upgrade to v0.22.1 everything works as expected</p>
|
<p>Below is all replica sets in my kubernetes environments create by <strong>deployments</strong> (when using <strong>deployment</strong>, it will first create <strong>replica sets</strong>): </p>
<pre><code>[root@master24 004-prometheus]# kubectl get rs --all-namespaces
NAMESPACE NAME ... | <p>If I found the correct line, then the name of a ReplicaSet is generated here:
<a href="https://github.com/kubernetes/kubernetes/blob/16670f1a95a61434f8d6c96596a3c541b01fb8aa/pkg/controller/deployment/sync.go#L299" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/blob/16670f1a95a61434f8d6c96596a3c5... |
<p>I am migrating to Azure platform from GCP. I have a k8s cluster that needs to talk to external Cassandra cluster using internal IP(s), in the same Azure region but different VNET. I have the VNET(s) peered. I can reach the Cassandra cluster from the K8s nodes and vice versa but cannot reach them from the pods.</p>
... | <p>Because Azure can't find your private IP address of your pods. We can use Azure <strong>route table</strong> to connect them.</p>
<p>Here is my test, two resource group, one for k8s and another one for a signal VM.</p>
<p>Here is the information about pods:</p>
<pre><code>root@k8s-master-CA9C4E39-0:~# kubectl get... |
<p>Is there a way to share secrets across namespaces in Kubernetes?</p>
<p>My use case is: I have the same private registry for all my namespaces and I want to avoid creating the same secret for each.</p>
| <p>Secret API objects reside in a namespace. They can only be referenced by pods in that same namespace. Basically, you will have to create the secret for every namespace.</p>
<p>For more details, see this: <a href="https://kubernetes.io/docs/concepts/configuration/secret/#details" rel="noreferrer">Kubernetes Documenta... |
<p>I am trying to add Kubernetes as cloud to Jenkins server with the appropriate Kubernetes URL and other details. When i add the details and test the connection
i get the following error</p>
<blockquote>
<p>Error connecting to <a href="https://192.168.X.XX:6443" rel="nofollow noreferrer">https://192.168.X.XX:6443</a>:... | <p>Did you define the role <code>admin</code>? if not define the admin role. below document your refer it.</p>
<p><a href="https://docs.bitnami.com/kubernetes/how-to/configure-rbac-in-your-kubernetes-cluster/" rel="nofollow noreferrer">https://docs.bitnami.com/kubernetes/how-to/configure-rbac-in-your-kubernetes-cluste... |
<p>After upgrading my cluster nodes image from <strong>CONTAINER_VM</strong> to <strong>CONTAINER_OPTIMIZED_OS</strong> I ran into performance degradation of the <strong>PHP Application</strong> up to 10 times.
Did i miss something in my configuration or its a common issue?
I tried to take machines with more CPU and me... | <p>One of the reasons could be the fact that Kubernetes actually started enforcing the CPU limits with Container-Optimized OS.</p>
<pre><code>resources:
limits:
cpu: "20m"
</code></pre>
<p>These were not enforced on the older ContainerVM images.</p>
<p>Could you please try removing/relaxing cpu limits fr... |
<p>I have a problem with multi-port services. I try to expose two ports, the first one works, the other does not. I am testing this with telnet (amongst others), and I always get "connection refused" for the second port.</p>
<p>This is the part about the ports in the service's yaml:</p>
<pre><code>spec:
clusterIP: 1... | <p>I would first confirm that kubectl get svc shows the two NodePorts. If that is the case, then it is highly likely that the destination port in the pods are not working. Could you check in the pods if the ports are listening correctly? Then, I would also advise you to check the access using the ClusterIP as well. </p... |
<p>I am in the middle of no where. Following this tutorial <a href="https://cloud.google.com/container-engine/docs/tutorials/persistent-disk" rel="nofollow noreferrer">https://cloud.google.com/container-engine/docs/tutorials/persistent-disk</a></p>
<p>I deployed wordpress to google container engine. Now i have no idea... | <p>The persistent disk containing the wordpress files are attached to the wordpress pod. This disk is mounted on /var/www/html folder under the wordpress pod. You can access these files by connecting to the wordpress pod. First get the name of the running pod by executing the following command,</p>
<pre><code> kubectl... |
<p>I executed below command:</p>
<pre><code>kubectl proxy --port=8081 &
kubectl proxy --port=8082 &
</code></pre>
<p>and of course I have 2 accessible endpoints:</p>
<pre><code>curl http://localhost:8081/api/
curl http://localhost:8082/api/
</code></pre>
<p>But in the same time two running processes serving... | <p>I believe the "kubectl way" is to not background the proxy at all as it is intended to be a short running process to access the API on your local machine without further authentication.</p>
<p>There is no way to stop it other than kill or ^C (if not in background).</p>
<p>You can use standard shell tricks though, ... |
<p>Sometimes there are variables in the deployment yaml file which are not pre-specified and will be known only during deployment (For example name and tag for the image of a container).</p>
<p>Normally we put a marker text (e.g. <code>{{IMAGE_NAME}}</code>) in the yaml file and use a bash text manipulation tools to c... | <p>What I've done is use envvars in the deployment configuration, then run <code>apply</code>/<code>create</code> with the output from an <a href="https://linux.die.net/man/1/envsubst" rel="nofollow noreferrer"><code>envsubst</code></a> command:</p>
<p>deployment.yaml file:</p>
<pre><code>[...]
spec:
replicas: $REP... |
<p>I can't get Ingress to work on GKE, owing to health check failures. I've tried all of the debugging steps I can think of, including:</p>
<ul>
<li>Verified I'm not running low on any quotas</li>
<li>Verified that my service is accessible from within the cluster</li>
<li>Verified that my service works behind a k8s/GK... | <p>Had a similar issue a few weeks ago. What fixed it for me was to add a NodePort in the service description so that the Google Cloud Loadbalancer can probe this NodePort. The config that worked for me:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: some-service
spec:
selector:
name: some-app
... |
<p>I'm playing with Kubernetes inside 3 VirtualBox VMs with CentOS 7, 1 master and 2 minions. Unfortunately installation manuals say something like <code>every service will be accessible from every node, every pod will see all other pods</code>, but I don't see this happening. I can access the service only from that no... | <p>It works either by disabling the firewall or by running below command.</p>
<p>I found this open bug in my search. Looks like this is related to docker >=1.13 and flannel</p>
<p>refer: <a href="https://github.com/coreos/flannel/issues/799" rel="nofollow noreferrer">https://github.com/coreos/flannel/issues/799</a></... |
<p>I Build a simple NodeJS API, pushed the Docker Image to a repo and deployed it to my k8s with Helm install (works perfectly fine).</p>
<p>The pullPolicy is <code>Always</code>.</p>
<p>Now I want to update the source code and deploy the updated version of my app. I bumped the version in all files, built and pushed ... | <p>Helm will roll out changes to kubernetes objects only if there are changes to roll out. If you use <code>:latest</code> there is no change to be applied to the deployment file, ergo no pods will rolling update. To keep using <code>latest</code>, you need to add something (ie. label with sha / version) that will chan... |
<p>I have a 3 node kubernetes cluster, a master and two nodes on AWS that I created with kubeadm (<a href="https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/" rel="nofollow noreferrer">https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/</a>)</p>
<p>I have created some deployments fro... | <p>It works either by disabling the firewall or by running below command.</p>
<p>I found this bug in my search. Looks like this is related to docker >=1.13 and flannel</p>
<p>refer: <a href="https://github.com/coreos/flannel/issues/799" rel="nofollow noreferrer">https://github.com/coreos/flannel/issues/799</a></p>
|
<p>I have noticed that containers in a pod can use localhost to talk to each other as advertised. For example one container starts a server socket on localhost:9999 and a second container can connect to that address. This fails if I expose the server container's port. Also it fails if I create a TCP liveness probe on ... | <p>Here is an example deployment using TCP liveness probe, TCP readiness probe and networking between containers in a pod with the server containers port exposed:</p>
<h2>test.yml</h2>
<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: test
spec:
template:
metadata:
labels:
... |
<p>With Kubernetes on can define storage classes with provisioners. How does one find which provisioners are installed and available in the cluster? </p>
<p>Inspecting the storage classes will reveal which provisioners are already in use, but not whether there are more available.</p>
| <p>A provisioner does not necessarily need to run in the cluster, e.g. the provisioner for an external storage appliance just connects to the cluster api server and watches for new persistent volume requests created with a storage class bound to its provisioner name. This is why as of Kubernetes 1.7 there is no intende... |
<p>I have certain questions regarding importing the existing certificates.</p>
<ol>
<li><p>How are certificates used internally in Kubernetes (e.g. between api server and workers, master controller, etc.)?
Is there a CA in Kubernetes? (how) does it generate certificates for internal use?</p></li>
<li><p>What certific... | <p>Certificates in Kubernetes are primarily used to secure communication from and to the API server. Taken from the <a href="https://kubernetes.io/docs/tasks/tls/managing-tls-in-a-cluster/" rel="nofollow noreferrer">official Kubernetes documentation</a>:</p>
<blockquote>
<p>Every Kubernetes cluster has a cluster roo... |
<p>I have a Kubernetes deployment that deploys a Java application based on the <a href="https://hub.docker.com/r/anapsix/alpine-java/" rel="nofollow noreferrer">anapsix/alpine-java</a> image. There is nothing else running in the container expect for the Java application and the container overhead.</p>
<p>I want to maxi... | <p>The reason Kubernetes kills your pods is the <a href="https://kubernetes.io/docs/concepts/policy/resource-quotas/" rel="noreferrer">resource limit</a>. It is difficult to calculate because of container overhead and the usual mismatches between decimal and binary prefixes in specification of memory usage. My solution... |
<p>Kubernetes supports GPUs as an experimental feature. Does it work in google container engine? Do I need to have some special configuration to enable it? I want to be able to run machine learning workloads, but want to use Python 3 which isn't available in CloudML.</p>
| <p>GPUs on Google Container Engine are now available in Alpha. <a href="https://docs.google.com/forms/d/1JNnoUe1_3xZvAogAi16DwH6AjF2eu08ggED24OGO7Xc/viewform?edit_requested=true" rel="noreferrer">Sign up form</a>.</p>
<p>Beware that <a href="https://cloud.google.com/container-engine/docs/alpha-clusters" rel="noreferr... |
<p>I am trying reach my k8s master from my workstation. I can access the master from the LAN fine but not from my workstation. The error message is:</p>
<pre><code>% kubectl --context=employee-context get pods
Unable to connect to the server: x509: certificate is valid for 10.96.0.1, 10.161.233.80, not 114.215.201.87
... | <p>One option is to tell <code>kubectl</code> that you don't want the certificate to be validated. Obviously this brings up security issues but I guess you are only testing so here you go:</p>
<pre><code>kubectl --insecure-skip-tls-verify --context=employee-context get pods
</code></pre>
<p>The better option is to fix ... |
<p>I am using Deployments to control my pods in my K8S cluster.</p>
<p>My original deployment file looks like :</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: websocket-backend-deployment
spec:
replicas: 2
selector:
matchLabels:
name: websocket-backend
template:
m... | <p>I would suggest you to set the <strong>maxSurge</strong> to 0 in the RollingUpdate strategy to make the desired pods same after the rollout . The maxSurge parameter is the maximum number of pods that can be scheduled above the original number of pods. </p>
<p>Example: </p>
<pre class="lang-sh prettyprint-override... |
<p>Hoping someone can help me resolve what appears to be a permissions error. I'm trying to start a 3-node elasticsearch cluster using the official elasticsearch docker image. When the container was started I was getting an "access denied" error from elasticsearch on /usr/share/elasticsearch/data/nodes so I tried addin... | <p>This particular docker image expects the data directory to be writable by uid <code>2000</code>. You can tell Kubernetes to chown (sort of) the mount point for your pod by adding <a href="https://kubernetes.io/docs/api-reference/v1.6/#podsecuritycontext-v1-core" rel="noreferrer"><code>.spec.securityContext.fsGroup</... |
<p>I am trying to create a service account with a known, fixed token used by Jenkins to deploy stuff into kubernetes. I manage to create the token all right with the following yaml: </p>
<pre><code>apiVersion: v1
kind: Secret
metadata:
name: integration-secret
annotations:
kubernetes.io/service-account.name: i... | <blockquote>
<p>Is it possible for example to define username/password for service accounts for API access?</p>
</blockquote>
<p>No, the tokens must be valid JWTs, signed by the service account token signing key.</p>
|
<p>I got Kubernetes Minikube on my laptop (4cores, 8 GB RAM). I just performed the basic installation steps (got <em>miniKube</em> and <em>kubectl</em>, enabled the BIOS virtualization) and I am able to start the cluster:</p>
<pre><code>C:\Users\me>minikube start
Starting local Kubernetes cluster...
Starting VM...
... | <p>I think it could be some problem with the cluster, when I run minikube status I've got the mixed results of cluster running and cluster stopped:</p>
<p>First run:</p>
<pre><code>c:\> minikube status
</code></pre>
<blockquote>
<p>minikube: Running</p>
<p>cluster: Stopped</p>
<p>kubectl: Correctly Co... |
<p>I am currently using Deployments to manage my pods in my K8S cluster.</p>
<p>Some of my deployments require 2 pods/replicas, some require 3 pods/replicas and some of them require just 1 pod/replica. The issue Im having is the one with one pod/replica.</p>
<p>My YAML file is :</p>
<pre><code>apiVersion: extensions... | <p>It appears to be the <code>maxUnavailable: 1</code>; I was able to trivially reproduce your experience setting that value, and trivially achieve the correct experience by setting it to <code>maxUnavailable: 0</code></p>
<p>Here's my "pseudo-proof" of how the scheduler arrived at the behavior you are experiencing:</... |
<p>I have a kubernetes setup running in google container engine. one of the k8s Service "type: LoadBalancer"... so i guess it created a Google Network Load Balancing. Now part of my billing
"Compute Engine Network Load Balancing" is way higher than my compute engine cost. Is there a way to eliminate "Network Load Bala... | <p>1) Deploy nginx-ingress-controller to kube-cluster:</p>
<pre><code>helm install --name my-lb stable/nginx-ingress --set controller.service.type=NodePort
helm list
kubectl get svc
</code></pre>
<p>This will create "my-lb-nginx-ingress-controller" - a custom nginx load balancer instead of gke-load-balancer(google's... |
<p>I have a container cluster in Google Container Engine with Stackdriver logging agent enabled. It is correctly pulling stdout logs from my containers. Now I would like to change the fluentd config to specify a log parser so that the logs shown in the GCP Logging view will have the correct severity and component.</p>
... | <p>Please take a look at the Prerequisites section on the <a href="https://kubernetes.io/docs/tasks/debug-application-cluster/logging-stackdriver#configuring-stackdriver-logging-agents" rel="noreferrer">documentation page you mentioned</a>. It's mentioned there, that on GKE you cannot change the default Stackdriver Log... |
<p>Kubernetes surfaces an API proxy, which allows querying the internal services via eg: <a href="https://myhost.com/api/v1/proxy/namespaces/kube-system/services/kubernetes-dashboard/" rel="nofollow noreferrer">https://myhost.com/api/v1/proxy/namespaces/kube-system/services/kubernetes-dashboard/</a></p>
<p>This is al... | <p>As documented at <a href="https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/#manually-constructing-apiserver-proxy-urls" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/#manually-constructing-apiserver-proxy-urls</a>, (and pointed out on s... |
<p>We are using Helm Charts for deploying a service in several environments on Kubernetes cluster. Now for each environment there are a list of variables like the database url, docker image tag etc. What is the most obvious and correct way of defining Helm related values.yaml in such case where all the Helm template fi... | <p>One way to do this would be using multiple value files, which helm now allows. Assume you have the following values files:</p>
<p>values1.yaml:</p>
<pre><code>image:
repository: myimage
tag: 1.3
</code></pre>
<p>values2.yaml</p>
<pre><code>image:
pullPolicy: Always
</code></pre>
<p>These can both be used... |
<p>I searched the documentation but I am unable to find out if I can run a pod in Kubernetes without Scheduler. If anyone can help with any pointers it would be helpful</p>
<p>Update:
I can attach a label to node and let pod stick to that label but that would involve going through the scheduler. Is there any method wi... | <p>The scheduler just sets the spec.nodeName field on the pod. You can set that to a node name yourself if you know which node you want to run your pod, though you are then responsible for ensuring the node has sufficient resources to run the pod (enough memory, free host ports, etc… all things the scheduler is normall... |
<p>Before posting this question I followed this answer <a href="https://stackoverflow.com/questions/30538210/how-to-mimic-volumes-from-in-kubernetes">How to mimic '--volumes-from' in Kubernetes</a> but it didn't work for me.</p>
<p>I have 2 containers:</p>
<ul>
<li><strong>node</strong>: its image contains al... | <p>I assume your assets are already packaged inside the image at <code>/var/www</code>. If you mount an <code>emptyDir</code> volume at that path, then everything there gets overriden with the content of the <code>emptyDir</code> volume - which initially is nothing. That means all your assets are deleted through that m... |
<p>Let's say a Istio enabled Service <code>A</code> exposes a port <code>8080</code> which is named <code>http</code> and as such Istio performs L7 load balancing when accessing it from inside of the mesh.</p>
<p>I'd like to know if there is a way to access this <code>8080</code> port from a pod/service <code>B</code>... | <p>If you have auth (mTLS) enabled it doesn't work, by design, as in that case Istio tries to protect all service to service communication.</p>
<p>You can turn auth off, and if that doesn't help, also try with the Istio 0.2.4 release candidate (or whichever is the latest at the time you read this, see <a href="https:/... |
<p>Can I use a custom kubernetes version in which I have made some code modifications? I wanted to use the <code>--kubernetes-version string</code> flag to use a customized kubernete localkube binary. It is possible??</p>
<p>Minikube documentation says: </p>
<pre><code>--kubernetes-version string The kubernetes... | <p>Two options come to mind:</p>
<ul>
<li><p>You can launch minikube with <code>--vm-driver=none</code>, so the binaries are installed in your local filesystem. Then replacing the binaries should not be a difficult process. </p></li>
<li><p>You can create your own minikube iso and then use the <code>--iso-url</code> f... |
<p>I set up a Kubernetes cluster with a master and 2 slaves on 3 bare-metal CentOS 7 server. I used kubeadm for that, following this guide: <a href="https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/" rel="nofollow noreferrer">https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/</a>
an... | <p>So, I resolved my issue. For anyone finding this post and having the same Problem:
In my case all UDP traffic between the nodes was blocked and just TCP was allowed. But DNS is handled via UDP, so this also has to be allowed.</p>
|
<p>I am a Kubernetes newbie. I am trying to setup a Kubernetes cluster on AWS using kops. I was successfully able to setup the cluster. However, I am not able to access the Dashboard UI. (<a href="https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/#accessing-the-dashboard-ui" rel="noreferrer">... | <p>Your using latest dashboard, looks like it required SSL certificate. try with 1.6.3 it will work with-out SSL cert.</p>
<p>I am running this version in my cluster.</p>
<pre><code>kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.6.3/src/deploy/kubernetes-dashboard.yaml
</code></pre>
<p><... |
<p>I'm a super beginner with Kubernetes and I'm trying to imagine how to split my monolithic application in different micro services.
Let's say i'm writing my micro services application in Flask and each of them exposes some endpoints like:</p>
<p>Micro service 1:</p>
<ul>
<li>/v1/user-accounts</li>
</ul>
<p>Micro s... | <ol>
<li>A load balancer is what you are looking for.</li>
<li>Kubernetes services will make your pods accessible under a given hostname cluster-internally.</li>
</ol>
<p>If you want to make your services accessible from outside the cluster under a single IP and different paths, you can use a load balancer and Kuberne... |
<p>I want to rename my k8s <code>Secrets</code> and want to check if there are unused <code>Secrets</code>. Also I would like to know how many and which <code>containers</code> reference a <code>Secret</code>.</p>
<p>Is there a easier way to do this than search for the secret names in all deployments?</p>
| <p>Thanks Simon. Based on your answer I created a diff, which shows <code>secrets</code> that are not referenced in the containers env section. <code>Secrets</code> can also be referenced in:</p>
<ul>
<li><code>TLS</code> section of Ingresses</li>
<li><code>Pods</code> <code>Volumes</code> spec, like Simon mentioned</l... |
<p>I have a pod with two containers. An application and a database. I have two replicas for the pod.</p>
<p>I want to expose the application port to be accessed outside the cluster and I do not want to expose the database port.</p>
<p>But I want to access the database port using DNS to balance the traffic.</p>
<p>I ... | <p>The answer is: No, you can not. </p>
<p>But you should still know that a Kubernetes Service of type <code>NodePort</code> will also allocate a Cluster IP to which the port will route. So if your wanted to publish both ports, a single Service would be sufficient to reach them internally via the name and externally v... |
<p>With what CA Certificate are the Kubernetes Service Account JWT tokens signed with? Is there a way to get the public key with which kubernetes service accounts are signed in GKE?</p>
| <p>You have no access to that key in GKE.</p>
<p>In general, the Service Account JWT tokens are signed with an RSA key by the controller manager. The key is specified by the <code>--service-account-private-key-file</code> for <code>kube-controller-manager</code>. (The public key is specified by the <code>--service-acc... |
<p>I have a kubernetes deployment in which I am trying to run 5 docker containers inside a single pod on a single node. The containers hang in "Pending" state and are never scheduled. I do not mind running more than 1 pod but I'd like to keep the number of nodes down. I have assumed 1 node with 1 CPU and 1.7G RAM will ... | <p>As you can see in the output of your <code>kubectl describe nodes</code> command under <code>Allocated resources:</code>, there is <code>728m (72%)</code> CPU and <code>700816Ki (40%)</code> Memory already requested by Pods running in the <code>kube-system</code> namespace on the node. The sum of resource requests ... |
<p>I am following this tutorial: <a href="https://cloud.google.com/container-engine/docs/tutorials/http-balancer" rel="nofollow noreferrer">https://cloud.google.com/container-engine/docs/tutorials/http-balancer</a>, but running it inside Minikube with <code>yml</code> files for each steps:</p>
<p><strong>Step 1: Deplo... | <p>I am assuming that you deployed the default nginx ingress controller by <code>minikube addons enable ingress</code>. The tutorial you followed is specifically for Google Container Engine, in those clusters there is a different ingress controller deployed which will create Google Cloud Load Balancers and is also capa... |
<p>I have a deployment with 2 containers inside a single pod (<strong>container-test2</strong> and <strong>cloudsql-proxy</strong>).</p>
<p><strong>container-test2</strong> runs a docker image which passes ["my_app", "arg1", "arg2"] as CMD. I would like to run several instances of this container with different argumen... | <ol>
<li><p>You can not make individual replicas run with different arguments, they would not be replicas as in "exact copy". If you want to run your application multiple times with different arguments, you need to use multiple deployments. </p></li>
<li><p>The containers of a replication run in their own Pod, e.g. the... |
<p>Say I have the following pod spec. </p>
<pre><code>apiVersion: apps/v1beta1
kind: Deployment
metadata:
# Unique key of the Deployment instance
name: deployment-example
spec:
# 3 Pods should exist at all times.
replicas: 3
template:
metadata:
labels:
# Apply this label to pods and default... | <p>The container name is not available trough the downward api. You can use <a href="http://www.yaml.org/spec/1.2/spec.html#alias//" rel="noreferrer">yaml anchors and aliases (references)</a>. Unfortunately they are not scoped so you will have to come up with unique names for the anchors - it does not matter what they ... |
<p>First I start Kubernetes using Flannel with <code>10.244.0.0</code>.</p>
<p>Then I reset all and restart with <code>10.84.0.0</code>.</p>
<p>However, the interface <code>flannel.1</code> still is <code>10.244.1.0</code></p>
<p>That's how I clean up:</p>
<pre><code>kubeadm reset
systemctl stop kubelet
systemctl s... | <p>Because your ip link have the old record</p>
<p>look by </p>
<p><code>ip link
</code>
you can see the record, and if you want to clean the record of old flannel and cni</p>
<p>please try</p>
<p><code>ip link delete cni0
ip link delete flannel.1
</code></p>
|
<p>I'm currently trying the Jenkins kubernetes plugin below, but have some problem.</p>
<p><a href="https://wiki.jenkins-ci.org/display/JENKINS/Kubernetes+Plugin" rel="noreferrer">https://wiki.jenkins-ci.org/display/JENKINS/Kubernetes+Plugin</a></p>
<p>In my case, Jenkins doesn't exist in my kubernetes cluster. This ... | <p>1、prepare a service account for kubernetes-plugin in k8s</p>
<pre><code>apiVersion: v1
kind: ServiceAccount
metadata:
name: jenkins
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: jenkins
rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["create","delete","get","list","patch"... |
<p>I created a namespace called <code>qc</code> for qc environment.</p>
<pre><code>apiVersion: v1
kind: Namespace
metadata:
name: {{ .Values.namespace.name | quote }}
</code></pre>
<p><code>kubectl create -f namespace.yaml</code></p>
<p>But I can delete this namespace anytime by running <code>kubectl delete namesp... | <p>You do not want disable deletion of Namespaces for your kubernetes-admin user, although it could be possible. If there are other people or services interacting with your cluster, you need to define Users and/or Service Accounts for them and bind Cluster Roles to them, whitelisting their permissions. Have a look at <... |
<p>I have setup a Kubernetes cluster with flannel network on bare metal. I have a service deployed and running in the cluster. The service would broadcast to discover the other end devices in the same subnet. </p>
<p>The problem is that the client agents which receives the broadcasts are running on resource-constraine... | <p>I ended up making the host and pods running in the same subnet by adding <code>hostNetwork: true</code> in pod configuration. In that case, containers are using host network. Inspired from <a href="https://github.com/kubernetes/kubernetes/issues/19171" rel="nofollow noreferrer">here</a></p>
<p>The configuration lo... |
<p>I'm trying to use the Jenkins/Kubernetes plugin to orchestrate docker slaves with Jenkins. </p>
<p>I'm using this plugin: <a href="https://github.com/jenkinsci/kubernetes-plugin" rel="noreferrer">https://github.com/jenkinsci/kubernetes-plugin</a></p>
<p>My problem is that all the slaves are offline so the job can... | <p>I just want to add a bit more explanation to the above answers for newbies.</p>
<p>While exposing the jenkins UI, you also need to expose internal port 50000
Here is a simple service for a jenkins deployment:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: jenkins
namespace: jenkins
spec:
type: N... |
<p>I'd like to implement an application for transformation of some data in Kubernetes. The application contains a chain of logical operators.</p>
<p>A --- records R1 ---> B --- records R2 ---> C</p>
<ul>
<li>The operator "A" generates records "R1" and passes them to the
operator "B" (it's not important how the operat... | <p>That really depends on how you pass data between services. Are they pushing data up or pulling? Or do they store to some persistent storage? How many requests/records are passing the system and what is their size?</p>
<p>All in all, IMO you should implement each service (A/B/C) as a separate Pod/Deployment. Then yo... |
<p>I am new to Kubernetes</p>
<p>The goal is to get Kubernetes cluster dashboard working</p>
<p>The Kubernetes cluster was deployed using Kubespray: <a href="https://github.com/kubernetes-incubator/kubespray" rel="noreferrer">github.com/kubernetes-incubator/kubespray</a></p>
<p>Versions:</p>
<pre><code>Client Versi... | <p>you may be installing dashboard version 1.7. try installing version 1.6.3 its well tested.</p>
<pre><code>kubectl create clusterrolebinding add-on-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default
kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.6.3/src/deplo... |
<p>Using <a href="https://github.com/Yolean/kubernetes-kafka" rel="noreferrer">kubernetes-kafka</a> as a starting point with minikube.</p>
<p>This uses a StatefulSet and a <a href="https://github.com/Yolean/kubernetes-kafka/blob/master/20dns.yml" rel="noreferrer">headless service</a> for service discovery within the c... | <p>We have solved this in 1.7 by changing the headless service to <code>Type=NodePort</code> and setting the <code>externalTrafficPolicy=Local</code>. This bypasses the internal load balancing of a Service and traffic destined to a specific node on that node port will only work if a Kafka pod is on that node.</p>
<pre... |
<p>I have an nginx pod deployed in my kubernetes cluster to serve static files. In order to set a specific header in different environments I have followed the instructions in the <a href="https://github.com/docker-library/docs/tree/master/nginx#using-environment-variables-in-nginx-configuration" rel="nofollow noreferr... | <p>I am pretty sure <code>envsubst</code> is biting you by making <code>try_files $uri $uri/ /index.html;</code> into <code>try_files / /index.html;</code> and <code>return 301 https://$host$request_uri;</code> into <code>return 301 https://;</code>. This results in a loop of redirections.</p>
<p>I suggest you run <c... |
<p>I have a Kubernetes 1.7.5 cluster which has somehow gotten into a semi-broken state. Scheduling a new deployment on this cluster partially fails: 1/2 pods starts normally, but the second pod does not start. The events are:</p>
<pre><code>default 2017-09-28 03:57:02 -0400 EDT 2017-09-28 03:57:02 -0400 EDT 1 ... | <p>This is a bug with Azure CNI not always correctly recycling IP addresses from terminated pods. See this issue: <a href="https://github.com/Azure/azure-container-networking/issues/76" rel="nofollow noreferrer">https://github.com/Azure/azure-container-networking/issues/76</a>.</p>
<p>The reason this occurred after en... |
<p>I'm looking for an efficient and easy way to adapt my current Theano model so it can scale for prediction. I'm also looking for a way to easily train lots of models with different parameters.</p>
<p>It's seems that there is two main ways to do it. The first is to use Spark and the second is to use Docker and Kubern... | <p>That is two thing between Kuberbetes and Spark,
Kubernets is a Paas, it provide you the platform to run your application,
Spark is used to run your algorithm and compute distributed ,but you need to build Spark in a cluster
So kubernetes can help you to do this things</p>
<p>How to build Spark with kubernetes? You ... |
<p>When using a self hosted kubeadm in ubuntu, I could not access other pods and external network from within k8s pod but am able to access using regular docker containers.</p>
<p>I tried with different types of pod network including calico, weave and flannel.</p>
<p>I followed the debugging instructinos from <a href... | <p>Maybe it is your iptable has old record ,because i think you use kubeadm reset or setting maybe overlay network before,
Please do this thing after kubeadm reset and remove docker </p>
<p>check your ip link
<code>
ip link
</code>
and clean the old record</p>
<p><code>
ip link delete cni0
ip link delete flannel.1
</... |
<p>Is it possible to take a pod out of rotation to debug some issue? or ability to create a pod from same replication controller without letting it serve live traffic</p>
| <p>I find the best solution is to take a Pod that was created by the controller and change the labels on it in a way that it is excluded from the Service(s). The controller will spawn another Pod to replace the now missing one.</p>
<pre><code>kubectl label pod mypod app- myotherlabel- debug=true
</code></pre>
|
<p>What I'm trying to do is using Celery with Kubernetes. I'm using Redis as the message broker in a different pod and I have multiple pods for each queue of Celery.</p>
<p>Imagine if I have 3 queues, I would have 3 different pods (i.e workers) that can accept and handle the requests. </p>
<p>Everything is working fi... | <p>I guess you are using basic task type, which employs 'direct' queue type, not 'fanout' or 'topic' queue, the latter two have much difference, which will not be discussed here.</p>
<p>While using Redis as broker transport, celery/kombu use a Redis <code>list</code> object as a storage of queue (<a href="https://git... |
<p>I'm working on a way to discover trafic between Kubernetes Services and to monitor it ?
Does someone know how can I achieve that ?</p>
<p>Where I can for example find this kind of metrics or events ?</p>
<p>Thank you in advance</p>
| <p>If you are using <code>kube-proxy --proxy-mode iptables</code> (which is a default by the time of writing) then you can use <a href="https://github.com/aabc/ipt-netflow" rel="nofollow noreferrer">Netflow iptables module</a>.</p>
<p>Or if you need to debug something ad-hoc then just <code>grep <service_ip> /pr... |
<p>I have installed minikube on a server which I can access from the internet.</p>
<p>I have created a kubernetes service which is available:</p>
<pre><code>>kubectl get service myservice
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
myservice 10.0.0.246 <nodes> 80:31988/TCP 14h
</cod... | <h1>Setup</h1>
<p>First of all, you need a <a href="https://github.com/kubernetes/ingress-nginx" rel="nofollow noreferrer">nginx ingress controller</a>. </p>
<p>The nginx instance(s) will listen on host 80 and 443 port, and redirect every HTTP request to services which ingress configuration defined, like this.</p>
<... |
<p>Flannel running in a pod is getting the wrong subnet and networking is just not happy, the symptom is flannel is being assigned /24's from the 10.105.0.0/16. it should be assigning /26's from 10.105.5.128/21. Thanks for any help. </p>
<p>here are the details:</p>
<pre><code>/usr/bin/kubeadm init \
--kubernetes-ve... | <p>Did you do kubeadm reset before?
If yes, please check ip link by use
<code>ip link</code></p>
<p>and check if the flannel network is right,
if not,
please use
<code>
ip link delete cni0
ip link delete flannel.1
</code>
to clean you network setting </p>
<p>Good luck!</p>
|
<p>I setup a kubernetes cluster on Windows machine with Virtual Box . I have 4 Guest CentOS 7 systems running. I have setup the cluster using <a href="https://kubernetes.io/docs/getting-started-guides/centos/centos_manual_config/" rel="nofollow noreferrer">https://kubernetes.io/docs/getting-started-guides/centos/centos... | <p>Check your kubectl version</p>
<p>I also faced the same problem with the latest build, and then installed the old version of dashboard.</p>
<p>kubectl create -f <a href="https://raw.githubusercontent.com/kubernetes/dashboard/v1.5.1/src/deploy/kubernetes-dashboard.yaml" rel="nofollow noreferrer">https://raw.githubu... |
<p>I need small persistent volumes of around 50 Mb for my pods/containers.
I'm using gce persistent disks as persistent storage for google container engine but I can't create disks smaller than 1 GB</p>
<p>I've created the disk:</p>
<pre><code> gcloud compute disks create disk2 --size=1 --zone=us-central1-a
</code><... | <p>Google Cloud Platform doesn't support smaller sizes no matter what you do, unfortunately.</p>
<p>As for k8s side, no you can't partition the disk (a volume is supposed to be directly mountable, so GCE-PD provider gives you single volume back), and even then GCP doesn't support multiple writers to single volume, eve... |
<p>I have docker container (Hadoop installation <a href="https://github.com/kiwenlau/hadoop-cluster-docker" rel="nofollow noreferrer">https://github.com/kiwenlau/hadoop-cluster-docker</a>) that I can run using <code>sudo docker run -itd -p 50070:50070 -p 8088:8088 --name hadoop-master kiwenlau/hadoop:1.0</code> command... | <p>The equivalent command in kubernetes is</p>
<pre><code>kubectl run -it hadoop-master --image=kiwenlau/hadoop:1.0 --port=8088 --port=50070
</code></pre>
<p>Actually it's not about kubernetes, there is something wrong in the Dockerfile.</p>
<p><a href="https://stackoverflow.com/a/28214133/692076">A docker container... |
<p>I am trying to run a <a href="https://nixos.org/nixpkgs/manual/#ssec-pkgs-dockerTools-buildImage" rel="nofollow noreferrer">Nix-built</a> Docker image in tarball form. With docker, <code>docker load -i <path></code> followed by a <code>docker run</code> works fine. Now I've uploaded the tarball to Artifactory ... | <p>There is no way to do that directly in Kubernetes.</p>
<p>You can do <code>docker load</code> and then <code>docker push</code> to a registry (you can host a <a href="https://github.com/kubernetes/kubernetes/blob/master/cluster/addons/registry/README.md" rel="nofollow noreferrer">private registry</a> in Kubernetes ... |
<p>Kubernetes features quite a few types of volumes, <a href="https://kubernetes.io/docs/concepts/storage/volumes/#types-of-volumes" rel="noreferrer">including <code>emptyDir</code></a>:</p>
<blockquote>
<p>An <code>emptyDir</code> volume is first created when a Pod is assigned to a Node, and exists as long as that Pod... | <p>Yes it is also accessible on the node. It is bind mounted into the container (sort of). The source directories are under <strong><code>/var/lib/kubelet/pods/PODUID/volumes/kubernetes.io~empty-dir/VOLUMENAME</code></strong></p>
<p>You can find the location on the host like this:</p>
<pre><code>sudo ls -l /var/lib/k... |
<h1>AWS CloudWatch Logs in Docker</h1>
<p>Setting an AWS CloudWatch Logs driver in <code>docker</code> is done with <code>log-driver=awslogs</code> and <code>log-opt</code>, for example -</p>
<pre><code>#!/bin/bash
docker run \
--log-driver=awslogs \
--log-opt awslogs-region=eu-central-1 \
--log-opt awsl... | <p>From what I understand, Kubernetes prefer Cluster-level logging to Docker logging driver.</p>
<p>We could use <a href="http://fluentd.org" rel="noreferrer">fluentd</a> to collect, transform, and push container logs to CloudWatch Logs.</p>
<p>All you need is to create a fluentd DaemonSet with ConfigMap and Secret. ... |
<p>I am new to kubernetes and google cloud and I need some help.</p>
<p>We have a pod with a single container runing in kubernetes in gke. There are logging messages that the container sends to its stdout and also some logging messages that it write into few log files in its storage.</p>
<p>The log messages sent to t... | <p>You don't need to create any symbolic links. It is enough to mount the volume in your main container so that it writes to mounted volume directly. The page you linked describes exactly that. Try using following snippet (<a href="https://raw.githubusercontent.com/kubernetes/kubernetes.github.io/master/docs/concepts/c... |
<p>I want delete label from a node or a pod by kubernetes API, my kubernetes version:1.24</p>
<pre><code>kubectl get pod --show-labels | grep all-flow-0fbah
all-flow-0fbah 1/1 Running 2 9d app=all-flow,op=vps1,version=1001
</code></pre>
<p>I use command as below:</p>
<pre><code> curl --request... | <p>Was looking for CLI command myself. Here is what worked for me:</p>
<pre><code>kubectl patch pod <podname> --type=json -p='[{"op": "remove", "path": "/metadata/labels/somelabelkey"}]'
</code></pre>
|
<p>I have a cluster on google cloud container engine with 6 <code>n1-standard-1</code> machine.</p>
<p>I deployed several services and pod on this cluster and sometime they fail with the only reason <code>FailedSync</code> and no more explanation, I have no idea why they fail. Virtual machine are not overloaded, only ... | <p>I think the best way to find out the issue is just ssh to the node and use <code>sudo docker logs $CONTAINER_Id</code> to see what happened to your applications.</p>
<p>You can tell on what nodes your applications are deployed to by <code>kubectl describe po $PO_NAME</code> or simply <code>kubectl get po -o wide</c... |
<p>In this <a href="https://github.com/kubernetes/ingress/blob/master/examples/deployment/nginx/nginx-ingress-controller.yaml" rel="nofollow noreferrer">example</a> on the <a href="https://github.com/kubernetes/ingress" rel="nofollow noreferrer">Kubernetes Ingress git repo</a>, I see that the default-backend service an... | <p><code>kube-system</code> is just a namespace as any other. It is usualy created by default though, and most people put cluster related stuff in it. Although ie. you will fine a <code>kubernetes.default</code> service anyway.</p>
|
<p>I have deployed our kubernetes cluster in AWS using the kube-up scripts and ec2 instances. Can someone help me in figuring out how to upgrade this cluster to 1.5.8 or to the latest kubernetes release.</p>
| <p>The way I gained confidence about the kind of upgrade you are describing is by setting up a Vagrant cluster of 1.5 api and nodes against the etcd:2 servers that were used at the time of 1.5, and then practice upgrading them to understand the moving parts and ways it can go foul.</p>
<p>Your use of <code>kube-up</co... |
<p><a href="https://i.stack.imgur.com/Ioq1w.png" rel="nofollow noreferrer">Docker daemon in minikube</a></p>
<p>When I do </p>
<pre><code>docker version
</code></pre>
<p>I have </p>
<pre><code>Error response from daemon: client is newer than server (client API version: 1.24, server API version: 1.23)
</code></pre>
... | <p>I cannot reproduce the issue with the newest minikube image and the latest docker installation. I think that the cause is that you are using an old version of minikube. Could you check that?</p>
<pre><code> 2017-10-04 17:17:34 ⌚ ip-192-168-200-196 in ~
○ → eval $(minikube docker-env)
2017-10-04 17:17:36 ⌚ ip-19... |
<p>I'm attempting to create a Kubernetes CronJob to run an application every minute. </p>
<p>A prerequisite is that I need to get my application code onto the container that runs within the CronJob. I figure that the best way to do so is to use a persistent volume, a pvclaim, and then defining the volume and mounting ... | <p>A <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#cronjob-v1beta1-batch" rel="noreferrer">CronJob</a> uses a PodTemplate as everything else based on Pods and can use Volumes. You placed your Volume specification directly in the CronJobSpec instead of the <a href="https://kubernetes.io/d... |
<p>I'm trying to dig into Rancher, and was wondering if having Rancher plugged in with Kubernetes has any additional benefits over Cattle which is Rancher's in home orchestration framework. So far, I haven't been able to figure out why someone would opt for Rancher with Kubernetes. Does it only help ease out the initia... | <p>There is now a very good answer to this. Rancher just moved 100% into Kubernetes by announcing Rancher 2.0: <a href="http://rancher.com/announcing-rancher-2-0/" rel="noreferrer">http://rancher.com/announcing-rancher-2-0/</a>. It does not use Cattle anymore.</p>
|
<p>I am creating a long-lived jump to run inside of my kubernetes cluster. It uses an EBS volume for the home folder, holds important copies of my code, and gives me fast access for routine behavior. The problem is that I can't use GNU <code>screen</code> to create similarly long-lived sessions.</p>
<p>Here's my Docke... | <p>I tried this with centos image it works, need to check the ubuntu image.</p>
<pre><code>kubectl run -it screentest --image=centos -- bash
kubectl exec -it screentest-cbd49447f-286wq -- bash
yum -y install screen
screen
</code></pre>
<p>Tested this in ubuntu also, it works for me.</p>
<pre><code>kubectl run -it u... |
<p>I am getting "partner is not a Perforce client/server" when using ingress to route the service, but I am able to directly query the perforce server in the Kubernetes cluster. </p>
<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress-notls
namespace: default
annotations:
kubernet... | <blockquote>
<p>Peer address: 10.4.0.218:49924</p>
</blockquote>
<p>looks suspiciously like a bi-directional protocol, meaning that client and server expect to have unfettered access to one another, ala (non-passive mode) ftp</p>
<p><code>
http:
paths:
- path: /*
</code></p>
<p>I don't believe that... |
<p>I would like to know, what's the best practice to handle configs for a Java App in Kubernetes?
I have seen some examples with System variables in the yaml file. Or is there a "better" approach with java property files?</p>
<p>Is there also a way to let different instances of a pod use different configurations?</p>... | <p>There is no canonical solution, it depends from case to case</p>
<p>If you have one or a few parameters passing them as environment variables would be ok.</p>
<p>In case if you have many parameters (lets say you have different set of parameters for production and for test environment) it is more convenient to gath... |
<p>Lets say, you need to run a custom app listening on a fixed port on every worker node?, like a monitoring agent, here's my POC for the case:</p>
<pre><code>apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: monitor
spec:
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable... | <p>There is an issue about hostPort when CNI is used, you can find informative discussion in this <a href="https://github.com/kubernetes/kubernetes/issues/23920" rel="nofollow noreferrer">GitHub issue</a>.</p>
<p>Other then that, you might also look into <code>hostNetwork: true</code> as a workaround.</p>
|
<p>I have a Go struct for which I want to generate an OpenAPI schema automatically. Once I have an OpenAPI definition of that struct I wanna generate JSONSchema of it, so that I can validate the input data that comes and is gonna be parsed into those structs.</p>
<p>The struct looks like the following:</p>
<pre><code... | <p>You can use <a href="https://github.com/kubernetes/kube-openapi" rel="nofollow noreferrer">kube-openapi</a> package for this. I am going to add a sample to the repo but I've tested this simple model:</p>
<pre><code>// Car is a simple car model.
// +k8s:openapi-gen=true
type Car struct {
Color string
Capa... |
<p>I have a kubernetes service running on Azure. After the deployment and service are created, the service publishes an External-IP address and I am able to access the service on that IP:Port.</p>
<p>However, I want to access the service through a regular domain name. I know that the kubernetes cluster running on Azur... | <p>In Azure, you can use the "Public IP addresses" resource and associate public Ip that is being used by your service, to a DNS name under the default Azure DNS Namespace : <code>.location.couldapp.azure.com</code>.
eg: <code>demo.k8s.service.centralindia.couldapp.azure.com</code></p>
<p>Note: The Dns record should b... |
<p>I am trying to automate kubernetes worker nodes using the official <a href="https://github.com/kubernetes-incubator/client-python" rel="noreferrer">kubernetes python-client</a>. I am currently looking for a way to <a href="https://kubernetes.io/docs/tasks/administer-cluster/safely-drain-node/" rel="noreferrer">safel... | <p>I found the answer. Python client does have support for draining a node but it is not a single command. "kubectl drain" operation utilizes <a href="https://kubernetes.io/docs/tasks/administer-cluster/safely-drain-node/#the-eviction-api" rel="noreferrer">Eviction API</a> to safely delete all the workloads running on ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.