prompt stringlengths 65 38.7k | response stringlengths 41 29.1k |
|---|---|
<p>How can I run a docker image in a kubernetes pod?</p>
<p>A teammate of mine has defined a new docker image and pushed it to my team's private registry. I own some code running in our kubernetes cluster and we need to get my code to effectively <code>docker run gcr.io/our-project/teammates-image:latest</code>. </p>
... | <p>Here's the solution I ended up using for anyone who may stumble upon this in the future.</p>
<p>Install <code>kubectl</code> in the main docker image which needs to run the other docker image. I did this by following <a href="https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl" rel="noreferrer">... |
<p>I have been trying to setup Spring Cloud Dataflow Server for Kubernetes locally using minikube. Have followed the installation instructions in the the link here : <a href="https://docs.spring.io/spring-cloud-dataflow-server-kubernetes/docs/1.4.0.RELEASE/reference/htmlsingle/#_installation" rel="nofollow noreferrer">... | <p>The latest release of minikube enabled RBAC by default.</p>
<p>For RBAC enabled clusters, we have added a note in the installation section on this matter.</p>
<p><em>"The latest releases of kubernetes have enabled RBAC on the api-server. If your target platform has RBAC enabled you must ask a cluster-admin to c... |
<p>I am trying to "pass" a value from the init container to a container. Since values in a configmap are shared across the namespace, I figured I can use it for this purpose. Here is my job.yaml (with faked-out info):</p>
<pre><code>apiVersion: batch/v1
kind: Job
metadata:
name: installer-test
spec:
template:
... | <p>You can create an <code>EmptyDir</code> volume, and mount this volume onto both containers. Unlike <code>persistent volume</code>, <code>EmptyDir</code> has no portability issue.</p>
<pre><code>apiVersion: batch/v1
kind: Job
metadata:
name: installer-test
spec:
template:
spec:
containers:
- name... |
<p>I saw it on <a href="https://kubernetes.io/docs/admin/authentication/#users-in-kubernetes" rel="nofollow noreferrer">offical doc</a>, but I don't know how to <code>add or introduce</code> a <code>normal user</code> outside kubernetes clusters. And I searched a lot about normal user in kubernetes but nothing useful.<... | <p>See "<a href="https://medium.com/@etienne_24233/comparing-kubernetes-authentication-methods-6f538d834ca7" rel="nofollow noreferrer">Comparing Kubernetes Authentication Methods</a>" by <a href="https://twitter.com/etiennedi" rel="nofollow noreferrer">Etienne Dilocker</a></p>
<p>A possible solution is the <a href="ht... |
<p>Does Kubernetes support for STONITH operations for hardware nodes? We have smart electric sockets which allows for API for 'power off server', and they work great with pacemaker.</p>
<p>Does Kubernetes support STONITH? </p>
| <p>No yet.<br />
STONITH is mentioned in <a href="https://github.com/kubernetes/kubernetes/issues/39828" rel="nofollow noreferrer">kubernetes issue 39828</a></p>
<blockquote>
<p>STONITH ("Shoot The Other Node In The Head" or "Shoot The Offending Node In The Head"), sometimes called STOMITH ("Sh... |
<p>I'm setting up Spinnaker in K8s with aws-ecr. My setup and steps are:</p>
<p><strong>on AWS side:</strong></p>
<ol>
<li>Added policies ecr-pull, ecr-push, and ecr-generate-token</li>
<li>Attached the policy to a role </li>
</ol>
<p><strong>Spinnaker setup:</strong></p>
<ol start="3">
<li><p>Modified <strong>valu... | <p>Got the answer from an official Spinnaker slack channel. That adding an iam policy to the clouddriver pod won't work unfortunately since it uses the docker client instead of the aws client. The workaround to make it work can be found <a href="https://blog.spinnaker.io/using-aws-ecr-with-spinnaker-and-kubernetes-2b2... |
<p>I installed kubernetes using <code>kubeadm</code>. And to enable basic authentication, I added <code>--basic-auth-file=/etc/kubernetes/user-password.txt</code> in my <code>/etc/kubernetes/manifests/kube-apiserver.yaml</code> and also mounted corresponding volume of type "File" as described <a href="https://stackover... | <p>K8s control-plane components(apiserver,controller manager and scheduler) are <strong>static pods</strong> in the kube-system namespaces. </p>
<p>When you run following command </p>
<pre><code>Kubeadm init
</code></pre>
<blockquote>
<p>Generates static Pod manifests for the API server, controller manager and sch... |
<p>I was following the following tutorial on continuous integration using gitlab and Kubernetes (in my case on google cloud): <a href="https://about.gitlab.com/2016/12/14/continuous-delivery-of-a-spring-boot-application-with-gitlab-ci-and-kubernetes/" rel="noreferrer">https://about.gitlab.com/2016/12/14/continuous-deli... | <p>RUN <code>gcloud config unset container/use_client_certificate</code></p>
<p>After this logout and login. It should work. This happens when you disable Legacy Authorisation in the cluster settings, because the client certificate that you are using is a legacy authentication method</p>
|
<p>I have an application which accesses a couple of files from a directory. I went through kubernetes volumes and persistent volumes and volume claims. this is a multi-node kubernetes cluster. do we have any direct solution which can be used which does not need any external storage like a nfs server etc?</p>
<p>I have... | <p>This depends on your use case, if the files you want to share across the cluster are more than a few megabytes in size, you'll need some kind of storage operator. Local storage is probably not what you're looking for.</p>
<hr />
<h2>For small files (configs, keys, init scripts)</h2>
<p>If the files are small, such a... |
<p>Can one store a binary file in a <a href="http://kubernetes.io/" rel="noreferrer">Kubernetes</a> <a href="http://kubernetes.io/docs/user-guide/configmap/" rel="noreferrer">ConfigMap</a> and then later read the same content from a volume that mounts this ConfigMap? For example, if directory <code>/etc/mycompany/myap... | <p>Binary ConfigMaps are now supported since Kubernetes version 1.10.0. From the readme notes:</p>
<blockquote>
<p>ConfigMap objects now support binary data via a new binaryData field. When using kubectl create configmap --from-file, files containing non-UTF8 data will be placed in this new field in order to preserv... |
<p>by using <code>kubectl exec -ti POD_NAME bash</code> I am able to access the terminal inside the container and execute the command.</p>
<p>I can understand the usability and convenient of the above command. As K8s Operator I use <strong>exec</strong> regularly. </p>
<p>However, What is the use case of <code>kubect... | <p>The use cases for kubectl attach are discussed in <a href="https://github.com/kubernetes/kubernetes/issues/23335" rel="noreferrer">kubernetes/issue 23335</a>.</p>
<p>It can attach to the main process run by the container, which is not always bash.<br>
As opposed to exec, which allows you to execute <em>any</em> pro... |
<p>I have a Kubernetes cluster (external ips: 1.2.3.4, 2.3.4.5, 3.4.5.6)
I want to host a docker registry on this cluster on port 5000. Now to enable this I did a test with externalips, which works. This makes nginx available on port 85.</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: nginx-extip
spec:
... | <p>There are two problems here:</p>
<ol>
<li><p>There is a syntax error in the creation of the configmap itself. Config map expects you to list a bunch of files and their contents, so the correct syntax would look something like this:</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
name: externalips
names... |
<p>I have some openshift nodes, some nodes have some Tesla P40s and should be dedicated to ML use through nvidia device plugin. But i don't want to let users add some taints or node affinity in their original DeploymentConfigs which could lead to a messy. How could i achieve this implicitly?</p>
<p>what i want to ach... | <p>My understanding of your problem is that you're trying to do two things:</p>
<ol>
<li>Schedule GPU workloads correctly onto nodes that have GPUs available</li>
<li>Make sure pods that <em>don't</em> need GPUs are not scheduled onto nodes that <em>have</em> GPUs.</li>
</ol>
<p>You're doing (1) With the NVidia devic... |
<p>How to limit a container's network usage or bandwidth?</p>
<p>I searched the Internet but it seems no existing mature solutions.</p>
<p>I can modify the host, but cannot modify the program running in docker or docker itself. It means I can change the configurations, but not the <em>code</em> of docker that I need ... | <p><a href="https://github.com/moby/moby/issues/9607" rel="noreferrer">Docker issue 9607</a> refers to <a href="https://docs.docker.com/network/bridge/" rel="noreferrer">bridge network</a>, and <a href="https://github.com/moby/moby/issues/4763" rel="noreferrer">issue 4763</a> is still opened.</p>
<p>So this is not yet... |
<p>I am using the this plugin to run dynamic agents in a Kubernetes cluster, jenkinsci/kubernetes-plugin and so far everything is going great except for when I try and use the feature available for defining slave pods in yaml format.<a href="https://i.stack.imgur.com/XIszR.png" rel="nofollow noreferrer"><img src="https... | <p>Based on a quick look at your pipeline DSL and YAML spec. The following snippet is what a direct translation of your DSL would look like (untested).</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
labels:
label: label
spec:
containers:
- name: jnlp
image: artifactory.baorg.com:5001/sum/corei... |
<p>I am using the OpenShift Jenkins image within an OpenShift Cluster. This default Jenkins image results in a Jenkins container that is preconfigured to point to my Kubernetes cluster. Additionally, the container has two Kubernetes pod templates defined, one for maven and one for nodejs.</p>
<p><a href="https://i.sta... | <p>Here is an example using a pre-defined pod template.</p>
<pre><code>pipeline {
agent {
label "maven"
}
stages {
stage('Run maven') {
steps {
sh 'mvn -version'
}
}
}
}
</code></pre>
<p>Your original pipeline definition was in effect defining a brand new pod template and hen... |
<p>I've created a <a href="https://kubernetes.io/docs/user-guide/cron-jobs/" rel="noreferrer">Kubernetes Scheduled Job</a>, which runs twice a day according to its schedule. However, I would like to trigger it manually for testing purposes. How can I do this?</p>
| <p>The issue <a href="https://github.com/kubernetes/kubernetes/issues/47538" rel="noreferrer">#47538</a> that <a href="https://stackoverflow.com/a/46062397/2884309">@jdf mentioned</a> is now closed and this is now possible. The original implementation can be found <a href="https://github.com/kubernetes/kubernetes/commi... |
<p>I'm struggling to understand how to correctly configure kube-dns with flannel on kubernetes 1.10 and containerd as the CRI.</p>
<p>kube-dns fails to run, with the following error:</p>
<pre><code>kubectl -n kube-system logs kube-dns-595fdb6c46-9tvn9 -c kubedns
I0424 14:56:34.944476 1 dns.go:219] Waiting for [... | <p>There are two components to this answer, one about running <code>kube-proxy</code> and one about where those :443 URLs are coming from.</p>
<p>First, about <code>kube-proxy</code>: please don't run <code>kube-proxy</code> as a systemd service like that. It is designed to be launched by <code>kubelet</code> <em>in t... |
<p>I have successfully set up a kubernetes cluster on AWS using <code>kops</code> and the following commands:</p>
<pre><code>$ kops create cluster --name=<my_cluster_name> --state=s3://<my-state-bucket> --zones=eu-west-1a --node-count=2 --node-size=t2.micro --master-size=t2.small --dns-zone=<my-cluster-... | <p>I tried the same and had the same problem. It turns out that kops creates a certificate based authentication. Certificate based authentication can't be used on the web UI interface. Instead, I tried using the token based authentication. Next question, where do you find the token?</p>
<pre><code>kubectl describe sec... |
<p>I am planning to use Kubernetes and Jenkins for my microservice deployment.</p>
<p><strong>Nature Of Application</strong> </p>
<p>I have total 15 Spring Boot micro services. And need to deploy all these 15 micro services for different customers - everyone using same code, but need to deploy this all separately. Me... | <p>Several things come to mind:</p>
<ul>
<li>one master is not enough. The loss of that VM, the underlying hardware, or a failure of the services on the master will lead to an outage for all customers, and potentially catastrophic data loss. Run 3 masters at minimum.</li>
<li>each client running distinct copies of eac... |
<p>If created a service using an externalName pointing to some external service.</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: test
spec:
type: ExternalName
externalName: google.com
</code></pre>
<p>When I now try to do a DNS lookup it doesn't return anything useful:</p>
<pre><code># dig test.dev... | <p>The issue lies with the used kube-dns version 1.14.9.</p>
<p>Applying the following command to update to 1.14.10 fixed it:</p>
<pre><code>kubectl set image deployment/kube-dns -n kube-system \
kubedns=gcr.io/google_containers/k8s-dns-kube-dns-amd64:1.14.10 \
dnsmasq=gcr.io/google_containers/k8s-dns-dnsmasq-nan... |
<p>I need to debug (with chrome://inspect/ debugger) my nodejs app while it is deployed in a kubernetes pod. I tried adding a port to the service in front of the deployment but this is not working.</p>
<p>I added the port 42126</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: account-service # matches n... | <p>in the Dockerfile that creates your application, enable debugging (see line CMD)</p>
<pre><code>FROM node:9.4
WORKDIR /app
COPY ./app.js /app/app.js
COPY ./package.json /app/package.json
RUN npm install
CMD node --inspect-brk=0.0.0.0:42132 ./bin/www
</code></pre>
<p>Using the "Google Cloud Platform" website
Kubern... |
<p>Right now, I deployed some pods on my kubernetes cluster. But sometime, my image may has some bugs which make the pod cannot start correctly.</p>
<p>For example:
nats-1 0/1 CrashLoopBackOff 121 10h</p>
<p>I also cannot see any error in the kubectl log.</p>
<p>So is ther... | <p>You can <code>kubectl describe</code> to get the events, it sometimes might show some errors there. Otherwise you can probably also make the deployment/pod run a command like <code>sleep 3600</code> to keep it open for you to exec into it to investigate further.</p>
|
<p>I want to set up an Ingress, which routes traffic to my underlying Services. Unfortunately, I get an error when I deploy my ingress-controller-deployment.yaml and I don't know why... The pod with the ingress-controller crashes immediately, with the error message "CrashLoopBackOff".</p>
<p>With my understanding the ... | <p>The issue is the args. The args on one of mine are</p>
<pre><code> args:
- /nginx-ingress-controller
- --default-backend-service=$(POD_NAMESPACE)/default-http-backend
- --configmap=$(POD_NAMESPACE)/nginx-configuration
- --tcp-services-configmap=$(POD_NAMESPACE)/tcp-services
... |
<p>I have couple of questions regarding the configMap versioning.</p>
<ol>
<li><p>Is it possible to use a specific version of a configMap in the deployment file?</p></li>
<li><p>I dont see any API's to get list of versions. How to get the list of versions?</p></li>
<li>Is it possible to compare configMap b/w versions?... | <blockquote>
<p>Is it possible to use a specific version of a configMap in the deployment file?</p>
</blockquote>
<p>Not really.<br>
The closest notion of a "version" is resourceVersion, but that is not for the user to directly act upon.</p>
<p>See <a href="https://github.com/kubernetes/community/blob/master/contri... |
<p>I'm trying to set the <code>minimum-container-ttl-duration</code> property on a Kubernetes CronJob. I see a bunch of properties like this that appear to be configurable, but the documentation doesn't appear to show where, in the yml file, they can actually be set.</p>
<p>In this example yml, where would I put this ... | <p><code>minimum-container-ttl-duration</code> is not a property on <code>CronJob</code> but <strong>is a Node-level property</strong> set via a command line parameter: <code>kubelet ... --minimum-container-ttl-duration=x</code>.</p>
<p><a href="https://kubernetes.io/docs/concepts/cluster-administration/kubelet-garbag... |
<p>I am trying to run my first app with Kubernetes locally (or i should say minikube).</p>
<p>I have a pretty basic web server (one local docker image), and the official mongodb (that i would like to pull ideally from dockerhub) image.</p>
<p>I am not trying to deploy a mongodb cluster, just the minimum stuff to get ... | <p>Yes, you are right. You can expose your app as a service with <a href="https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport" rel="noreferrer">Type NodePort</a> (though it's not very clear in documentation), and your service's yaml will look like:</p>
<pre><code>apiVersion: v1
kind: Servic... |
<p>I'm at a real loss on this one. I've been attempting to get my application running with a replica set in Kubernetes for awhile. I'm setting: <code>spring.data.mongodb.uri=${MYAPP_MONGODB}:mongodb://localhost:27017/myapp</code>
in <code>application.properties</code> and using Spring Data to access my objects. </p>
<... | <p>It sounds like your secret in k8s might be setup incorrectly. I would try uploading your secrets again and decoding them to make sure they are correct. Careful for random line breaks :)</p>
|
<p>I'm trying to delete an existent job using</p>
<pre><code>kubectl delete job/job-name -n my-namespace
</code></pre>
<p>But this error is displayed</p>
<pre><code>caling the resource failed with: Job.batch "kong-loop" is invalid:
spec.template: Invalid value: api.PodTemplateSpec{...}: field is
immutable; Current r... | <p>The solution posted by @esnible does work in this scenario, but it is simpler do these steps:</p>
<ol>
<li>Delete job with cascade false</li>
</ol>
<p><code>kubectl delete job/jobname -n namespace --cascade=false</code></p>
<ol start="2">
<li>Delete any pod that exists </li>
</ol>
<p><code>kubectl delete pod/po... |
<p>I am trying to use Kubernetes and Jenkins for my deployment of micro services developed using Spring Boot. When I am exploring many YouTube videos and other documentation tutorials are using dockerhub.com as keeping published image as repository.</p>
<p>Can I deploy docker image in Kubernetes by using Jenkins docker... | <p>You do need to use <em>some</em> registry- kubernetes needs a registry URL to be able to pull and instantiate a particular image as a container in a pod. To avoid having the images themselves be publicly accessible you have 2 options:</p>
<ul>
<li>use a business account at a public registry. You can get one of thes... |
<p>I have a question related to Kubernetes networking. </p>
<p>I have a microservice (say <em>numcruncherpod</em>) running in a pod which is serving requests via port <code>9000</code>, and I have created a corresponding Service of type <code>NodePort</code> (<em>numcrunchersvc</em>) and node port which this service i... | <p>This answer is a little late, and a little long, so I ask for forgiveness before I begin. :)</p>
<p>For people not running kubernetes clusters on Cloud Providers there are 4 distinct options for exposing services running inside the cluster to the world outside.</p>
<ol>
<li><p>Service of <code>type: NodePort</code... |
<p>How can I programatically determine if a <code>job</code> has failed for good and will not retry any more? I've seen the following on failed jobs:</p>
<pre><code>status:
conditions:
- lastProbeTime: 2018-04-25T22:38:34Z
lastTransitionTime: 2018-04-25T22:38:34Z
message: Job has reach the specified backof... | <p><code>JobConditions</code> is similar as <code>PodConditions</code>. You may read about <code>PodConditions</code> in <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/" rel="nofollow noreferrer">official docs</a>.</p>
<p>Anyway, To determine a successful pod, I follow another way. Let's loo... |
<p>The Linux I have in this container is as shown below:</p>
<pre><code>root@sbolla-6c7b7589d8-5c2rb:/usr/safenet/lunaclient# uname -a
Linux sbolla-6c7b7589d8-5c2rb 3.10.0-693.5.2.el7.x86_64 #1 SMP Fri Oct 20 20:32:50 UTC 2017 x86_64 GNU/Linux
root@sbolla-6c7b7589d8-5c2rb:/usr/safenet/lunaclient#
</code></pre>
<p>I a... | <p>Looks like 2 shell expansion issues. Try:</p>
<pre><code>sshpass -p "$H_PASSWORD" scp -v $H_USERNAME@${H_HOSTNAME}:server.pem .
</code></pre>
|
<p>An SSL redirect is enabled by default in a Kubernetes NGINX ingress. How can this be disabled? Current implementation below:</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: project_name-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- http:
... | <p>Adding <code>nginx.ingress.kubernetes.io/ssl-redirect: "false"</code> to <code>annotations</code> will disable the SSL redirect:</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: project_name-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
nginx.ingr... |
<p>In Kubernates, heapster and influxdb is present with thier specific schema. I want to store pod all information in a custom database (sqlite) with my specified schema. Is it possible? If it is possible, what is the source of information for pod? How can I take it and store?</p>
| <p>Kubernetes uses etcd to store metadata about the cluster. etcd is a schemaless key-value store. Storage of cluster objects uses an object serialization scheme. </p>
<p>The code to read starts here: <a href="https://github.com/kubernetes/kubernetes/tree/2bb1e7581544b9bd059eafe6ac29775332e5a1d6/staging/src/k8s.io/api... |
<p>I would like to configure Kafka broker in Kubernetes. The docker image I am using is <code>confluentinc/cp-kafka:latest</code>. It requires <code>KAFKA_ADVERTISED_LISTENERS</code> environment variable which allows Kafka client to communicate with broker. </p>
<p>The problem is the difficulty to assign service endpo... | <p>You should let your clients connect through the service, so exposing the ip or dns of the service should work. By default services are exposed as variable names in the pod. If a dns plugin is configured dns can be used. More info: <a href="https://kubernetes.io/docs/concepts/services-networking/service/#environment-... |
<p>My understanding is that in Kubernetes, when using the Horizontal Pod Autoscaler, if the <code>targetCPUUtilizationPercentage</code> field is set to 50%, and the average CPU utilization across all the pod's replicas is above that value, the HPA will create more replicas. Once the average CPU drops below 50% for some... | <p>So you have two questions in there and let me address one by one. The first part - if a pod in a replica set is consuming let's say 10% then will Kubernetes kill that pod? The answer is Yes. Kubernetes is not looking at the individual pods but at an average of that metric across all pods in that replica set. Also th... |
<p>I'm having troubles establishing a SSL connection between a web service and a remotely hosted Postgres database. With the same cert and key files being used for the web service, I can connect to the database with tools such as pgAdmin and DataGrip. These files were downloaded from Postgres instance in the Google C... | <p>So I figured it out, I was asking the wrong question!</p>
<p>Google Cloud SQL has a proxy component for the Postgres database. Therefore, trying to connect the traditional way (the problem I was trying to solve) has been resolved by implementing proxy. Instead of dealing with whitelisting IPs, SSL certs, and such... |
<p>If i spawn a pod with </p>
<blockquote>
<p>hostNetwork: true</p>
</blockquote>
<p>and then attach to it </p>
<blockquote>
<p>kubectl exec -it my-pod-test bash</p>
</blockquote>
<p>and spawn something silly like </p>
<blockquote>
<p>nc -l < HOST_IP > 5678</p>
</blockquote>
<p>and netstat shows me</p>
... | <p>You don't say what image your pod is running, but I've had this symptom when using the <a href="https://busybox.net/" rel="nofollow noreferrer">busybox</a> <code>nc</code>, as found in images based on <a href="https://hub.docker.com/_/alpine/" rel="nofollow noreferrer">alpine</a> for instance.</p>
<p>As you will se... |
<p>I am planning to start my project but a bit confuse between choosing Amazon ECS and Kubernetes perhaps I am really a beginner with Micro-services architecture.</p>
<p>I would really appreciate if someone can show some path for deploying my docker container on a fast easier to handle platform.</p>
<p>Thanks </p>
| <p>Here a list of differences from the top of my head:</p>
<p>AWS ECS / Kubernetes:</p>
<ul>
<li><p>Proprietary AWS implementation / Open source solution</p></li>
<li><p>Runs on AWS / Supported by most cloud providers and on premise</p></li>
<li><p>Task Definitions / PODs have different features</p></li>
<li><p>Runs ... |
<p>I am trying to use Jenkins, Kubernetes and my SVN repository for implementing CI/CD pipeline for deployment of my Spring Boot micro services. When I am exploring, I found that in Jenkins+Kubernetes deployment, the Docker image is pulling from image registries. And when I exploring sample implementation, I found that... | <p>I am sorry, but I did not fully understand your question. I try to explain our CI/CD workflow. Maybe this helps.</p>
<ol>
<li>Developer commits code to GIT.</li>
<li>Jenkins automatically
<ul>
<li>checks out the repo</li>
<li>builds spring boot microservices (tests, code coverage, etc)</li>
<li>builds docker image... |
<p>we're currently trying out traefik and consider using it as ingress controller for our internal kubernetes cluster.</p>
<p>Now I wonder if it is possible to use traefik to loadbalance the kube-apiserver? We have a HA setup with 3 masters.</p>
<p>How would I proceed here?</p>
<p>Basically I just want to loadbalanc... | <p>One way to achieve this is to use the <a href="https://docs.traefik.io/configuration/backends/file/" rel="nofollow noreferrer">file provider</a> and create a static setup pointing at your API server nodes; something like this (untested)</p>
<pre><code>[file]
[backends]
[backends.backend1]
[backends.backend1.s... |
<p>I'm after an example that would do the following:</p>
<ol>
<li>Create a Kubernetes cluster on GKE via Terraform's <a href="https://www.terraform.io/docs/providers/google/r/container_cluster.html" rel="nofollow noreferrer"><code>google_container_cluster</code></a></li>
<li>... and continue creating namespaces in it,... | <p>In theory it is possible to reference resources from the GCP provider in K8S (or any other) provider in the same way you'd reference resources or data sources within the context of a single provider.</p>
<pre><code>provider "google" {
region = "us-west1"
}
data "google_compute_zones" "available" {}
resource "go... |
<p>I'm using kubernetes for deploying applications, and </p>
<pre><code>kubect logs
</code></pre>
<p>for logs viewing.
Redeployments are very often, so it's bit uncomfortable - to copy <code>pod</code> name each time to paste in log command(because end of pod name dinamically changes each time), e.g. below are comman... | <p>When you do:</p>
<p><code>kubectl get pods --namespace=testns | grep testapp</code></p>
<p>You get something like:</p>
<p><code>testapp-54d99599bc-g2gs4 1/1 Running 0 56m</code></p>
<p>So this won't go well with logs command as it has some additional data which can not be understood by... |
<p>Does anyone have a clue why ".spec.replicas" would return this strange hex value?</p>
<pre><code>kubectl get rc -o=custom-columns=NAME:metadata.name,REPLICAS:.spec.replicas
NAME REPLICAS
devopsproxy 0xc20811d328
prd-devopsproxy-rs-etl 0xc20811d448
</code></pre>
<p>Thanks,
Drew... | <p>The replicas field is a pointer: <a href="https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/api/core/v1/types.go#L3036" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/api/core/v1/types.go#L3036</a></p>
<p>It is not getting dereferenced to show... |
<p>On a single Ubuntu 14.04 box</p>
<p>I've followed the same configuration as
<a href="http://dojoblog.dellemc.com/dojo/deploy-kafka-cluster-kubernetes/" rel="nofollow noreferrer">http://dojoblog.dellemc.com/dojo/deploy-kafka-cluster-kubernetes/</a></p>
<p>I use Kubernetes version v1.10.2
( I also use apiVersion: a... | <p>Kafka broker registers an address to zookeeper via <code>KAFKA_ADVERTISED_HOST_NAME</code>. However, this address is a kubernetes cluster ip (10.106.84.132), which is only reachable within Kubernetes cluster. So a client outside the cluster can not reach Kafka broker using this address.</p>
<p>To resolve this probl... |
<p>One of the documented best practices for Kubernetes is to store the configuration in version control. It is mentioned in <a href="https://kubernetes.io/docs/concepts/configuration/overview/#general-configuration-tips" rel="nofollow noreferrer">the official best practices</a> and also summed up in <a href="https://st... | <p>You <em>can</em> use Kubernetes as your store of configuration, to your point, it's just that you probably shouldn't want to. By storing configuration as code, you get several benefits:</p>
<ul>
<li>Configuration changes get regular code reviews.</li>
<li>They get versioned, are diffable, etc.</li>
<li>They can be ... |
<p>I wanted to execute <code>kubectl exec</code> command and connect to a container, so that I can execute some commands on it.
I have set the proxy with the following command:</p>
<pre><code>kubectl proxy -p=8080 --kubeconfig=/directory_path/remote-kubeconfig &
</code></pre>
<p>proxy started running. I tried exe... | <p>I got a solution for this problem but not a good one.</p>
<p>I issued <code>--disable-filter</code> along with <code>kubectl proxy</code> command. After that, I could execute <code>kubectl exec</code> commands successfully. </p>
<p>But when I use <code>--disable-filter</code>, it is prone to vulnerability.
A me... |
<p>I have developed Spring Boot applications. I have setup admin and RabbitMQ as well as spring cloud bus. When i refresh the end points of applications, it refreshes the properties for application. </p>
<p>Can anyone please help me how to setup RabbitMQ in kubernetes now? I did research to an extent and found in few ... | <p>It depends on what you're looking to do and what tools you have available. I guess your current setup is much like that described in <a href="http://www.baeldung.com/spring-cloud-bus" rel="nofollow noreferrer">http://www.baeldung.com/spring-cloud-bus</a>. One approach to porting that to kubernetes might be to try t... |
<p>I use k8s engine on google cloud. I want to run kube-proxy on master node in order to acess my pods through services with NodePort type via master node.
How to run kube-proxy on master node?</p>
<p>I use 1.8.10-gke.0 k8s version.</p>
| <p>Moreover consider that the master node in the GKE is hosted in a <strong>managed</strong> infrastructure outside from your project and you have no control over it.</p>
<p>For example you cannot decide to run pod on the master and you cannot access or modify what is running there.</p>
<hr>
<p>In order to reach dir... |
<p>I'm having difficulty creating an nginx configuration file for a django app deployed in kubernetes.
Nginx and app are two separate containers within the same cluster. From what I understand containers can communicate with each other via 127.0.0.1:XX and via hostnames. I'm using minikube for this.
My app container is... | <p>For your particular question:</p>
<ul>
<li>containers can communicate with each other over localhost reference (127.0.0.1) only if they are two containers on the same pod, which is not your case - hence 503.</li>
<li>containers that are in different pods (as in your example) but share same namespace (say, default) ... |
<h2><strong>Background</strong></h2>
<p>I had planned to go with Service Fabric (on premises) for my service and container orchestration. But, due to internal discussions, I am giving Kubernetes a look. Mostly because it is so very popular.</p>
<p>Service Fabric has concepts called Upgrade Domains and Failure Domains... | <blockquote>
<p>A "domain" is a grouping of host nodes.</p>
</blockquote>
<p>Is not that simple, it would be more accurate if you said <strong><em>"A 'domain' is a logical grouping of resources".</em></strong></p>
<p>To understand it correctly, you have to first understand most components in isolation. I recommend ... |
<p>I'm running an ASP.NET Core API on Linux, on Kubernetes in the Google Cloud.</p>
<p>This is an API with high load, and on every request it's executing a library doing a long (1-5 seconds), CPU-intensive operation.</p>
<p>What I see is that after deployment the API works properly for a while, but after 10-20 minute... | <p>Generally speaking, long-running work is anathema for web applications. You want sub-second response times for a healthy web app. This is particularly true if the work you need to do is synchronous or CPU-bound. Async can at least free up threads during the process, but with CPU-bound work, the thread is hog-tied.</... |
<p>I'm trying to migrate a voip service using freeswitch on GKE (google cloud managed kubernetes cluster) in order to make the service scalable.</p>
<p>I have managed to migrate freeswitch to docker and get it to run.
I require a high number of ports to be open to allow the necessary traffic.
Kubernetes services do no... | <p>This is possible.
There is lecture on <a href="https://www.youtube.com/watch?v=xgx61YGSS54" rel="noreferrer">youtube</a>, check this out.</p>
<p>They implement Asterisk in kubernetes, but freeswitch should be similar.
Main problem is RTP, they solved it with RTP proxy (kamailio RTP proxy).
They also implement balan... |
<p>I'm running an ASP.NET Core API on Linux, on Kubernetes in the Google Cloud.</p>
<p>This is an API with high load, and on every request it's executing a library doing a long (1-5 seconds), CPU-intensive operation.</p>
<p>What I see is that after deployment the API works properly for a while, but after 10-20 minute... | <p>Are you sure your ASP.NET Core web app is running out of threads? It may be it is simply saturating all available pod resources, causing Kubernetes to just kill down the pod itself, and so your web app.</p>
<p>I did experience a very similar scenario with an ASP.NET Core web API running on Linux RedHat within an <a... |
<p>I have a container that will start a jetty server. It takes about 1 minutes to start
The Pod says it is started even tho the server is still starting.</p>
<p>Is there a way to wait until for the container to finish starting before the pod says it is ready?</p>
<p>I tried adding a readiness probe but it fails becau... | <p>Use <code>initialDelaySeconds</code> attribute in readinessProbe as explained at <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#define-readiness-probes" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readin... |
<p>I have a cluster running on GKE. I have my domain names registered in Cloudflare. </p>
<p>When I add/modify dns entries in Cloudflare, the propagation seems to be very fast (using tools like <a href="https://dnschecker.org/" rel="nofollow noreferrer">https://dnschecker.org/</a>). However in my gke cluster, the pods... | <p>You can change the DNS upstream nameservers [1] but keep in mind that DNS propagation can take up to 48h. Here is the example from the documentation:</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
name: kube-dns
namespace: kube-system
data:
upstreamNameservers: |
["1.1.1.1"]
</code></pre>
<p>[1]... |
<p>I am trying to configure Basic Authentication on a Nginx example with Traefik as Ingress controller.</p>
<p>I just create the secret <code>"mypasswd"</code> on the Kubernetes secrets.</p>
<p>This is the Ingress I am using:</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: nginxingress
... | <p>It is popular to use basic authentication. In reference to <a href="https://web.archive.org/web/20190529083601/https://docs.traefik.io/user-guide/kubernetes/#basic-authentication" rel="nofollow noreferrer">Kubernetes documentation</a>, you should be able to protect access to Traefik using the following steps :</p>
... |
<p>When I create a GCE ingress, Google Load Balancer does not set the health check from the readiness probe. According to the docs (<a href="https://github.com/kubernetes/ingress-gce#health-checks" rel="noreferrer">Ingress GCE health checks</a>) it should pick it up.</p>
<blockquote>
<p>Expose an arbitrary URL as a ... | <p>So apparently, you need to include the container port on the PodSpec.
Does not seem to be documented anywhere.</p>
<p>e.g.</p>
<pre><code> spec:
containers:
- name: nginx
image: nginx:1.7.9
ports:
- containerPort: 80
</code></pre>
<p>Thanks, Brian! <a href="https://github.com/k... |
<p>I have a private Docker repo with bunch of images. I am using Helm to deploy them to a Kubernetes cluster. </p>
<p>Helm values.yaml contains the repository credentials:</p>
<pre><code>image:
repository: <repo>
tag: <version tag>
pullPolicy: IfNotPresent
imageCredentials:
registry: <repo&... | <p>It depends on the output of your helm chart. You can use <code>helm template</code> to see the resulting kubernetes resources without actually deploying it. Using an image from a private docker registry comes down to two steps:</p>
<ol>
<li><p>Make sure that you have a <a href="https://kubernetes.io/docs/tasks/conf... |
<p>I'm trying to deploy an app that contains a health check endpoint. If it fails, the pod should be destroyed, but the K8s keeps the pod with Running status.</p>
<p>Config:</p>
<pre><code> readinessProbe:
httpGet:
path: /healthcheck
port: 3001
initialDelaySeconds: 5
pe... | <p>This is not what probes are meant for. LivenessProbe, in case of failure, after retrying configured number of times will "restart" the pod. Instead the ReadinessProbe is useful to indicate that the pod should not serve traffic during failure. Probes are not meant to run or abort the pod, if you need that you have to... |
<pre><code>apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: app-2993d9d2-5cb4-4f4c-a9f3-ec630036f5d0
spec:
selector:
matchLabels:
client: 2993d9d2-5cb4-4f4c-a9f3-ec630036f5d0
template:
metadata:
labels:
client: 2993d9d2-5cb4-4f4c-a9f3-ec630036f5d0
spec:
containers:
... | <p>You don’t necessarily need to use guids here, those are just lables and names...
Secondly, they refer to different things (althought some of them have to be the same in some cases):</p>
<ul>
<li>metadata name is name of Deployment in question. You will use it to reference and manipulator this specific Deployment du... |
<p>As I understand,
<a href="https://github.com/kata-containers/kata-containers" rel="noreferrer">Kata Containers</a></p>
<blockquote>
<p>Kata Container build a standard implementation of lightweight Virtual Machines (VMs) that feel and perform like containers but provide the workload isolation and security advantag... | <p>From what I gather:</p>
<p>Kata Containers</p>
<ul>
<li>Full Kernel on top of a lightweight QEMU/KVM VM
<ul>
<li>Kernel has been optimized in newer releases.</li>
</ul>
</li>
<li>Lets system calls go through freely</li>
<li>Performance penalty due to the VM layer. Not clear yet how slower or faster than gVisor</li>
... |
<p>Behind the enterprise proxy,</p>
<p>what is the proper setting for kubernetes (and docker)?</p>
<ol>
<li>when set the http_proxy, https_proxy, no_proxy</li>
</ol>
<p><code>export http_proxy="http://1.2.3.4:8080"</code></p>
<p>or</p>
<p><code>export http_proxy=http://1.2.3.4:8080</code></p>
<p>or</p>
<p><code>... | <p>We always include the scheme in our environment variables.</p>
<p>/etc/profile.d/proxy.sh:</p>
<pre><code>#!/bin/bash
export http_proxy=http://<proxy>:3128
export https_proxy=$http_proxy
export no_proxy=169.254.169.254,localhost,127.0.0.1
export HTTP_PROXY=$http_proxy
export HTTPS_PROXY=$https_proxy
export N... |
<p>I am having trouble trying to deploy my Django Application and PostgreSQL database to Kubernetes Google Cloud cluster that I've already configured.</p>
<p>I have successfully created Docker containers for my Django Application and PostgreSQL database. Here is what my docker-compose.yml file looks like:</p>
<pre><c... | <blockquote>
<p>Inside container list of dictionaries, I know that my container name should be web, but I am not sure where the image of that container is located so I do not know what should i specify as container image.</p>
</blockquote>
<ul>
<li><p>Name for container is local to the pod (you can have several cont... |
<p>Is there any way to add labels in .spec.template after a deployment has been created? So, I know this can be done </p>
<p><code>kubectl label deployment myDeployment myLabelKey=myLabelValue</code></p>
<p>But this would only add the label to <code>.metadata.labels</code>. I would like to add a label to <code>.spec.... | <p>This should be possible using the <a href="https://kubernetes.io/docs/tasks/run-application/update-api-object-kubectl-patch/" rel="nofollow noreferrer"><code>kubectl patch</code></a> command. The following patch file would add a new label to the <code>spec.template.metadata.labels</code> property:</p>
<pre><code>spe... |
<p>I am facing issues with Dynamic Storage provisioner.
I have created storage class (edited)</p>
<pre><code>kubectl get sc
NAME PROVISIONER AGE
slow kubernetes.io/aws-ebs 12m
standard (default) kubernetes.io/aws-ebs 14m
</code></pre>
<p>when i create a pvc referring... | <p>ok. I found the answer. I didnt enable the storage api as part of runtimeconfigs for apiserver</p>
<pre><code>--runtime-config=storage.k8s.io/v1=true
</code></pre>
<p>Adding the above line solved the issue</p>
|
<p>Is there any way to log this action / event?</p>
<p>It seems that if a process is using too much resources and is not the main process, it gets a SIGKILL signal. I'd like to log this action.</p>
| <p>You can use posthook to a run scripts when container is getting terminated.</p>
<p>Use that script to send notification or to log info to STDOUT.</p>
<p>Later when pod get killed, We can still get the older logs by using -p flag in kubectl logs.</p>
|
<p>With <code>helm inspect [CHART]</code> I can view the content of <code>chart.yaml</code> and <code>values.yaml</code> of a chart. Is there a way to also view the template files of a chart? Preferably through a Helm command.</p>
<p>On a sidenote: this seems like a pretty important feature to me. I would always want ... | <p><code>helm install yourchart --dry-run --debug</code></p>
<p>This will print to stdout all the rendered templates in the chart (and won't install the chart)</p>
|
<p>Scouring stack overflow solutions for similar problems did not resolve my issue, so hoping to share what I'm currently experiencing to get help debugging this.</p>
<p>So a small preface; I initially installed minikube/kubectl a couple days back. I went ahead and tried following the minikube tutorial today and am no... | <p>For posterity, the solution to this problem was to delete the</p>
<pre><code>.minikube
</code></pre>
<p>directory in the user's home directory, and then try again. Often fixes strange minikube problems. </p>
|
<p>We are creating a POC with CLIPPER. The deployment works fine with Docker in local environment, but we need to use kubernetes for the POC. We tried to deploy it in two ways:</p>
<ol>
<li>Minikube deployment</li>
<li>GKE k8 cluster deployment</li>
</ol>
<p>In both above cases: the <code>mgmt-frontend</code>, <code>... | <p>I did refresh on the gcloud creds after updating the cli to the latest version </p>
|
<p>Our cloud application consists of 3 tightly coupled Docker containers, Nginx, Web and Mongo. Currently we run these containers on a single machine. However as our users are increasing we are looking for a solution to scale. Using Kubernetes we would form a multi container pod. If we are to replicate we need to repli... | <p>Piggy-Backing on the answer of Jonah Benton:</p>
<p>While this is technically possible - your problem is not with Kubernetes it's with your Application! Let me point you the problem:</p>
<blockquote>
<p>Our cloud application consists of 3 tightly coupled Docker containers, Nginx, Web, and Mongo.</p>
</blockquote... |
<p>I'm using Docker For Desktop with the built-in Kubernetes cluster. I have installed a <code>Pod</code> that serves resources over HTTP, but I'm not sure how to access it using my browser. I have the following <code>ServiceSpec</code> that correctly routes traffic to the <code>Pod</code>:</p>
<pre><code>spec:
clus... | <p>That service will be available in your browser at <a href="http://localhost:8037" rel="noreferrer">http://localhost:8037</a></p>
<p>Note that the port <code>8037</code> corresponds to the <code>port</code> property on the <code>ServiceSpec</code> object.</p>
<p>If you are unable to reach the service at that URL, t... |
<p>I'm in the process of converting a stack to k8s. The database requires persistent storage.</p>
<p>I have used <code>kubectl create -f pv.yaml</code></p>
<p><strong>pv.yaml <em>(with edits based on @whites11's answer)</em>:</strong></p>
<pre><code>kind: PersistentVolume
apiVersion: v1
metadata:
name: pv-volume
... | <p>You need to manually bind your PV to your PVC, by adding the appropriate <code>claimRef</code> section to the PV spec.</p>
<p>In practice, edit your PV with the method you prefer, and add a section similar to this:</p>
<pre><code>claimRef:
name: mongo-persisted-storag
namespace: <your PVC namespace>
</co... |
<p>I have an application running over a POD in Kubernetes.
I would like to store some output file logs on a persistent storage volume.</p>
<p>In order to do that, I created a volume over the NFS and bound it to the POD through the related volume claim.
When I try to write or accede the shared folder I got a "permissio... | <p>If you set the proper <code>securityContext</code> for the pod configuration you can make sure the volume is mounted with proper permissions.</p>
<p>Example:</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
name: demo
spec:
securityContext:
fsGroup: 2000
volumes:
- name: task-pv-test-storage
pe... |
<p>I started a pod in kubernetes cluster which can call kubernetes api via go-sdk (like in this example: <a href="https://github.com/kubernetes/client-go/tree/master/examples/in-cluster-client-configuration" rel="nofollow noreferrer">https://github.com/kubernetes/client-go/tree/master/examples/in-cluster-client-configu... | <p>As yaml directly: no, not that I'm aware of. But if you increase the <code>kubectl</code> verbosity (<code>--v=100</code> or such), you'll see that the first thing <code>kubectl</code> does to your yaml file is convert it to json, and then <code>POST</code> <em>that</em> content to the API. So the spirit of the answ... |
<p>I am trying to implement CI/CD pipeline using Kubernetes and Jenkins. Now I am exploring about the CI part using Jenkins file, SVN repository with Docker Hub. After pushing the Docker image into registry docker hub , I need to deploy this into a Kubernetes cluster having 3 cluster master and 15 worker machine/node.<... | <p>You can use <a href="https://helm.sh/" rel="nofollow noreferrer">Kubernetes Helm</a> to define what you want to spin up, in parameterisable modules called Helm charts. Many charts are available for common software like nginx and postgresql. This allows an "infrastructure as code" way of working - declaratively speci... |
<p>I am confused when it comes to deploying PostgreSQL database of my Django application with Kubernetes. Here is how I have constructed my deployment-definition.yml file:</p>
<pre><code>apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: postgres
spec:
replicas: 1
selector:
matchLabels:
app: pos... | <p>In order to allow communication to your PostreSQL deployment in Kubernetes, you need to set up a <code>Service</code> object. If your Django app will live in the same cluster as your PostgreSQL deployment, then you will want a <code>ClusterIP</code> type service; otherwise, if your Django app lives outside of your c... |
<h1>To give you some context:</h1>
<p>I have two server environments running the same app. The first, which I intend to abandon, is a Standard Google App Engine environment that has many limitations. The second one is a Google Kubernetes cluster running my Python app with Gunicorn.</p>
<h2>Concurrency</h2>
<p>At the... | <p>What you describe appears to be an indicator that you running the Gunicorn server with the <a href="http://docs.gunicorn.org/en/stable/settings.html#worker-class" rel="noreferrer">sync worker</a> class serving an I/O bound application. Can you share your Gunicorn configuration?</p>
<p>Is it possible that Google's p... |
<p>I have a kubernetes cluster running on 2 machines (master-minion node and minion node). I want to add a new minion node without disrupting the current set up, is there a way to do it?</p>
<p>I have seen that when I try to add the new node, the services on the other nodes stops it, due to which I have to stop the se... | <p>To do this in the latest version (tested on 1.10.0) you can issue following command on the masternode:</p>
<p><code>kubeadm token create --print-join-command</code></p>
<p>It will then print out a new join command (like the one you got after <code>kubeadmn init</code>):</p>
<p><code>kubeadm join 192.168.1.101:644... |
<p>I've been banging my head against this wall on and off for a while. There is a ton of information on Kubernetes on the web, but it's all assuming so much knowledge that n00bs like me don't really have much to go on.</p>
<p>So, can anyone share a <strong>simple</strong> example of the following (as a yaml file)? All... | <p>First of all, let's clarify some apparent misconceptions. You mentioned your front-end being a React application, that will presumably run in the users browser. For this to work, your actual problem is not your back-end and front-end pods <strong>communicating with each other</strong>, but the browser needs to be ab... |
<p>Whats the best approach to provide a .kube/config file in a rest service deployed on kubernetes?</p>
<p>This will enable my service to (for example) use the kuberntes client api.</p>
<p>R</p>
| <p>Create service account:</p>
<pre><code>kubectl create serviceaccount example-sa
</code></pre>
<p>Create a role:</p>
<pre><code>kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
namespace: default
name: example-role
rules:
- apiGroups: [""] # "" indicates the core API group
resources: ["pods"]
... |
<p>I have a Jenkins instance setup using Googles <a href="https://cloud.google.com/solutions/jenkins-on-kubernetes-engine-tutorial" rel="nofollow noreferrer">Jenkins on Kubernetes</a> solution. I have not changed any of the settings of the Kubernetes Pod.</p>
<p>When I trigger a new job I am successfully able to get e... | <p>I found the reason it fails <a href="https://stackoverflow.com/a/31381323/1561176">here</a>:</p>
<blockquote>
<p>A Docker container in a Docker container uses the parent HOST's Docker daemon and hence, any volumes that are mounted in the "docker-in-docker" case is still referenced from the HOST, and not fr... |
<p>I am reading <a href="https://github.com/kubernetes/community/blob/master/contributors/design-proposals/storage/local-storage-overview.md" rel="nofollow noreferrer">local storage design</a> of kubernetes. It has a section for <code>distributed database</code> where db replicates data by itself. </p>
<p>My question ... | <p>In the local storage design, as you can read <a href="https://github.com/kubernetes/community/blob/master/contributors/design-proposals/storage/local-storage-overview.md#alice-manages-a-database-which-needs-access-to-durable-and-fast-scratch-space" rel="nofollow noreferrer">here</a>, it is used with stateful sets. S... |
<p>Is it possible for an InitContainer to change the environment variables of the application container when running inside the same Pod?</p>
<p>Note that I am looking for a detailed answer that describes the technical reasons why this is or isn't possible. Example: 'Current container technology supports environment v... | <p>No, it is not possible to just change the variables like that. One of the possible workarounds is to use an <code>EmptyDir</code> volume shared between the <code>InitContainer</code> and the main container. You can store there a the variables using a file in <code>InitContainer</code> and load them in the main conta... |
<p>I have a single kubernetes service called MyServices which hold four deployments. Each deployment is running as a single pod and each pod has its own port number.</p>
<p><a href="https://i.stack.imgur.com/zSOKs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zSOKs.png" alt="enter image descriptio... | <p>There is a way to <a href="https://stackoverflow.com/a/39260160/6309">discover all the port of Kubernetes services</a>.</p>
<p>So you could consider using <code>kubectl get svc</code>, as seen in "<a href="https://kubernetes.io/docs/tutorials/services/source-ip/#source-ip-for-services-with-type-nodeport" rel="nofol... |
<p>My Kubernetes cluster is used for running my graph database (<a href="https://docs.dgraph.io/deploy#using-kubernetes-v1-8-4" rel="nofollow noreferrer">Dgraph</a>). However, I have to load the initial dataset (1TB) that comes as different folders and files into Dgraph. </p>
<p>I've processed the data locally and can... | <p>I have one suggestion which may be quicker and more simple than the method you mention in the post.</p>
<p>Presumably you have persistent disk claims mounted to the pods which will make use of this data.</p>
<p>For example, let's say you have a persistent disk claim mounted to /mnt/data on a pod. </p>
<p>It's pos... |
<p>I'm trying to setup a volume to use with Mongo on k8s.</p>
<p>I use <code>kubectl create -f pv.yaml</code> to create the volume.</p>
<p><strong>pv.yaml:</strong></p>
<pre><code>kind: PersistentVolume
apiVersion: v1
metadata:
name: pvvolume
labels:
type: local
spec:
storageClassName: standard
capacity:... | <p>A persistent volume is just the declaration of availability of some storage inside your kubernetes cluster. There is no binding with your pod at this stage. </p>
<p>Since your pod is deployed through a <code>StatefulSet</code>, there should be in your cluster one or more <code>PersistentVolumeClaims</code> which ar... |
<p>I'm trying to install a service mesh in my Kubernetes cluster, and for that I want to accomplish the following:</p>
<ul>
<li>The service mesh pods are run as a Daemon Set, with one replica on each node.</li>
<li>The service mesh is not directly reachable from outside the cluster.</li>
<li>The application pods use t... | <p>You could put your pods in the host network space. That way you won't need any Service and your Pod will be reachable on the port you declare in the <code>PodSpec</code> on every node.</p>
<p>You could avoid external reachability by binding your service to 127.0.0.1 rather than 0.0.0.0</p>
<p>If you want to give i... |
<ul>
<li>I have tests that I run locally using a <code>docker-compose</code> environment. </li>
<li><strong>I would like to implement these tests as part of our CI using Jenkins with Kubernetes on Google Cloud</strong> (following <a href="https://cloud.google.com/solutions/jenkins-on-kubernetes-engine-tutorial" rel="no... | <p>I think the better way is to use the pure Kubernetes resources to run tests directly by Kubernetes, not by <code>docker-compose</code>.</p>
<p>You can convert your docker-compose files into Kubernetes resources using <code>kompose</code> <a href="https://kubernetes.io/docs/tools/kompose/user-guide/" rel="nofollow n... |
<p>I am trying to implement the CI/CD pipeline using Kubernetes , Jenkins with my private SVN repository. And I am planning to use Kubernetes cluster having 3 master and 15 worker machine/Node. And Using Jenkins to deploy the microservice developed using spring boot. So When I am deploying using Jenkins , How I can def... | <blockquote>
<p>How I can define which microservice need to deploy in which node in kubernetes cluster?. Do I need to specify in Pod ? Or Any other definition ?</p>
</blockquote>
<ul>
<li>As said in other answers you don't <strong>need</strong> to do this, but you <strong>can</strong> if there is any reason to do so... |
<p>Is it possible for an InitContainer to change the environment variables of the application container when running inside the same Pod?</p>
<p>Note that I am looking for a detailed answer that describes the technical reasons why this is or isn't possible. Example: 'Current container technology supports environment v... | <p>Short answer is No, they can't.</p>
<p>You can try some hack something using <a href="https://kubernetes.io/docs/tasks/configure-pod-container/share-process-namespace/" rel="nofollow noreferrer">ShareProcessNamespace</a> and <a href="https://stackoverflow.com/questions/205064/is-there-a-way-to-change-the-environmen... |
<p>I am trying to test my development helm chat deployment output using <code>--dry-run</code> option. when I run the below command its trying to connect to Kubernetes API server. </p>
<p>Is dry run option required to connect Kubernetes cluster? all I want to check the deployment yaml file output.</p>
<pre><code>hel... | <p>There is also an option to run <code>helm template ./mychart</code> to render the generated YAMLs without needing the connection to tiller.
Combined with <code>helm lint</code> it's a great set to verify validity of your chart.</p>
|
<p>I am working on a project which is deployed on Kubernetes. The system consists of multiple microservices where one of them does intense CPU work for 4-5 seconds when requested through HTTP.</p>
<p>We are in a situation where users might invoke this endpoint many times concurrently over a short period of time (possi... | <p>POD autoscaling is based on metrics that get scraped from the running pods by a tool called <code>heapster</code>. This tool, by default, scrapes data every 60 seconds. Furthermore, data scraping takes a significant amount of time (seconds) to complete (the more the PODs, the longer the required time).</p>
<p>That ... |
<p>I have a Kubernetes based application consisting of multiple services (and pods) managed with helm chart.</p>
<p>Postgres is used as a database for all services.</p>
<p>When application is upgraded to a newer version, I am running a db migration script via <code>initContainers</code>.</p>
<p>The problem occurs wh... | <blockquote>
<p>Ideal solution would be to stop all pods, run the migration and
recreate them. But I am not sure how to achieve it properly with
Kubernetes.</p>
</blockquote>
<p>I see from one of the comments that you use Helm, so I'd like to propose a solution leveraging Helm's hooks:</p>
<blockquote>
<p>Helm provides... |
<p>I have a k8s cluster of 2 hazelcast instances and one client application. Target is to have many clients and at least 2 hazelcast members.
I've set up a LoadBalancer type service in k8s to expose hazelcast instances</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: hazelcast-service
labels:
app: h... | <blockquote>
<p>Thus, I believe this is because of LoadBalancer service which distributes requests equally among target pods and that there is something wrong with this set-up.</p>
</blockquote>
<p>Yes, it is true.</p>
<blockquote>
<p>how should I configure services in k8s so that client apps can talk to all memb... |
<p><a href="http://grs-preprodkubemaster01:5601/kibana" rel="nofollow noreferrer">http://grs-preprodkubemaster01:5601/kibana</a></p>
<p>I have followed docs and installed Kibana, When I used the service as type: LoadBalancer, the service isn't
coming up, so I deleted the type: LoadBalancer and let it default to Clust... | <p>Use the NodePort you defined in your service:</p>
<pre><code>https://10.123.24.107:30887
</code></pre>
|
<p>I have a k8s cluster of 2 hazelcast instances and one client application. Target is to have many clients and at least 2 hazelcast members.
I've set up a LoadBalancer type service in k8s to expose hazelcast instances</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: hazelcast-service
labels:
app: h... | <p>If your hazelcast client is inside the kubernetes cluster, you dont really need LoadBalancer type. A simple service ClusterIP or headless would suffice. Hazelcast supports kubernetes discovery mode. I suggest try using ClusterIP or none.</p>
|
<p>I've been experimenting with <a href="https://github.com/heptio/contour" rel="nofollow noreferrer">contour</a> as an alternative ingress controller on a test GKE kubernetes cluster.</p>
<p>Following the contour <a href="https://github.com/heptio/contour/blob/master/docs/deploy-options.md" rel="nofollow noreferrer">... | <p>Probably you have GLBC ingress configured (<a href="https://github.com/kubernetes/ingress-gce/blob/master/docs/faq/gce.md#how-do-i-disable-the-gce-ingress-controller" rel="nofollow noreferrer">https://github.com/kubernetes/ingress-gce/blob/master/docs/faq/gce.md#how-do-i-disable-the-gce-ingress-controller</a>)</p>
... |
<p>I'm currently stuck and don`t know how to proceed.</p>
<p>This is my Spring Boot application.properties</p>
<pre><code>...
spring.datasource.driverClassName=org.postgresql.Driver
spring.datasource.url=jdbc:postgresql://${POSTGRES_HOST}:5432/postgres
spring.datasource.username=${POSTGRES_USER}
spring.datasource.pas... | <p>This is my deployment.yaml, which uses p12 key and password stored in Kubernetes secrets, created just like in your example. Works OK for me to make SSL curl calls. I fetch the content of p12 key and password files mounted as READ ONLY volume. Hope it helps.</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Deplo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.