prompt stringlengths 65 38.7k | response stringlengths 41 29.1k |
|---|---|
<p>I'm having an issue where because an application was originally configured to execute on docker-compose.
I managed to port and rewrite the .yaml deployment files to Kubernetes, however, the issue lies within the communication of the pods. </p>
<p>The frontend communicates with the backend to access the services, an... | <p>Yes, you just add entries to the <code>containers</code> section in your yaml file, example:</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
name: two-containers
spec:
restartPolicy: Never
containers:
- name: nginx-container
image: nginx
- name: debian-container
image: debian
</code></pre>... |
<p>I got an issue when I try to access an exposed <code>kubernetes</code> service through browser. Below is my Environment.</p>
<p>created two <code>ubuntu</code> EC2 instances(with all ports open in security group) and installed all kubernetes related tools like kubectl, kubeadm, docker, calico network.</p>
<p>creat... | <p>How did you create your cluster? <code>kubeadm</code>? You need some custom configs for your cluster to run with AWS. For example your <code>kube-controller-manager</code> and <code>kube-apiserver</code> need to have the option <code>--cloud-provider=aws</code>. Same for all your kubelets. </p>
<p>I'd recommend ... |
<p>I have an installer that spins up two pods in my CI flow, let's call them web and activemq. When the web pod starts it tries to communicate with the activemq pod using the k8s assigned amq-deployment-0.activemq pod name. </p>
<p>Randomly, the web will get an unknown host exception when trying to access amq-deployme... | <p>Is it possible that it is a question of which pod, and the app in its container, is started up first and which second?</p>
<p>In any case, connecting using a <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">Service</a> and not the pod name would be recommended as ... |
<p>I have a Spring application built into a Docker image with the following command in <code>dockerfile</code></p>
<pre><code>CMD cd /opt/app/jar \
&& java -Dspring.config.location=file:/opt/app/config/ -Dspring.profiles.active=test -jar *.jar
</code></pre>
<p>When creating app on OpenShift with </p>
<pr... | <p>Is it possible that it is an issue with permissions?</p>
<p>Unless something has changed...for better security OpenShift by default runs containers using a user with random UID; that user is a member of the root group.</p>
<p>So, in addition to the command @Rico suggested to be added to Dockerfile, I would add:</p... |
<p>(While learning Kubernetes I never really found any good resources explaining this)</p>
<p>Scenario: <br>
I own mywebsite1.com and mywebsite2.com and I want to host them both inside a Kubernetes Cluster. <br><br></p>
<p>I deploy a generic cloud ingress controller according to the following website with 2 <br>... | <p>I convert 2 certificates to 2 .key and 2 .crt files <br>
I use those files to make 2 TLS secrets (1 for each website so they'll have HTTPS enabled) <br> <br>
I create 2 Ingress Objects:</p>
<ul>
<li><p>one that says website1.com/, points to a service called website1fe, and references website1's HTTPS/TLS certificate... |
<p>I'm working on a python script for update the configmaps programmatically.</p>
<p>Example script at shown as below. </p>
<pre><code>import requests
headers = {"Content-Type": "application/json-patch+json"}
configData = {
"apiVersion": "v1",
"kind": "ConfigMap",
"data": {
"test2.load": "testimtest"
},
"metadat... | <p>I suggest you use a Kubernetes client library, instead of making the raw HTTP calls yourself. Then you don't need to figure out the low-level connection stuff, as the library will abstract that away for you.</p>
<p>I've been using <a href="https://github.com/kelproject/pykube" rel="nofollow noreferrer">Pykube</a>, ... |
<p>I'm having difficulties getting my Ingress controller running on Google Container Engine. I want to use an NGINX Ingress Controller with Basic Auth and use a reserved global static ip name (this can be made in the External IP addresses section in the Google Cloud Admin interface). When I use the gce class everything... | <p>I found a solution with helm.</p>
<pre><code>helm install --name nginx-ingress stable/nginx-ingress \
--set controller.service.loadBalancerIP=<YOUR_EXTERNAL_IP>
</code></pre>
<p>You should use the <code>external-ip</code> and not the name you gave with gcloud.</p>
<p>Also, in my case I also added <cod... |
<p>I am deploying a stateful application in K8S.</p>
<p>Before that Im trying to implement an example.</p>
<p>Before deploying my-sql in my cluster, I have created a pv and a pvc.</p>
<pre><code>kind: PersistentVolume
apiVersion: v1
metadata:
name: mysql-pv-volume
labels:
type: local
spec:
storageClassName... | <p>Minikube is a Virtual Machine (VM) based all-in-one solution. So you have one node where the entire control plane lives and also this is your only worker node as well:</p>
<pre><code>$ kubectl get node
NAME STATUS ROLES AGE VERSION
minikube Ready master 1d v1.10.0
</code></pre>
<p>Now, it's one n... |
<p>We successfully integrated 'service-locator-dns' in Lagom and deployed in Kubernetes, All services in the Lagom project are properly resolving with Kubernetes SRV requests.</p>
<p>But even statically defined(in build.sbt) non-lagom projects also go through <code>name-translators</code> and <code>srv-translators</co... | <p>For locating Non-Lagom/Third Party Service in Lagom on Kubernetes, we have to use Lagom's service locator. Like this:</p>
<pre><code>lagom.services {
"premium-calculator" = "https://test.in"
}
</code></pre>
<p>Also, we have to use <code>ConfigurationServiceLocator</code> to locate the service:</p>
<pre><code>if... |
<p>I have a docker image from I am doing </p>
<pre><code>docker run --name test -h test -p 9043:9043 -p 9443:9443 -d ibmcom/websphere-traditional:install
</code></pre>
<p>I am trying to put into a kubernetes deploy file and I have this: </p>
<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name... | <p>You can add as many ports as you need.</p>
<p>Here your <code>deployment.yml</code>:</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: websphere
spec:
replicas: 1
template:
metadata:
labels:
app: websphere
spec:
containers:
- name: websphere
... |
<p>Could someone explain the benefits/issues with hosting a database in Kubernetes via a persistent volume claim combined with a storage volume over using an actual cloud database resource? </p>
| <p>It's essentially a trade-off: convenience vs control. Take a concrete example: let's say you pay Amazon money to use <a href="https://aws.amazon.com/athena/" rel="nofollow noreferrer">Athena</a>, which is really just a nicely packaged version of <a href="https://prestodb.io/" rel="nofollow noreferrer">Facebook Prest... |
<p>I'm getting the node IP address instead of the client IP. Is it possible to get the client IP with a service of type <code>LoadBalancer</code>? Or will I need to use a ingress controller?</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: app-svc
labels:
name: app-svc
environment: dev
spec:
t... | <p>You do not need any Ingress controller. However it is required to set the value of the <code>spec.externalTrafficPolicy</code> Service field to "Local" (the default is "Cluster") in Microsoft Azure.</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: my-service
spec:
type: LoadBalancer
externalTraffic... |
<p>I'm new with service mesh thing, so I did some PoC of basic implementation of microservices in kubernetes with istio. </p>
<p>I have 2 Deployments which is supposed to be talking to each other using gRPC. When I call the grpc server it returned error <code>rpc error: code = Internal desc = server closed the stream ... | <p>Quoting Istio <a href="https://istio.io/docs/setup/kubernetes/spec-requirements/" rel="nofollow noreferrer">docs</a>, </p>
<blockquote>
<p>Service ports must be named. The port names must be of the form {protocol}[-{suffix}] with http, http2, grpc, mongo, or redis as the in order to take advantage of Istio’s rou... |
<p>currently i used docker-compose to arrange my application that consists of 3 dockerimages - a postgresql database and 2 wildfly application servers (Frontend-ui, backend).</p>
<p>My <strong>docker-compose.yml</strong> looks like this:</p>
<pre><code>version: '3.0'
services:
my-webgui-service:
image: test/myw... | <p>Yes it's possible, simply separate the different resources such as deployments, services, etc. with <code>---</code>. Concerning if it's a good practice or not: a matter of taste, rather. If you have all in one file it's more self-contained but for <code>kubectl apply -f</code> it doesn't really matter since it oper... |
<p>I am using helm to deploy StatefulSet, below is yaml</p>
<pre><code>---
kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
name: {{ .Values.database.mongo.storageClassName }}
labels:
for: for-mongo-statefulset
provisioner: kubernetes.io/gce-pd
parameters:
type: pd-ssd
reclaimPolicy: Retain
--... | <p>The reclaim policy listed in the StorageClass object is used for the persistent volumes not the storage class it self. Meaning that the pvs and pvcs that are created using that storage class will inherit the reclaim policy set in the storage class.</p>
<p>You can find more info on that here: <a href="https://kubern... |
<p>Is it possible to tell Kubernetes to just throw away my current pod and recreate it again every 48 hours? Is there some type of a scheduler on Google Cloud Kubernetes? Or can I just configure my deployment this way?
I have a Node.js application containerized with Docker running inside of a Kubernetes cluster on Goog... | <p>True "Kubernetes way" to resolve this issue - is to design <code>ReadinessProbe</code>/<code>LivenessProbe</code> for your app's deployment/statefulset/pod. Once your <code>Pod</code> fall down correct probes will handle it and your <code>Pod</code> will be recreated fully automatically</p>
<p>P.S: you are the one ... |
<p>my pvc.yaml</p>
<pre><code>kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: database-disk
labels:
stage: production
name: database
app: mysql
spec:
accessModes:
- ReadWriteOnce
volumeMode: Filesystem
resources:
requests:
storage: 2Gi
</code></pre>
<p>when i ran <code>k... | <p>Did you create any PV in your cluster? </p>
<p>PV and Storage classes on local clusters should be done manually by cluster admin.</p>
<p>Check out <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/" rel="noreferrer">Kubernetes documentation</a> for the details:</... |
<p>So this is my current setup. </p>
<p>I have a k8 cluster with nginx controller installed. I installed nginx using helm. </p>
<p>So I have a simple apple service as below:</p>
<pre><code>kind: Pod
apiVersion: v1
metadata:
name: apple-app
labels:
app: apple
spec:
containers:
- name: apple-app
im... | <p>I've tested your configuration, and it seems to be working fine to me.</p>
<p>Pod responds fine:</p>
<pre><code>$ kubectl describe pod apple-app
Name: apple-app
Namespace: default
Node: kube-helm/10.156.0.2
Start Time: Mon, 10 Sep 2018 11:53:57 +0000
Labels: app=apple
Annotations: <... |
<p>What does AWS' Elastic Kubernetes Service (EKS) <strong>do exactly</strong> if so much configuration is needed in CloudFormation which is (yet) another AWS service?</p>
<p>I followed the AWS EKS Getting Started in the docs at (<a href="https://docs.aws.amazon.com/eks/latest/userguide/eks-ug.pdf" rel="nofollow noref... | <p>To run Kubernetes on AWS you have basically 2 options:</p>
<ul>
<li>using kops, it will create Master nodes + workers node under the hood, in plain EC2 machines</li>
<li>EKS + Cloudformation workers stack (you can use also Terraform as an alternative to deploy the workers, or eksctl, that will create both the EKS c... |
<p>I am using Kubernetes Service of type Cluster IP, which will expose a deployment.
In my container I want to use the Service IP (cluster IP). Is there any way I can get the IP Address inside the Pod/container? </p>
<p>Is it possible to get the cluster IP from Service name?</p>
| <p>Yes, via the <a href="https://kubernetes.io/docs/concepts/services-networking/service/#discovering-services" rel="nofollow noreferrer">environment-level service discovery</a> mechanism. Note, however that any service that you want to access like this must be created <strong>before</strong> the pod itself has been la... |
<p>I have a server running on Kubernetes to handle hourly processing jobs. Thinking of using a service to expose the pods, and using an (external) cron job to hit the load balancer so that kubernetes can autoscale to handle the higher load as required. However in implementation, if the cron job sends, say, 100 requests... | <p>If you're looking for serverless-style instant scale-up, something like <a href="https://github.com/knative/" rel="nofollow noreferrer">https://github.com/knative/</a> might be something you can use on top of Kubernetes/GKE.</p>
<p>Other than that, the only way to scale up pods on Kubernetes today is the Horizontal... |
<p>As far as I can see, GKE seems to be slighty more complex to configure and deploy an application (using Kubernetes direct files or Helm Charts or something else ?). Furthermore it seems to have no better pod failure detection or better performances ?</p>
<p>Why should we use GKE whereas there is GAE which only need... | <p>Google Kubernetes Engine(GKE) is a cluster manager and orchestration system for running your Docker containers. Google App Engine(GAE) is basically google managed containers. </p>
<p>They both try to provide you similar main benefits(scalability, redundancy, rollouts, rollbacks, etc.). <strong>The main difference i... |
<p>when i am trying to test the configuration of kubectl</p>
<pre><code>kubectl get svc
</code></pre>
<p>i am getting this</p>
<blockquote>
<p>error: the server doesn't have a resource type "svc"</p>
</blockquote>
<p>when I try this command</p>
<pre><code>kubectl get services
</code></pre>
<p>i am getting e... | <p>Make a copy of the config file and resolve this issue:</p>
<pre><code>sudo mkdir ~/.kube
sudo cp /etc/kubernetes/admin.conf ~/.kube/
cd ~/.kube
sudo mv admin.conf config
sudo service kubelet restart
</code></pre>
|
<p>I've setup prometheus to collect metrics from my pods and nodes.
I've also setup the prometheus custom metrics adapter.</p>
<p>How can I use those metrics provided by prometheus to autoscale my pods ? I tried to google it but I only find custom pods that provides their metrics on their /metrics url. I would like to... | <p>You need to create an HPA (Horizontal Pod Autoscaler)</p>
<p>More info <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-multiple-metrics" rel="nofollow noreferrer">here</a></p>
<p><a href="https://github.com/stefanprodan/k8s-prom-hpa" rel="nofollow noreferrer">This is... |
<p>I am using <a href="https://github.com/kubernetes-sigs/kubebuilder" rel="nofollow noreferrer">kubebuilder</a> to create kubernetes operator project. After running the project init command described in <a href="https://book.kubebuilder.io/quick_start.html" rel="nofollow noreferrer">quickstart guide</a></p>
<pre><cod... | <p>Try using the latest <code>kubebuilder</code> from <a href="https://github.com/kubernetes-sigs/kubebuilder/releases" rel="nofollow noreferrer">here</a>. It's likely that the dependencies for the version in the quick start are out of date.</p>
<p>It works fine for me with <code>v1.0.3</code></p>
<pre><code>~/go/sr... |
<p>This is now the fourth time I set up a kubernetes cluster. It's always the same setup: basic k8s, traefik as reverse proxy, dashboard, prometheus, elk-stack. But this time something with the traefik deployment is odd...</p>
<p>So for all other clusters I just deployed my default setup with some rbac entries, a conf... | <p>I managed to fix the problem:</p>
<p>The problem was a faulty iptables FORWARD policy, that is set by newer docker engines: <a href="https://github.com/moby/moby/issues/35777" rel="nofollow noreferrer">https://github.com/moby/moby/issues/35777</a></p>
<p>Currently we have a workaround, that is steadily setting the... |
<p>I am trying to deploy minio in kubernetes using helm stable charts,
and when I try to check the status of the release </p>
<ul>
<li>helm status minio</li>
</ul>
<p>the pod desired capacity is 4, but current is 0
I tried to look the journalctl logs for any logs from kubelet, but found none
I have attached all hel... | <p>I suspect you are not getting the physical volume. Check your <code>kube-controller-manager</code> logs on your active master. This will vary depending on the cloud you are using: AWS, GCP, Azure, Openstack, etc. The <code>kube-controller-manager</code> is usually running on a docker container on the master. So you ... |
<p>I have a kubernetes service that works in a leader/follower fashion, so only one of 2 pods (for HA) can accept the connection. I want to make my service publicly available with traefik ingress controller. </p>
<p>One of the ways to achieve that - tweaks the readiness probe for the service, so slave pod will fail ... | <p>So you don't need to use the k8s readiness probe for the traefik ingress, you can use a traefik backend health check defined in your k8s ingress through annotations. This way you don't forward to backends that are not active. For example:</p>
<pre><code>kind: Ingress
metadata:
name: specific-deployment
annotati... |
<p>I am using AKS cluster on Azure. I am trying to discover service using DNS (<a href="http://my-api.default.svc.cluster.local:3000/" rel="nofollow noreferrer">http://my-api.default.svc.cluster.local:3000/</a>) but, it's not working (This site can’t be reached). With service IP endpoint everything is working fine.</p>... | <p>Fixing the indentation of your yaml file, I was able to launch the deployment and service successfully. Also the DNS resolution worked fine.</p>
<p>Differences:</p>
<ul>
<li>Fixed indentation</li>
<li>Used <code>test1</code> namespaces instead of <code>default</code></li>
<li>Used containerPort <code>80</code> ins... |
<p>I have deployed cockroachdb with a <a href="https://github.com/helm/charts/tree/master/stable/cockroachdb" rel="nofollow noreferrer">stable helm chart</a>.
Unfortunately, I didn't realize the default conf gives me a very small 1Gi, unresizable persistent volume.
I also didn't realize that the cockroachdb was using q... | <p>As <a href="https://stackoverflow.com/users/9231144/patrick-w">https://stackoverflow.com/users/9231144/patrick-w</a> mentioned, automatic resize of the volumes isn't possible until Kubernetes/GKE version 1.11.</p>
<p>In the meantime, it is possible to manually resize them by editing the disks in the <a href="https:... |
<p>After installing just the basic Kubernetes packages and working with minikube, I have started just the basic kube-system pods. I'm trying to investigate why the kube-dns is not able to resolve domain names</p>
<p>Here are the versions I'm using</p>
<pre><code>Client:
Version: 18.06.1-ce
API version: ... | <p>Each <code>kubelet</code> in a k8s cluster has <code>--cluster-dns</code> option. This option, in fact, provides a <code>Service</code> name for kube-dns <code>Deployment</code>. Each <code>kube-dns</code> Pod, in turn, has <code>dnsmasq</code> container, which is using a list of nameservers from the k8s node. You c... |
<p>I basically want to find the hard eviction strategy that kubelet is currently using.<br>
I checked the settings in the /etc/systemd/system/kubelet.service file on my K8s node. In that the strategy I mentioned is as follows:<br>
<code>--eviction-hard=nodefs.available<3Gi</code> </p>
<p>However, my pods seem to ... | <p>It is possible to <a href="https://kubernetes.io/docs/tasks/administer-cluster/reconfigure-kubelet/#generate-the-configuration-file" rel="noreferrer">dump the current kubelet configuration</a> using <code>kubectl proxy</code> along with the <code>/api/v1/nodes/${TARGET_NODE_FOR_KUBELET}/proxy/configz</code> path, de... |
<p>I got an issue when I try to access an exposed <code>kubernetes</code> service through browser. Below is my Environment.</p>
<p>created two <code>ubuntu</code> EC2 instances(with all ports open in security group) and installed all kubernetes related tools like kubectl, kubeadm, docker, calico network.</p>
<p>creat... | <p>The internet firewall on my network was blocking the access to specific ports. There was no issues with the Cloud Provider Firewall or Instance Firewall.</p>
|
<p>I have a server running on Kubernetes to handle hourly processing jobs. Thinking of using a service to expose the pods, and using an (external) cron job to hit the load balancer so that kubernetes can autoscale to handle the higher load as required. However in implementation, if the cron job sends, say, 100 requests... | <p>I wrote a simple client go based application which you can pair with CronJob to scale up ir down the deployment. You can take inspiration from it and write it yourself or just use it. I hope this helps.</p>
<p><a href="https://github.com/balchua/boink" rel="nofollow noreferrer">https://github.com/balchua/boink</a... |
<p>I have a Kubernetes Service that selects by doing:</p>
<pre><code>spec:
selector:
backend: nlp-server
</code></pre>
<p>If there are multiple <code>Pods</code> which match the selector, which <code>Pod</code> does the <code>Service</code> route a request to? </p>
<p>I am using the default <code>ClusterIP<... | <p>In a nutshell, no you don't need the internal load-balancer you linked to. The <code>Service</code> resource <em>is</em> indeed a load-balancer. Depending on the <a href="https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies" rel="noreferrer">proxy mode</a> it could be roun... |
<p>I have set up Kubernetes secrets.</p>
<pre><code>kubectl create secret generic mysecret --from-file=mysecret=/home/ubuntu/secret.txt
</code></pre>
<p>And this secret can be converted to plaintext using the same <code>kubectl</code> command:</p>
<pre><code>kubectl get secret mysecret -o yaml
# and base64 decode
</... | <p>OK, so you need to define a (cluster) role and then bind it to you (== human user is the target entity) and/or to a service account (== app is the target entity) which you then <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/" rel="noreferrer">use in the pod</a> instead of... |
<p>I have a daemonset which deploys containers to check status of few mount points. This daemonset deployment is done from a python script and soon after the deployment command I am collecting the logs which will be created by above daemonset pods. I see that the logs are getting copied soon after the daemonset creatio... | <p>So you also need to check for the pods to be in <code>Running</code> state (all containers in the pod)</p>
<pre><code># wait for the pod
check_pod_state("cos-plugin-diag")
</code></pre>
<p>So if the Pod has 2 containers, for example, you should check for <code>2/2</code></p>
<p>Example:</p>
<pre><code>NAME ... |
<p>We are trying to implement Presto with Kubernetes. We have a kubernetes cluster running on cloud as a service. I tried to google on this but could not find a conclusive result as to what may be the best practices to deploy Presto with Kubernetes. Though there exists the official github of Presto - but does not help.... | <p>You could install with the official helm chart from <a href="https://github.com/helm/charts/tree/master/stable/presto" rel="noreferrer">https://github.com/helm/charts/tree/master/stable/presto</a> It provides an option to set the number of workers. With the official chart you should be able to ask questions in the K... |
<p>I am trying to create a deployment on a K8s cluster with one master and two worker nodes. The cluster is running on 3 AWS EC2 instances. I have been using this environment for quite sometime to play with Kubernetes. Three days back, I have started to see all the pods status to change to <code>ContainerCreating</co... | <p>This can occur if you specify a limit or request on memory and use the wrong unit.</p>
<p>Below triggered the message:</p>
<pre><code>resources:
limits:
cpu: "300m"
memory: "256m"
requests:
cpu: "50m"
memory: "64m"
</code></pre>
<p>The correct line would be:</p>
<pre><code>resources:
... |
<h1>Helm _helpers.tpl?</h1>
<p>Helm allows for the use of <a href="https://golang.org/pkg/text/template/" rel="noreferrer">Go templating</a> in resource files for Kubernetes. </p>
<p>A file named <code>_helpers.tpl</code> is usually used to define Go template helpers with this syntax:</p>
<pre><code>{{- define "you... | <p>You can use <code>(include ... )</code> syntax. Example of including previously defined template <code>foo</code>:</p>
<pre><code>{{- define "bar" -}}
{{- printf "%s-%s" (include "foo" .) .Release.Namespace | trunc 63 | trimSuffix "-" -}}
{{- end -}}
</code></pre>
|
<p>Basically, i have a Deployment that creates 3 containers which scale automatically: PHP-FPM, NGINX and the container that contains the application, all set up with secrets, services and ingress. The application also share the project between PHP-FPM and NGINX, so it's all set up.</p>
<p>Since i want to explore more... | <blockquote>
<p>How do I connect my project to the redis server that is running in other pod, that scales independently?</p>
</blockquote>
<p>You have three possible states here:</p>
<ul>
<li><p>To connect to Redis pod from <strong>within</strong> any other pod running <strong>in the same namespace</strong> as Redis po... |
<p>For my AKS container setup, I would like to pass the requested number of replicas of a given statefulset to each pod through environment variables.</p>
<p>I was trying to do this without repeating myself (once in the "replicas" setting and once in the setting of the environment variables).</p>
<p>The only real sol... | <p>Although your approach is interesting, <code>!!str</code> is not a casting operator and the <a href="http://yaml.org/spec/1.2/spec.html#id2768011" rel="nofollow noreferrer">YAML specification</a> clearly indicates that what you tried is not going to work:</p>
<blockquote>
<p>When a node has more than one occurren... |
<p>For my AKS container setup, I would like to pass the requested number of replicas of a given statefulset to each pod through environment variables.</p>
<p>I was trying to do this without repeating myself (once in the "replicas" setting and once in the setting of the environment variables).</p>
<p>The only real sol... | <p><a href="https://helm.sh" rel="nofollow noreferrer">Helm</a> is what you need. </p>
<p>Actually, <code>Helm</code> is something more, than what you need, but it has a template engine (just like in Ansible), which could help with your case. Moreover, today using <code>Helm</code> it's almost mandatory with the Kuber... |
<p>I have failed to use HostPath <code>/var/lib/docker/containers</code> as a volume with the following error:</p>
<pre><code> Error response from daemon: linux mounts: Path /var/lib/docker/containers is
mounted on /var/lib/docker/containers but it is not a shared or slave mount.
</code></pre>
<p>Here is my YAML sp... | <blockquote>
<p>very appreciated for any help!</p>
</blockquote>
<p>You are most probably hit by a version specific issue:</p>
<pre><code>/var/lib/docker/containers is intentionally mounted by Docker with private mount
propagation and thus conflicts with Kubernetes trying to mount this directory
as rslave when runn... |
<p>I am using the ELK stack (elasticsearch, logsash, kibana) for log processing and analysis in a Kubernetes (minikube) environment. To capture logs I am using filebeat. Logs are propagated successfully from filebeat through to elasticsearch and are viewable in Kibana. </p>
<p>My problem is that I am unable to get ... | <p>For future people coming here, it is now already in place in a filebeat processor :</p>
<pre><code>filebeat.prospectors:
- type: log
enabled: true
paths:
- /var/log/*.log
- /var/log/messages
- /var/log/syslog
- type: docker
containers.ids:
- "*"
processors:
- add_kube... |
<p>I have a grpc micro-service A running in kubernetes cluster. When this service is called, I would like to create an instance of another grpc micro-service B and run it in the same cluster. I have the image of the second service included in the container A. Now how can I create and run the micro-service B as another ... | <p>You do not need an image inside, what you need is a kubernetes client that you will use to create deployment/job/pod. Your pod needs a serviceaccount that has RBAC role/clusterrole allowing for creation of what you need. This way you can create a service that on demand interacts with kubernetes api and creates what ... |
<p>I am a beginner to Kubernetes and starting off with <a href="https://kubernetes.io/docs/tutorials/hello-minikube/#create-your-node-js-application" rel="noreferrer">this</a> tutorial. I installed <a href="https://www.virtualbox.org/wiki/Downloads" rel="noreferrer">VM</a> and expected to be able to start a cluster by ... | <p>Figured out the issue. VirtualBox was not installed correctly as Mac had blocked it. It wasn't obvious at first. </p>
<ul>
<li><p>Restarting won't work if VirtualBox isn't installed correctly. </p></li>
<li><p>System Preferences -> Security & Privacy -> Allow -> Then allow the software corporation (in this case... |
<p>I'm trying to configure an elastic ip with Amazon's Elastic Kubernetes service so I can expose a static public IP address. So far it seems the only way to expose a static public IP address is through a load balancer which is kind of a waste since I have a static private IP address endpoint for the service but no way... | <p>Short answer: AFAIK it's not possible through K8s. If you don't want to waste EIPs then why don't you use an Ingress Controller (Something like traefik or nginx) that way your ingress uses a single IP as a service and then you can expose other services from there.</p>
<p><a href="https://github.com/kubernetes/ingre... |
<p>I have a 4 node Kubernetes cluster, 1 x controller and 3 x workers. The following shows how they are configured with the versions.</p>
<p><code>
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
k8s-ctrl-1 Ready ... | <p>Sounds like you are running on AWS. I suspect that your AWS security group is not allowing DNS traffic to go through. You can try allowing all traffic to the Security Group(s) where all your master and nodes are, to see if that's the problem.</p>
<p><a href="https://i.stack.imgur.com/ta227.png" rel="nofollow norefe... |
<p>I have a 3-nodes bare metal cluster installed with KUBEADM (buildt with intel NUC running CentOS 7).</p>
<p>The master node is provided with 2 different network interfaces, one for external access and the second is configured to be the DHCP server of the cluster local network.
IP forwarding and masquerading betwee... | <p>Kubernetes and Calico do convoluted things with <code>iptables</code>, so I believe you have a conflict or blocking rule somewhere. I recommend disabling all the rules to start then install docker and then your k8s with <code>kubeadm</code>.</p>
|
<p>I have a 4 node Kubernetes cluster, 1 x controller and 3 x workers. The following shows how they are configured with the versions.</p>
<p><code>
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
k8s-ctrl-1 Ready ... | <p>Following the instruction at this <a href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/" rel="nofollow noreferrer">page</a>, try to run this:</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
namespace: default
name: dns-example
spec:
containers:
- name: test
image: nginx... |
<p>I am new to AWS EKS - I have an application for which I need one worker node (a pod) of the Kubernetes to run on my on-premise infrastructure. Is that possible and if yes then how can I achieve that ?</p>
| <p>In theory you can run EKS and on-prem kubernetes clusters at the same time, but managing them via a single <a href="https://kubernetes.io/docs/concepts/cluster-administration/federation/" rel="nofollow noreferrer">federation</a> control plane. But I've never tried to use it with EKS, although EKS is mostly vanilla k... |
<p>While the <a href="https://github.com/kubernetes/client-go/blob/master/examples/out-of-cluster-client-configuration/main.go" rel="nofollow noreferrer">kubernetes golang api example for out-of-cluster authentication works fine</a>, and <a href="https://gist.github.com/innovia/fbba8259042f71db98ea8d4ad19bd708" rel="no... | <p>The <code>rest.Config</code> struct passed to the <code>NewFromConfig</code> client constructors lets you specify bearer tokens and/or client certificate/key data directly. </p>
|
<p>I want setup Traefik backend health check via Kubernetes annotation, but looks like <a href="https://docs.traefik.io/v1.7/configuration/backends/kubernetes/" rel="nofollow noreferrer">Kubernetes Ingress</a> does not support that functionality according to official documentation.</p>
<p>Is any particular reason why ... | <p>Traefik relies on Kubernetes to provide an indication of the health of the underlying pods to ascertain whether they are ready to provide service. Kubernetes exposes two mechanisms in a pod to communicate information to the orchestration layer:</p>
<ul>
<li><strong>Liveness checks</strong> to provide an indication ... |
<p>I've installed metrics-server on kubernetes v1.11.2.</p>
<p>I'm running a bare-metal cluster using 3 nodes and 1 master</p>
<p>In the metrics-server log I have the following errors:</p>
<pre><code>E0907 14:29:51.774592 1 manager.go:102] unable to fully collect metrics: [unable to fully scrape metrics from s... | <p>I found the following solution:</p>
<p>Change the <code>metrics-server-deployment.yaml</code> file and add:</p>
<pre><code>command:
- /metrics-server
- --kubelet-preferred-address-types=InternalIP
- --kubelet-insecure-tls
</code></pre>
|
<p>While the <a href="https://github.com/kubernetes/client-go/blob/master/examples/out-of-cluster-client-configuration/main.go" rel="nofollow noreferrer">kubernetes golang api example for out-of-cluster authentication works fine</a>, and <a href="https://gist.github.com/innovia/fbba8259042f71db98ea8d4ad19bd708" rel="no... | <p>Looking at the source code, this should work:</p>
<pre><code>// error handling omitted for brevity
cc, _ := clientcmd.NewClientConfigFromBytes([]byte(d1))
config, _ := cc.ClientConfig()
clientset, _ := kubernetes.NewForConfig(config)
</code></pre>
|
<p>We have an <a href="https://cloud.google.com/load-balancing/docs/https/" rel="noreferrer">HTTP(s) Load Balancer</a> created by a kubernetes ingress, which points to a backend formed by set of pods running nginx and Ruby on Rails.</p>
<p>Taking a look to the load balancer logs we have detected an increasing number of... | <p>A response code of 0 and statusDetails = client_disconnected_before_any_response means the client closed the connection before the Load Balancer being able to provide a response as per this <a href="https://cloud.google.com/load-balancing/docs/https/https-logging-monitoring#statusdetail_http_failure_messages" rel="n... |
<p>I'm trying to configure an elastic ip with Amazon's Elastic Kubernetes service so I can expose a static public IP address. So far it seems the only way to expose a static public IP address is through a load balancer which is kind of a waste since I have a static private IP address endpoint for the service but no way... | <p>The only possible way with EKS is to use a Load Balancer. In our case, we needed to have a fixed CNAME to use in Route53. We ended up using a Load Balancer that points to our web server, that was set up as a Deployment.
As you mentioned I thought that using a Load Balancer was a waste because we only have 1 deployme... |
<p>How do I enable a port on Google Kubernetes Engine to accept websocket connections? Is there a way of doing so other than using an ingress controller? </p>
| <p>As per <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/service" rel="nofollow noreferrer">this article</a> in the GCP documentation, there are 4 ways that you may expose a Service to external applications. </p>
<p>It can be exposed with a ClusterIP, a <a href="https://kubernetes.io/docs/concepts/... |
<p>I installed a filebeat -> logstash -> elasticsearch -> kibana stack in Kubernetes with helm charts :</p>
<pre><code>helm repo add incubator http://storage.googleapis.com/kubernetes-charts-incubator
helm install --name elastic --namespace monitoring incubator/elasticsearch --set client.replicas=1,master.replicas=2,d... | <p>I was mistaking "pattern" and "filter".</p>
<p>In the Helm chart, "pattern" is for specifying our custom grok patterns (<a href="https://grokdebug.herokuapp.com/patterns" rel="nofollow noreferrer">https://grokdebug.herokuapp.com/patterns</a>) : </p>
<blockquote>
<p>MY_CUSTOM_ALL_CHARS .*</p>
</blockquote>
<p>My... |
<p>I got an issue with the deployment of a WordPress + MySQL application on a Kubernetes cluster.</p>
<p>When using <code>HorizontalPodAutoscaler</code> to autoscale my <code>wordpress</code> and <code>wordpress-mysql</code> deployments, it works fine for the <code>wordpress</code> one but not the <code>wordpress-mysq... | <blockquote>
<p>So it might be quite normal because each MySQL pod is trying to access ./ibdata1 at the same time</p>
</blockquote>
<p>Yes, if you try to do that (you didn't supply manifests), then that's the very reason you have CrashLoopBackOff state. First started instace will lock it and all subsequent will fail... |
<p>What happened:
I have been following this guidelines: <a href="https://kubernetes.io/docs/setup/minikube/" rel="noreferrer">https://kubernetes.io/docs/setup/minikube/</a> and I have the "connection refused" issue when trying to curl the application. Here are the steps I did</p>
<pre><code>~~> minikube status
min... | <p>Not sure where you got the port <code>9500</code> from but that's the reason it doesn't work. NGINX serves on port <code>8080</code>. This should work (it does for me, at least):</p>
<pre><code>$ kubectl expose deployment hello-minikube \
--type=NodePort \
--port=8080 --target-port=8080
$ curl... |
<p>I am wonder, whether it could work..</p>
<p>We have services FOO and BAR, they are running it the same cluster with Docker Registry. Let's imagine this cluster is for production, not for development</p>
<p>We have
CI/CD system which is responsible for building images and pushing them to docker registry.</p>
<p>Do... | <p>Well, this looks like a very theoretical question. The only question which is could be answered unequivocally is:</p>
<blockquote>
<p>Is it possible to create docker registry with self signed certificate,
and setup kubernetes to trust this registry?</p>
</blockquote>
<p>Of course, you can deploy your own Docke... |
<p>I'm trying to run a <code>StatefulSet</code> on my Kubernetes Cluster which has preemptible nodes in it, but I don't want to run StatefulSets on preemptible nodes as they are available for 24hrs at max.</p>
<p>As mentioned in this <a href="https://medium.com/google-cloud/using-preemptible-vms-to-cut-kubernetes-engi... | <p>You can use it in the spec definition just like in deployments:</p>
<p>Example:</p>
<pre><code>apiVersion: apps/v1
kind: StatefulSet
metadata:
name: web
spec:
selector:
matchLabels:
app: nginx # has to match .spec.template.metadata.labels
serviceName: "nginx"
replicas: 3 # by default is 1
templ... |
<p>I am new to EKS and looking for the number of pods per node and sizes of EC2 instances for nodes, recommended by AWS in EKS for better performance and HA?
I found limitations set by Kubernetes.io in <a href="https://kubernetes.io/docs/setup/cluster-large/" rel="nofollow noreferrer">here</a>. But I want to know what... | <p>There is a hard limit to the number of pods that can be run on a particular worker instance type. This is because, by default, Amazon's VPC CNI assigns a subnet IP to each pod. <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI" rel="noreferrer">This</a> page lists how ma... |
<p>I'm using Jenkins deployed on Kubernetes. Jenkins pods are deployed in 'kubernetes-plugin' namespace, and uses service account 'jenkins', which is defined below:</p>
<pre><code>---
apiVersion: v1
kind: ServiceAccount
metadata:
name: jenkins
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
... | <blockquote>
<p>So is there a way to deploy a deployment in another namespace?? How.</p>
</blockquote>
<p>If I'm not mistaken, <a href="https://github.com/jenkinsci/kubernetes-plugin" rel="nofollow noreferrer">this github project</a> gives steps to run in different namespace. It all boils down to this:</p>
<p>You n... |
<p>I have some apps in production working in Azure. All these applications belong to the same company and communicate with each other. I want to migrate them to Kubernetes.</p>
<p><strong>My question is:</strong> What are the best practices in this case and why ?</p>
<p>Some peoples recommend one cluster and multiple... | <blockquote>
<p><strong>My question is:</strong> What are the best practices in this case? and why ?</p>
</blockquote>
<p>Answer is: it depends...</p>
<p>To try to summarize it from our experience:</p>
<ul>
<li><p>Cluster for each app is usually quite a bit waste of resources, especially giving HA clusters require... |
<p>Currently I am having an issue with one of my services set to be a load balancer. I am trying to get the source ip preservation like its stated in the <a href="https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip" rel="nofollow noreferrer">docs</a... | <p>Could be several things. A couple of suggestions:</p>
<ol>
<li>Your service is getting an external IP and doesn't know how to reply back based on the local IP address of the pod.
<ul>
<li>Try running a sniffer on your pod see if you are getting packets from the external source.</li>
<li>Try checking at logs of you... |
<p>I have a failing <code>public docker hub</code> container and if I <code>kubectl apply -f ...</code> with the same version, <code>:latest</code> in this case, I am getting:</p>
<pre><code>Container image "<name/name>:latest" already present on machine
</code></pre>
<p>I don't see the image anywhere, in this ... | <p>I think use <code>latest</code> tag - not the best. But if it is necessary, <a href="https://kubernetes.io/docs/concepts/containers/images/#updating-images" rel="nofollow noreferrer">official</a> workaround <code>imagePullPolicy=Always</code>.</p>
<p>Why this not best way? More info can find <a href="https://kubern... |
<p>I followed this tutorial: <a href="https://kubecloud.io/setting-up-a-highly-available-kubernetes-cluster-with-private-networking-on-aws-using-kops-65f7a94782ef" rel="nofollow noreferrer">Kubernetes Cluster with private networking on AWS using Kops</a></p>
<p>However, after creating the kubernetes cluster, I am gett... | <p>Issue resolved. It was not a <code>kops</code> problem, the issue was with AWS M5 and linux version.</p>
<blockquote>
<p>The kops default Debian jessie images do not support nvme for EBS
volumes, which is used by the AWS M5 instance types. As a result,
masters fail to start, as they can not mount the EBS volu... |
<p>I was looking at the <a href="https://kubernetes.io/docs/getting-started-guides/windows/" rel="noreferrer">kubernetes documentation</a> which seems to have a windows compability, however I don't find completely clear if both Linux and Windows can live together (I mean, in diferent VMs but the same cluster).</p>
<p>... | <p>Some history, so containers is a Linux thing so there are no containers per se on Windows. Docker created Docker for Windows but essentially what it does is run a Hyper-V Linux VM (used to be VirtualBox) and inside it runs your containers. As of the latest Docker version, Microsoft has added capabilities on Hyper-V ... |
<p>I'm deploying the <strong>hyperledger/fabric-couchdb</strong> docker image on Rancher-Kubernetes. In the cluster, it's not allowed run container as ROOT. So we need select as Nonroot while deploying images. </p>
<p>After deploying <strong>hyperledger/fabric-couchdb</strong>, the pod is not getting started. When I c... | <p>That's the problem, you are not running as 'root' and the container entrypoint executes a call to <code>setgroups</code> which requires 'root'. You will have to either run as 'root' somehow or you can modify your container image and the entrypoint to perhaps make those calls where 'root' is require using something l... |
<p>View node status:kubectl get csr</p>
<pre><code>[root@kube1 ~]# kubectl get csr
NAME AGE REQUESTOR CONDITION
node-csr--jJF_sRckTdhoqAOYB4fEaA06Juwv32d1RFwzcbbE0c 150m system:bootstrap:gn5vla Pending
node-csr-KMkTDLPqhj52YxZFS8vEOiqMt1NXVEcYv... | <p>Short answer, you can't. Once you deny a CSR you need issue a new CSR and approve it if you want to. You can delete denied CSRs if you don't want to see them there with:</p>
<pre><code> kubectl delete csr <csr-name>
</code></pre>
<p>Additionally, To delete all denied requests use:</p>
<pre><code>kubectl get cs... |
<p>I just installed the controller via Helm, I can list the helm packages via <code>helm list</code>, but is it possible to list all the controllers running in the cluster via <code>kubectl</code> or <code>api-query</code>?</p>
| <p>If you mean replication controller then you can list them by <code>kubectl</code>:</p>
<pre><code>kubectl get replicationcontroller -n my-namespace
</code></pre>
<p>Or list them all from all the namespaces:</p>
<pre><code>kubectl get rc --all-namespaces
</code></pre>
<p>And you can also use API:</p>
<pre><code>... |
<p>We've experienced 4 <code>AUTO_REPAIR_NODES</code> events(revealed by the command <code>gcloud container operations list</code>) on our GKE cluster during the past 1 month. The consequence of node-auto-repair is that the node gets recreated and gets attached a new external IP, and the new external IP, which was not ... | <p>The confusion lies here in that there are 'Ready' and 'NotReady' states that are shown when you run <code>kubectl get nodes</code> which are reported by the kube-apiserver. But these are independent and unclear from the docs how they relate to the kubelet states described <a href="https://kubernetes.io/docs/concepts... |
<p>Is it possible to have the log output for icecast read a variable from a header sent to the server? Currently I am setting up an icecast server in Kuberenetes and I'm trying to get source IP preservation onto the stream for analyzing log data. However even with the necessary steps on kubernetes side I am not seeing ... | <p>Not at the moment.</p>
<p>We plan to support reverse proxying in release 2.5.</p>
<p>Our general recommendation at the moment is to <em>not</em> reverse proxy Icecast due to many possible problems beyond just losing the originating IP address.</p>
<p>Just expose the Icecast ports directly to the Internet, e.g. th... |
<p>I am trying to add new user to EKS cluster and giving then access. So far I was able to add the user just by editing <code>configmap/aws-auth</code> (<code>kubectl edit -n kube-system configmap/aws-auth</code>) and adding new user to </p>
<pre><code>mapUsers: |
- userarn: arn:aws:iam::123456789:user/user01
user... | <p>Essentially what you want is to define a cluster role and use a role binding to apply it to a specific namespace. Using a cluster role (rather than a role) allows you to re-use it across namespaces. Using a role binding allows you to target a specific namespace rather than giving cluster-wide permissions.</p>
|
<p>I have a container that runs some data fetching from a MySQL database and simply displays the result in console.log(), and want to run this as a cron job in GKE. So far I have the container working on my local machine, and have successfully deployed this to GKE (in terms of there being no errors thrown so far as I c... | <p>A <code>CronJob</code> is essentially a cookie cutter for jobs. That is, it knows how to create jobs and execute them at a certain time. Now, that being said, when looking at garbage collection and clean up behaviour of a <code>CronJob</code>, we can simply look at what the Kubernetes docs have to say about this top... |
<p>I'm using Minikube for working with Kubernetes on my local machine, and would like to run a command on the VM just after startup (preferably before the Pods start). I can run it manually with <code>minikube ssh</code>, but that's a bit of a pain to do after every restart, and is difficult to wrap in a script.</p>
<... | <p>Maybe flags which can you pass to <code>minikube start</code> would be useful in your case:</p>
<pre><code> --mount This will start the mount daemon and automatically mount files into minikube
--mount-string string The argument to pass the minikube mount command on start (defa... |
<p>When I want to execute this command:</p>
<pre><code>kubectl apply -f namespace.yaml
</code></pre>
<p>I had this error message:</p>
<pre><code>The connection to the server localhost:8080 was refused - did you specify the right host or port?
</code></pre>
<p>Some answers have been posted in Stackoverflow like usin... | <p>You need to configure kubectl to use your cluster as described here: <a href="https://cloud.google.com/kubernetes-engine/docs/quickstart" rel="nofollow noreferrer">https://cloud.google.com/kubernetes-engine/docs/quickstart</a></p>
|
<p>In the Kubernetes <a href="https://kubernetes.io/docs/tutorials/hello-minikube/#create-your-node-js-application" rel="noreferrer">minikube tutorial</a> there is this command to use Minikube Docker daemon :</p>
<pre><code>$ eval $(minikube docker-env)
</code></pre>
<p>What exactly does this command do, that is, wha... | <p>The command <code>minikube docker-env</code> returns a set of Bash environment variable exports to configure your local environment to re-use the Docker daemon inside the Minikube instance.</p>
<p>Passing this output through <code>eval</code> causes bash to evaluate these exports and put them into effect.</p>
<p>You... |
<p>How can I aggregate the log events to a single entry even though it is logged in multiple lines through application logger when docker is deployed to gcp kubernetes cluster.</p>
<p>For AWS we can use the date time format to identify the start of an event. What is the substitute in GCP.</p>
<p>Thanks.</p>
| <p>In my opinion, you need a dedicated solution to manage your logs really effectively.</p>
<p>One of the most popular solutions for aggregating/managing/sharing logs is <a href="https://www.elastic.co/products" rel="nofollow noreferrer">ELK stack</a>, i.e. <code>ElasticSearch, Logstash, Kibana</code> or another versi... |
<p>What is the difference between Objects and Resouces in Kubernetes world? </p>
<p>I couldn't find it from <a href="https://kubernetes.io/docs/concepts/" rel="noreferrer">https://kubernetes.io/docs/concepts/</a> . I wonder they make no distinction about them but seems they see objects as a high-level concept of resou... | <p>A representation of a specific group+version+kind is an object. For example, a v1 Pod, or an apps/v1 Deployment. Those definitions can exist in manifest files, or be obtained from the apiserver.</p>
<p>A specific URL used to obtain the object is a resource. For example, a list of v1 Pod objects can be obtained from... |
<p>I'm using this helm chart: <a href="https://github.com/helm/charts/tree/master/incubator/kafka" rel="nofollow noreferrer">https://github.com/helm/charts/tree/master/incubator/kafka</a> </p>
<p>and these overrides in values.yaml</p>
<pre><code>configurationOverrides:
advertised.listeners: |-
EXTERNAL://kafka-... | <p>We've defined 2 listeners: <code>PLAINTEXT</code> and <code>EXTERNAL</code>. You've mapped both to <code>SASL_PLAINTEXT</code>.</p>
<p>Is this really what you wanted to do? or did you want <code>PLAINTEXT</code> to not require SASL but just be Plaintext?</p>
<ul>
<li><p>If you really want both to be SASL, then bot... |
<p>I have a K8s config map that defines an ENVIRONMENT parameter.</p>
<p>That value is mounted as an environment variable on the deployment yaml using an excerpt in src/fabric8/deployment.yml:</p>
<pre><code>spec:
template:
spec:
containers:
- env:
- name: "ENVIRONMENT"
valueFrom:
... | <p>One thing to note first is that the name given to the environment variable injected into the Pod and the key being used from the configmap don't have to match. So you could do:</p>
<pre><code> - env:
- name: SPRING_PROFILES_ACTIVE
valueFrom:
configMapKeyRef:
na... |
<p>Is there a way to tell Kubernetes to just destroy a pod and create a new one if the liveness probe fails? What I see from logs now: my node js application is just restarted and runs in the same pod.</p>
<p>The liveness probe is defined in my YAML specification as follows:</p>
<pre><code>livenessProbe:
httpGet:
p... | <p>So liveness and readiness probes are defined in <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#define-a-liveness-command" rel="noreferrer">containers not pods</a> so if you have 1 container in your pod and you specify <code>restartPolicy</code> to <code>Never</... |
<p>I have istio set up with mtls globally enabled. I have verifed it by bashing into a pot without an envoy sidecar, and running a curl command on http, which failed. Then run a curl on HTTPS using the Istio certs, which worked.</p>
<p>When I port-forward to a service, eq <code>kubectl port-forward svc/my-svc 8080:80<... | <p>I found out that <strong>Istio</strong> is working in parallel with standard Kubernetes network services and does not affect traffic in case of <code>port-forwarding</code>.</p>
<p><strong>Istio</strong> network service will create iptables rule exactly the same as <code>kubectl port-forward</code> or any other sta... |
<p>Is there a nice way to delete a specific key from a Kubernetes configmap, using kubectl?</p>
<p>Right now I run: </p>
<pre><code>$ kubectl edit configmap myconfigmap
</code></pre>
<p>and then I delete the entry but I would like a solution that can be run as a script.</p>
| <p>This works but I wonder if there is a simpler way</p>
<pre><code>$ kubectl patch configmap myconfigmap --type=json -p='[{"op": "remove", "path": "/data/mykey"}]'
</code></pre>
|
<p>I'd like to launch a pod which runs all the time in the cluster and it can be used by the users as a jump box for the k8s cluster. So I have created a <code>Deployment</code> and run a pod. However I'm not sure which should be the <code>CMD</code> for this container. I could use <code>/bin/bash</code> or /bin/sh` ho... | <p>If you want a jump box why not specify the the <code>CMD</code> to be <code>sshd</code> just like <a href="https://docs.docker.com/engine/examples/running_ssh_service/" rel="nofollow noreferrer">here</a>.</p>
<p>That should be able to allocate TTYs. </p>
|
<p>By mistake I created a service account to give admin permission for dashboard. But now I am unable to delete it.</p>
<p>The reason I want to get rid of that service account is if I follow the steps here <a href="https://github.com/kubernetes/dashboard" rel="noreferrer">https://github.com/kubernetes/dashboard</a>. W... | <p>You have to specify the namespace when deleting it:</p>
<pre><code>kubectl delete serviceaccount -n kube-system kubernetes-dashboard
</code></pre>
|
<p>I'm installing Prometheus on GKE with Helm using the standard chart as in</p>
<p><code>helm install -n prom stable/prometheus --namespace hal</code></p>
<p>but I need to be able to pull up the Prometheus UI in the browser. I know that I can do it with port forwarding, as in</p>
<p><code>kubectl port-forward -n h... | <p>It is generally a very bad idea to expose Prometheus itself as it has no authentication mechanism, but you can absolutely set up a LoadBalancer service or Ingress aimed at the HTTP port if you want.</p>
<p>More commonly (and supported by the chart) you'll use Grafana for the public view and only connect to Prom its... |
<p>I have a jenkins instance created using <code>docker run -d -v /Users/dlovison/Documents/DockerVolumes/jenkins_home:/var/jenkins_home -p 8080:8080 -p 50000:50000 jenkins/jenkins:lts</code> deployed only on my local environment</p>
<p>I would like to connect in my remote openshift instance (openshift.com)</p>
<p>I ... | <p>Basically, it cannot create a volume on your Kubernetes/Openshift cluster. It's unclear from the question where your Openshift cluster is running, so creating a volume will depend on your cloud/StorageClass. Can you Try these commands?</p>
<pre><code>oc get pvc
oc get pv
</code></pre>
<p>With the output</p>
<pre>... |
<p>I have an Angular 6 application that I'm required to deploy onto a Kubernetes cluster as a Docker container (Nginx Base Image).</p>
<p><strong>Question</strong>: How do I accommodate using the same Docker image that's built once, but to be able to run in dev & prod and point to different API_URL?</p>
<p>My <st... | <p>One of the ways to solve it would be to add an entrypoint script to your docker image and a default prod env. The use only one environment.ts with something like :</p>
<pre><code>export const environment = {
production: {{production}},
API_URL: '{{api_url}}'
};
</code></pre>
<p>Dockerfile with</p>
<pre><code>... |
<p>I want to access my Kubernetes cluster API in Go to run <code>kubectl</code> command to get available namespaces in my k8s cluster which is running on google cloud.</p>
<p>My sole purpose is to get namespaces available in my cluster by running <code>kubectl</code> command: kindly let me know if there is any alterna... | <p>You can start with <a href="https://github.com/kubernetes/client-go" rel="nofollow noreferrer"><code>kubernetes/client-go</code></a>, the Go client for Kubernetes, made for talking to a kubernetes cluster. (not through kubectl though: directly through the Kubernetes API)</p>
<p>It includes a <a href="https://github... |
<p>For our use-case, we need to access a lot of services via NodePort. By default, the NodePort range is 30000-32767. With <strong>kubeadm</strong>, I can set the port range via <em>--service-node-port-range</em> flag.</p>
<p>We are using Google Kubernetes Engine (GKE) cluster. How can I set the port range for a GKE c... | <p>In GKE, the control plane is managed by Google. This means you don't get to set things on the API Server yourself. That being sad, I <em>believe</em> you can use the <code>kubemci</code> CLI tool to achieve it, see <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/multi-cluster-ingress" rel="nofollow n... |
<p>Reading the Kubernetes "Run to Completion" documentation, it says that jobs can be run in parallel, but is it possible to chain together a series of jobs that should be run in sequential order (parallel and/or non-parallel).</p>
<p><a href="https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-compl... | <p>I have used initContainers under the PodSpec in the past to solve problems like this: <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>
<pre><code>apiVersion: v1
kind: Pod
metadata:
na... |
<p>I'm using a Helm chart to deploy an app in the Kubernetes. After deployment, I want to copy a file from the chart repository to the container. </p>
<p>Currently I am doing this manually:</p>
<pre><code>kubectl cp custom-samples.json che-8467596d54-7c2hg:/data/templates
</code></pre>
<p>But I want to make this ste... | <p><code>kubectl cp</code> (in the form you're using it) takes a file from the host on which it runs. If you are always initiating deployment from that same host, you could (in theory) arrange for the file to be copied - either by having <code>kubectl cp ...</code> in a script that you use to control the deployment or ... |
<p>We try to deploy the hello world application from istio (booking info).</p>
<h1>Environment</h1>
<p>Region: Ireland
Service: EKS v2
Istio: 1.0.1
Helm:</p>
<pre><code> Client: Client: &version.Version{SemVer:"v2.9.1", GitCommit:"20adb27c7c5868466912eebdf6664e7390ebe710", GitTreeState:"clean"}
Server: Server... | <p>A public subnet in EKS is needed for the loadbalancer.
After adding a public subnet, everthing works fine.</p>
|
<p><strong>NGINX Ingress controller version:</strong> 0.18.0
<strong>Kubernetes version (use kubectl version):</strong> 1.11.1
<strong>Cloud provider or hardware configuration:</strong> Azure (AKS)
<strong>Install tools:</strong> helm</p>
<p><strong>What happened:</strong> The Ingress controller gives a 400 error with... | <p>We solved this issue by also setting the backend service, a Spring Boot service with embedded Tomcat, configuration with server.max-http-header-size: 64000. So the Nginx service and the backend service settings had to be raised.</p>
|
<p>I'm using a Helm chart to deploy an app in the Kubernetes. After deployment, I want to copy a file from the chart repository to the container. </p>
<p>Currently I am doing this manually:</p>
<pre><code>kubectl cp custom-samples.json che-8467596d54-7c2hg:/data/templates
</code></pre>
<p>But I want to make this ste... | <p>You can <a href="https://docs.helm.sh/chart_template_guide/#accessing-files-inside-templates" rel="noreferrer">include your file in the Helm chart</a>. You'd generally include that in a Kubernetes ConfigMap object, which can then be <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-con... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.