prompt stringlengths 65 38.7k | response stringlengths 41 29.1k |
|---|---|
<p>I just saw some of my pods got evicted by kubernetes. What will happen to them? just hanging around like that or I have to delete them manually?</p>
| <p>A quick workaround I use, is to delete all evicted pods manually after an incident. You can use this command:</p>
<pre><code>kubectl get pods --all-namespaces -o json | jq '.items[] | select(.status.reason!=null) | select(.status.reason | contains("Evicted")) | "kubectl delete pods \(.metadata.name) -n \(.metadata.... |
<p>URL: /apis/apps/v1/namespaces/diyclientapps/deployments</p>
<blockquote>
<p>)
"{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"deployments.apps
is forbidden: User \"system:serviceaccount:default:default\" cannot
create deployments.apps in the namespace
\"diyclientapps\"","re... | <p>This is due to the RBAC functionality.</p>
<p>If you do not care about that at all (for example you're the only Kubernetes administrator):</p>
<p><strong>WARNING: This allows any Kubernetes user to have admin access.</strong></p>
<pre><code>kubectl create clusterrolebinding serviceaccounts-cluster-admin \
--cluste... |
<p>I am trying to create an S3 bucket using </p>
<p><code>aws s3api create-bucket —bucket kubernetes-aws-wthamira-io</code></p>
<p>It gives this error: </p>
<pre class="lang-sh prettyprint-override"><code>An error occurred (IllegalLocationConstraintException) when calling
the CreateBucket operation: The unspecified ... | <p>try this:</p>
<pre><code>aws s3api create-bucket --bucket kubernetes-aws-wthamira-io --create-bucket-configuration LocationConstraint=eu-west-1
</code></pre>
<p>Regions outside of <code>us-east-1</code> require the appropriate <code>LocationConstraint</code> to be specified in order to create the bucket in the des... |
<p>I've created a <code>persistentVolumeClaim</code> on my custom Kubernetes cluster, however it seems to be stuck in pending...</p>
<p>Do I need to install/configure some additional something? OR is this functionality only available on GCP / AWS?</p>
<p><strong>pvc.yaml</strong></p>
<pre><code>apiVersion: v1
kind: ... | <p>PVC is just a Claim, a declaration of ones requirements for persistent storage.</p>
<p>For PVC to bind, a PV that is matching PVC requirements must show up, and that can happen in two ways : manual provisioning (adding a PV from ie. kubectl) or with <a href="https://kubernetes.io/docs/concepts/storage/dynamic-provi... |
<p>I was trying to deploy a very basic Express app, a small server listening on 8080 on a EC2 server (Ubuntu 16.04) <a href="https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/" rel="nofollow noreferrer">following this tutorial</a>. On that server, it was created a Kubernetes cluster t... | <p>your --docker-server should be <code>index.docker.io</code></p>
<pre><code>DOCKER_REGISTRY_SERVER=https://index.docker.io/v1/
DOCKER_USER=Type your dockerhub username, same as when you `docker login`
DOCKER_EMAIL=Type your dockerhub email, same as when you `docker login`
DOCKER_PASSWORD=Type your dockerhub pw, same... |
<pre><code>$ kubectl config view
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: REDACTED
server: https://192.168.1.32:6443
name: kubernetes
</code></pre>
<p>How can I set the IP address / Port of the actual <strong>cluster</strong>? Why is this default set?</p>
<p>I'm not trying to change t... | <blockquote>
<p>--apiserver-advertise-address <strong>string</strong> The IP address the API Server will advertise it's listening on. Specify '0.0.0.0' to use the address of the default network interface.</p>
</blockquote>
<p>by providing specific IP with flags It will take the designated IP and Port respective... |
<p>When a Kubernetes pod goes into <code>CrashLoopBackOff</code> state, you will fix the underlying issue. How do you force it to be rescheduled?</p>
| <p>For apply new configuration the new pod should be created (the old one will be removed).</p>
<ul>
<li><p>If your pod was created automatically by <code>Deployment</code> or <code>DaemonSet</code> resource, this action will run automaticaly each time after you update resource's yaml.
It is not going to happen if your... |
<p>I have a Python controller which uses <code>scrapy-splash</code> lib that sends <code>SplashRequest</code> to a Splash service.</p>
<p>Locally, I run both, the controller and the splash service in a two different Dockers. </p>
<p><code>yield SplashRequest(url=response.url, callback=parse, splash_url=<URL> en... | <p>The problem is that <code>splash-service.yaml</code> selector is wrong.. it should point to the Deployment name.</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
labels:
app: app
name: splash
namespace: ns-app
spec:
type: LoadBalancer
ports:
- name: "8050"
port: 8050
targetPort: 8050
... |
<p>Everytime I make a new deployment of my app, my nodes start reporting <code>nodeHasDiskPressure</code> . After around 10 minutes or so the node goes back to a normal state. I found this SO answer regarding setting thresholds: <a href="https://stackoverflow.com/questions/42576661/diskpressure-crashing-the-node">DiskP... | <p>The kubelet option you mentioned can be added to you cluster "instance-template"</p>
<p>Make a copy of the instance-template that has been used for your cluster (instance-group) after clicked on copy before to save you can make some changes at the instance template,you can add those flags into : Instance-template -... |
<p>I have a Python controller which uses <code>scrapy-splash</code> lib that sends <code>SplashRequest</code> to a Splash service.</p>
<p>Locally, I run both, the controller and the splash service in a two different Dockers. </p>
<p><code>yield SplashRequest(url=response.url, callback=parse, splash_url=<URL> en... | <p><strong>UPDATE</strong> I noticed now that you found alone the issue, my bad.</p>
<p>I believe that as Ami Hollander is right, it is an issue with the label selector, but I would like to explain you why. </p>
<p>Consider that each time you create a <a href="https://kubernetes.io/docs/concepts/services-networking/s... |
<p>I have a mongo database in the gce . (config see below)</p>
<p>when i deploy it to a <strong>1.7.12-gke.1</strong> everything works fine. Which means the sidecar resolves the pods and links then</p>
<p>now when i deploy the same konfiguration to <strong>1.8.7-gke.1</strong> resultes in missing permissions to list... | <p>According to original solution: <a href="https://github.com/cvallance/mongo-k8s-sidecar/issues/75" rel="noreferrer">https://github.com/cvallance/mongo-k8s-sidecar/issues/75</a></p>
<p>You have to create role binding which will grant the default service account view permissions:</p>
<pre><code>apiVersion: rbac.auth... |
<p>Is it possible to do the traffic routing using the route rules as described in the image below? The traffic routing would need to happen right after the traffic enters the cluster.</p>
<p><a href="https://i.stack.imgur.com/5Y9C3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5Y9C3.png" alt="ente... | <p>UPDATE: It seems Kubernetes Ingress does not support regular expressions, see <a href="https://github.com/kubernetes/ingress-nginx/issues/1360" rel="nofollow noreferrer">https://github.com/kubernetes/ingress-nginx/issues/1360</a>. <strong>So the answer below would not work.</strong></p>
<p>I would create three diff... |
<p>I am trying below command</p>
<pre><code>kubectl exec -it sss-pod-four echo "hi" >> /mnt/sss/testnew.txt
</code></pre>
<p>But it throws error</p>
<pre><code>-bash: /mnt/sss/testnew.txt: No such file or directory
</code></pre>
<p>What is the best way to achieve this</p>
| <p>Found a similar question <a href="https://stackoverflow.com/questions/43499313/executing-multiple-commands-or-from-a-shell-script-in-a-kubernetes-pod">here</a> and below command works now</p>
<pre><code> kubectl exec -it sss-pod-four -- bash -c "echo hi > /mnt/sss/testnew.txt"
</code></pre>
|
<p>I have a yaml file which I can use to create pods. I am using the dashboard so I can simply select yaml file and it will create pods. Pod will start the container and container will run the docker image. So now lets say I have done some changes in the docker image and want to deploy it again. For this, I will delete... | <p>If you are using this for development you might get away with </p>
<pre><code>containers:
- image: my/app:dev
imagePullPolicy: Always
</code></pre>
<p>With this, whenever your pod is recreated, you will get fresh image version.</p>
<p>That said, you need to use something like Deployment to have a pod restarted ... |
<p>When I run a simple command on my local shell with gcloud sdk.</p>
<pre><code>$ kubectl get pod
</code></pre>
<p>I get such error:</p>
<blockquote>
<p>Error from server (Forbidden): pods is forbidden: User "client" cannot list pods at the cluster scope: Unknown user "client"</p>
</blockquote>
<p>The same comma... | <p>This happens when you disable Legacy Authorisation in the cluster settings, because the client certificate that you are using is a legacy authentication method. So it looks like what is happening is the client authentication succeeds but the authorisation fails, as expected. ("Unknown user" in the error message, con... |
<p>I'm running a local kubernetes bundled with docker on Mac OS.</p>
<p>How can I expose a service, so that I can access the service via a browser on my Mac?</p>
<p>I've created:</p>
<p>a) deployment including apache httpd.</p>
<p>b) service via yaml:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: a... | <p>There are several solutions to expose services in kubernetes:
<a href="http://alesnosek.com/blog/2017/02/14/accessing-kubernetes-pods-from-outside-of-the-cluster/" rel="noreferrer">http://alesnosek.com/blog/2017/02/14/accessing-kubernetes-pods-from-outside-of-the-cluster/</a></p>
<p>Here are my solutions according ... |
<p>I create a one-replica zookeeper + kafka cluster with the official kafka chart from the official incubator repo:</p>
<pre><code>helm install --name mykafka -f kafka.yaml incubator/kafka
</code></pre>
<p>This gives me two pods:</p>
<pre><code>kubectl get pods
NAME READY STATUS
mykafka-kafka-0 ... | <p>I believe what you're experiencing can be resolved by looking at how your kubelet is set up to run. There is a setting you can toggle when starting up the kubelet called <code>--hairpin-mode</code>. By default this setting is set to the string <code>promiscuous</code>, where a pod can't connect to its own service, b... |
<p>I'm having some trouble with my AWS Kubernetes instance.</p>
<p>I'm trying to get my django instances to connect to the RDS service via the DB endpoint.</p>
<pre><code>DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': os.environ['NAME'],
'USER': os.e... | <p>Assuming your AWS deployment is now in the same VPC as your RDS, then you will need to change your host to use the private IP.</p>
|
<p>I am building a Kubernetes Cluster on Azure (AKS). I have deployed it into a custom VNet using <a href="https://github.com/Azure/AKS/issues/27#issuecomment-370627500" rel="nofollow noreferrer">this</a> document. By default, the VNet that gets created when AKS is provisioned is 10.0.0.0/8. All of our infrastructures ... | <p>Right, I finally got to the bottom of this, looks like the routes back to the data centre and also to the pods need to be replicated on the GatewaySubnet as well.</p>
|
<p><strong>Versions:</strong> Kubernetes <code>v1.9.2</code> running in GCE (kube-up.sh)</p>
<p>Container-Optimized OS <code>10032.88.0</code></p>
<hr>
<p><strong>Symptom:</strong> Our COS nodes show the following in their <code>google-ip-forwarding-daemon.service</code> logs:</p>
<pre><code>Mar 07 13:43:28 kube-mi... | <p>There are too many versions between Kubernetes 1.2 and 1.9.2, why are you trying to create a very old version and then upgrade it? I followed the same Kubernetes doc and got a cluster running 1.9.3 without issues. You should try the same and verify if the issue you described persist.</p>
<p>Additionally, the image ... |
<p>I am using the Minikube environment and I have defined the max memory using</p>
<pre><code>$] minikube config set memory 2048
</code></pre>
<p>Now I want to get this memory value using the Kubernetes API call in GO.
I have tried the following,</p>
<pre><code>import (
"k8s.io/client-go/kubernetes"
"k8s.io/... | <p>This code will fetch the available memory of the first cluster</p>
<pre><code>nodeList, err := f.KubeClient.CoreV1().Nodes().List(metav1.ListOptions{})
if err == nil {
if len(nodeList.Items) > 0 {
node := &nodeList.Items[0]
memQuantity := node.Status.Allocatable[v1.ResourceMemory]
... |
<p>I am trying to execute a Python program as a background process inside a container with <code>kubectl</code> as below (<code>kubectl</code> issued on local machine):</p>
<p><code>kubectl exec -it <container_id> -- bash -c "cd some-dir && (python xxx.py --arg1 abc &)"</code></p>
<p>When I ... | <p>The <a href="https://en.wikipedia.org/wiki/Nohup#Overcoming_hanging" rel="noreferrer">nohup</a> Wikipedia page can help; you need to redirect all three IO streams (stdout, stdin and stderr) - an example with <code>yes</code>:</p>
<pre><code>kubectl exec pod -- bash -c "yes > /dev/null 2> /dev/null &"
</c... |
<p>I'm trying to setup frontend for my two web applications by using ingress controller in local kubernetes cluster. I followed all steps outlined in [1] and detailed instructions in [2]. But so far out of luck. The error I got is the following:</p>
<pre><code>Warning CreatingLoadBalancerFailed Error creating load bal... | <p>It looks like OpenStack lbaas is being used by kubernetes to provision the load balancer service underlying the ingress resource (see <code>https://host.xyz.com:9696/v2.0/lbaas/loadbalancers</code> in the error log)</p>
<p>AFAIK this error indicates a resource limit has been reached on the number of load balancers ... |
<p>I am trying to get the mount point details of host from a kuberentes pod. It is a privileged container.
Even if I mount the root file system , I am not able to check the mount details of a particular type say <code>s3fs</code>may be because it belongs to a different namespace.
What is the best way to share the mount... | <p>I did some research and found that kubernetes provides an option called <code>MountPropagation</code> which helps to achieve my requirement.</p>
<p>I tested this feature in my local set up and it did give me the result I wanted.</p>
<p>Few links that I found useful:</p>
<p><a href="https://medium.com/kokster/kube... |
<p>I installed kubernetes cluster using <em>kubeadm</em> following this <a href="https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/" rel="noreferrer">guide</a>. After some period of time, I decided to reinstall K8s but run into troubles with removing all related files and not finding any docs on offic... | <p>In my "Ubuntu 16.04", I use next steps to completely remove and clean Kubernetes (installed with "apt-get"): </p>
<pre><code>kubeadm reset
sudo apt-get purge kubeadm kubectl kubelet kubernetes-cni kube*
sudo apt-get autoremove
sudo rm -rf ~/.kube
</code></pre>
<p>And <strong>restart</strong> the computer.... |
<p>I'm currently exploring more and more of Google Cloud Platform and try to evaluate how I can change my default stack. I like the idea of using all the built-in tooling instead of having to go to various Saas products. One of the more open questions has been how to make use of Stackdriver Monitoring. I understand tha... | <p>To answer my own question, the best strategy for now seems to be using <a href="https://github.com/GoogleCloudPlatform/k8s-stackdriver/tree/master/prometheus-to-sd" rel="nofollow noreferrer">https://github.com/GoogleCloudPlatform/k8s-stackdriver/tree/master/prometheus-to-sd</a></p>
|
<p>I am trying to get the mount point details of host from a kuberentes pod. It is a privileged container.
Even if I mount the root file system , I am not able to check the mount details of a particular type say <code>s3fs</code>may be because it belongs to a different namespace.
What is the best way to share the mount... | <p>If you really just want details of the host's mount points rather than access to them you can run your Pod with <code>hostPID: true</code> and then inspect the mounts of a process in the <code>proc</code> filesystem that you know is running in the host's mount namespace (for example PID 1) like so: <code>cat /proc/1... |
<p>I am trying to get the POST and GET requests working (via Postman) but this is what I'm getting,</p>
<p><strong>GET Request</strong></p>
<pre><code>curl -X GET http://localhost:8080/api/v1/namespaces/default/pods/mypod/exec
</code></pre>
<p><strong>GET Response</strong></p>
<pre><code>{
"kind": "Status",
"ap... | <p>I think you are trying to exec into a pod. A websocket connection is required if you want to exec into a pod.</p>
<p>For a websocket connection, an http(s) call is made first, followed by an upgrade request to websocket using the <em>HTTP Upgrade</em> header.</p>
<p>curl does not support upgrade from http to websock... |
<p>When i run the kubectl version command , I get the following error message.</p>
<pre><code>kubectl version
Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.0", GitCommit:"925c127ec6b946659ad0fd596fa959be43f0cc05", GitTreeState:"clean", BuildDate:"2017-12-15T21:07:38Z", GoVersion:"go1.9.2", Compil... | <p>You can get relevant information about the client-server status by using the following command.</p>
<pre><code>kubectl config view
</code></pre>
<p>Now you can update or set k8s context accordingly with the following command.</p>
<pre><code>kubectl config use-context CONTEXT-CHOSEN-FROM-PREVIOUS-COMMAND-OUTPUT
</c... |
<p>We're trying to run a kubernetes cluster with three namespaces:</p>
<ul>
<li><code>public</code> contains services accessible to anyone</li>
<li><code>internal</code> contains services that should only be accessed by members of staff</li>
<li><code>engineering</code> contains services that should only be visible to... | <p>This error may occur when Traefik believes that no namespaces were configured; that is, the TOML configuration you outlined</p>
<pre><code>[kubernetes]
namespaces = ["engineering"]
</code></pre>
<p>is not becoming effective.</p>
<p>I can think of two reasons:</p>
<ol>
<li>In addition to the TOML configuration fi... |
<p>Is it possible to have multiple handlers in a container probe ?
Something like </p>
<pre><code>livenessProbe: {
httpGet: {
path: "/ping",
port: 9099
},
exec: {
command: [
"verify-correctness.sh",
]
}
}
</code></pre>
<hr>
<p>Update:</p>
<p>At ... | <p>It is not supported.</p>
<p>There is <a href="https://github.com/kubernetes/kubernetes/issues/37218" rel="nofollow noreferrer">an open issue</a> about this, which contains several workarounds people use.</p>
|
<p>I'm using <a href="https://github.com/rancher/rke" rel="noreferrer">rke</a> to generate a Kubernetes cluster in a private cloud. It produces a <code>kube_config_cluster.yml</code> file. Is there a way to add this config to my <code>$HOME/.kube/config</code> file?</p>
<p>Without having the .kube/config set, when usi... | <p><code>kubectl config merge</code> command is <a href="https://github.com/kubernetes/kubernetes/issues/46381" rel="noreferrer">not yet available</a>. But you can achieve a config merge by running:</p>
<p><strong>Command format:</strong></p>
<pre><code>KUBECONFIG=config1:config2 kubectl config view --flatten
</code></... |
<p>Should traffic from clients (outside world) to service inside k8s comes in through master nodes or worker nodes? and why?</p>
<p>From what i seen so far, docs are always showing LB pools consisting of master nodes instead of worker nodes. is there a reason for this?</p>
<p>in a big bluster, would it be more benefi... | <p>What do you mean the traffic goes through worker nodes or master node? You expose your service in the pods to the outside world via NodePort or LoadBalancer. So who ever hits the LoadBalancer or reach the node on a particular port would be redirected to the corresponding service. </p>
|
<p>Is it possible to use <code>gcloud container cluster create</code> to create a node pool for GKE using <strong>custom</strong> machine types (<a href="https://cloud.google.com/compute/docs/instances/creating-instance-with-custom-machine-type" rel="noreferrer">https://cloud.google.com/compute/docs/instances/creating-... | <p>Seems like you are trying to use <em>custom machine types</em> rather than <a href="https://cloud.google.com/compute/docs/machine-types#standard_machine_types" rel="noreferrer">standard machine types</a> and want to use <a href="https://cloud.google.com/sdk/gcloud/reference/container/clusters/create" rel="noreferrer... |
<p>I'm trying to do a POC where I can use kubernetes with virtual switch connection type as Internal only. I managed to start minikube and cluster.</p>
<pre><code>PS C:\WINDOWS\system32> minikube status
minikube: Running
cluster: Running
kubectl: Correctly Configured: pointing to minikube-vm at <**Any random Ip*... | <p>I found the solution for this particular issue and I would like to share with others.</p>
<p>The <strong>root cause</strong> of this issue was proxy settings our network administrator had set some proxy settings policy and that was preventing to access dashboard which was being exposed at <code>https://<**Same I... |
<p>I would like to access my Kubernetes bare-metal cluster with an exposed Nginx Ingress Controller for TLS termination. To be able to automate certificate renewal, I would like to use the Kubernetes addon <a href="https://github.com/jetstack/cert-manager" rel="nofollow noreferrer">cert-manager</a>, which is kube-lego'... | <p>The <em>tls: oversized record received</em> error was caused by a misconfigured <code>/etc/resolv.conf</code> of the Kubernetes minion. It could be resolved by editing it like this:</p>
<pre><code>$ sudo vi /etc/resolvconf/resolv.conf.d/base
</code></pre>
<p>Add nameserver list:</p>
<pre><code>nameserver 8.8.8.8
... |
<p>Kubernetes <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset" rel="nofollow noreferrer">StatefulSets</a> create internal DNS entries with stable network IDs. The docs describe this here:</p>
<blockquote>
<p>Each Pod in a StatefulSet derives its hostname from the name of the
Stateful... | <p>I would suggest you to test the following solutions and check if they can help you to achieve your goal in your particular scenario:</p>
<ul>
<li><p>The first one is for sure the easiest and I believe that you didn't implemented it for some reason and you did not reported in the question why.</p>
<p>I am talking a... |
<p>I am actually working on a development environment using Gradle, Docker, Minikube and Helm.</p>
<p>I am using a bunch of bash scripts to get things done.</p>
<p>What I achieved so far is:</p>
<ol>
<li>Gradle builds the jar using a plugin for versioning.</li>
<li>Gradle builds a docker image with the same version ... | <p>Most Helm charts contain at least the following in their <code>values.yaml</code> file, which sets a default docker image tag, and also allows the user installing/upgrading the chart to specify a different image without having to modify the chart itself.</p>
<pre><code># values.yaml
image:
repository: <docker-... |
<p>Rancher is designed (as best as I can tell) to own and run a kubernetes cluster. Rancher does provide a configuration so that kubectl can interact w/ the kubernetes cluster. Rancher seems like a nice tool. But as far as I can tell, there is no way to connect to an existing kubernetes cluster. Is there any way to do ... | <p>If you are looking for a service that can connect to an existing k8s cluster(s) then try Containership. You can use Kubectl and/or the Containership UI to manage you workloads, config maps, etc on multiple clusters.</p>
<p>Hope this helps!</p>
|
<p>I am running servers that are registering with Consul, external to my Kubernetes 1.8.x cluster. Consul is running inside my Kube cluster (configured by Helm), and is peered with an external Consul cluster. Kube-dns is configured to use the internal Consul pods as "stubDomains" with the following ConfigMap:</p>
<pre... | <p>I ended up modifying the "consul-ui" service (the one with an IP address) to expose the Consul DNS port. I copied the following from the "consul" service (the one without a cluster IP) to "consul-ui" service, in the ["spec"]["port"] section:</p>
<pre><code> {
"name": "consuldns-tcp",
"protocol": "TCP",
... |
<p>Beginners question sorry for asking i searched on google how i need to add flags to my already running kubelet i have to add the flags
--network-plugin=cni --network-plugin-dir=/etc/cni/net.d --cni-bin-dir=/opt/cni/bin</p>
<p>When i navigate to the /etc/systemd/system/kubelet.service.d/10-kubeadm.conf file these f... | <p>The kubelet by default comes with the flags you mentioned. If you have access to the nodes running this cluster, you can check the running kubelet process to check whether it started using the flags mentioned above using </p>
<pre><code>ps -ef | grep kubelet
</code></pre>
<p>You would have an output similar to thi... |
<p><strong>Is there a simple way to change the schedule of a kubernetes cronjob</strong> like <code>kubectl change cronjob my-cronjob "10 10 * * *"</code>? Or any other way without needing to do <code>kubectl apply -f deployment.yml</code>? The latter can be extremely cumbersome in a complex CI/CD setting because manua... | <p>You can update only the selected field of resourse by patching it</p>
<pre><code>patch -h
Update field(s) of a resource using strategic merge patch, a JSON merge patch, or a JSON patch.
JSON and YAML formats are accepted.
Please refer to the models in
https://htmlpreview.github.io/... |
<p>I am trying to deploy my Docker images using Kubernetes orchestration tools.When I am reading about Kubernetes, I am seeing documentation and many YouTube video tutorial of working with Kubernetes. In there I only found that creation of pods, services and creation of that .yml files. Here I have doubts and I am addi... | <ol>
<li><p>My favorite way to create clusters is <a href="https://github.com/kubernetes-incubator/kubespray#readme" rel="nofollow noreferrer">kubespray</a> because I find <a href="https://github.com/ansible/ansible#readme" rel="nofollow noreferrer">ansible</a> very easy to read and troubleshoot, unlike more monolithic... |
<p>(Using Istio 0.5.1, kubectl 1.9.1/1.9.0 for client/server, minikube 0.25.0)</p>
<p>I'm trying to get Istio EgressRules to work with Kubernetes Services, but having some trouble.</p>
<p>I tried to set up EgressRules 3 ways:</p>
<ol>
<li>An ExternalName service which points to another domain (like
www.google.com)</... | <p>The solution is:</p>
<ol>
<li>Define a Kubernetes ExternalName service to point to www.google.com</li>
<li>Do not define any EgressRules</li>
<li>Create a RouteRule to set the Host header.</li>
</ol>
<p>In your case, define an ExternalName service with the port and the protocol:</p>
<pre><code>kind: Service
apiVe... |
<p>This tutorial of Google Kubernetes Engine seems not to work.</p>
<blockquote>
<p><a href="https://cloud.google.com/kubernetes-engine/docs/tutorials/hello-app" rel="nofollow noreferrer">https://cloud.google.com/kubernetes-engine/docs/tutorials/hello-app</a></p>
</blockquote>
<pre><code>$ gcloud beta container clu... | <p>It worked well by adding <code>--zone=</code> option.</p>
<pre><code> gcloud container clusters create hello-cluster --num-nodes=3 --zone=asia-northeast1-a
</code></pre>
<p>You can find a proper zone name with the following command;</p>
<pre><code>gcloud compute zones list
</code></pre>
<p><code>NAME</code> and ... |
<p>Ok, so currently I've got kubernetes master up and running on AWS EC2 instance, and a single worker running on my laptop:</p>
<pre><code>$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
master Ready master 34d v1.9.2
worker Ready <none> 20d ... | <p>Depends of which mode you using it working different in details, but conceptually same.</p>
<p>You trying to connect to 2 different types of addresses - the pod IP address, which is accessible from the node, and the virtual IP address, which is accessible from pods in the Kubernetes cluster.</p>
<p>IP address of t... |
<p>I am trying to submit a Spark Job on Kubernetes natively using Apache Spark 2.3.
When I use a Docker image on Docker Hub (for Spark 2.2), it works:</p>
<pre><code>bin/spark-submit \
--master k8s://http://localhost:8080 \
--deploy-mode cluster \
--name spark-pi \
--class org.apache.spark.examples.Spa... | <p>I guess you using something like a <a href="https://kubernetes.io/docs/getting-started-guides/minikube/" rel="nofollow noreferrer">minikube</a> for set-up a local Kubernetes cluster and in most of cases it using a virtual machines to spawn a cluster.
So, when Kubernetes trying to pull image from <code>localhost</cod... |
<p>I have a raspberry pi cluster (one master , 3 nodes) </p>
<p>My basic image is : raspbian stretch lite</p>
<p>I already set up a basic kubernetes setup where a master can see all his nodes (kubectl get nodes) and they're all running.
I used a weave network plugin for the network communication</p>
<p>When everythi... | <p>Thank you all for responding to my question.
I solved my problem now. For anyone who has come to my question in the future the solution was as followed.</p>
<p>I cloned my raspberry pi images because i wanted a basicConfig.img for when i needed to add a new node to my cluster of when one gets down.</p>
<p>Weave ne... |
<p>I know a lot of people already had similar question, i read a few of them, but found nothing what actualy helped me so far.</p>
<p>I have a gitlab with private repo enabled, I also use Google Kubernetes Engine. I have a few Docker container in my private repo, and I want to deploy one of them to the Kubernetes Engi... | <p>Using <code>kubectl create secret docker-registry name</code> is a <a href="https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod" rel="noreferrer">right way</a> to provide credentials of private docker registry.</p>
<p><code>imagePullSecrets</code> options looking good too, if... |
<p>I created a service which works perfectly in kubernetes.</p>
<p>Then i moved the connection string to a kubernetes secret; this is my yaml config:</p>
<pre><code> env:
- name: AZURE_CONNECTION
valueFrom:
secretKeyRef:
name: azure
key: connection-string
</code></p... | <p>The reason was that the secret was base64 encoded based on a UTF16 string. </p>
<p>After encoding the secret in <strong>UTF8</strong> then Base64 everything works fine</p>
|
<p>I have a database that's running using local storage in Kubernetes. Whenever I start up the Pod with the database I would like to run a Job that can look at our backups and backfill any data that we have that isn't on the local disk.</p>
<p>I was looking at the PostStart lifecycle hook, but that just lets me run a ... | <p>You can use an <a href="https://kubernetes.io/docs/concepts/workloads/pods/init-containers/" rel="nofollow noreferrer">init container</a> that mounts in the same volumes as the main container, populates it with any missing data and then exits so the main container can start.</p>
<p>If you need the job container to ... |
<p>I got an email from google about that the Kubernetes project recently disclosed new security vulnerabilities.</p>
<p>was advised to upgrade the nodes as soon as the patch becomes available which is with the new version releases by March 16.</p>
<p>How soon should I do it or how long can I wait ? Because I need at ... | <p><a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=2017-1002101" rel="nofollow noreferrer">CVE-2017-1002101</a> affects all volume types, so to prevent the vulnerability being exploited on your cluster you'd need to deny the use of all volume types using <a href="https://kubernetes.io/docs/concepts/policy/pod-s... |
<p>I have an Intel NUC (I5) and Raspberry-Pi Model-B . I tried to create a kubernetes cluster by making the Intel-NUC as master node and Raspberry-Pi as worker node.When I try the above set up, I see that the worker node crashing all the time . Here's the output . This happens only with the above set up. If I try creat... | <p>Yes, it's possible and i've just done that for one of my customers.</p>
<p>Basically there is an issue that the KubeProxy DaemonSet deployed automatically on the master is compiled to x64 - because you wanted that the master will be x64 and the nodes will be ARM.</p>
<p>When you add ARM nodes to the cluster, the Dae... |
<p>I'm currently working on a kubernetes cluster. Cluster is working properly.
I need to establish communication between services without using proxy.
For example I have services below:</p>
<ol>
<li>worker</li>
<li>app1</li>
<li>app2</li>
<li>app3</li>
</ol>
<p>Worker needs to login to app containers directly via SSH... | <p>You'll want to create a <a href="https://kubernetes.io/docs/concepts/services-networking/service#headless-services" rel="nofollow noreferrer">headless Service</a> (<code>spec.clusterIP: None</code>) selecting your app Pods. This will create a DNS entry (something like <code>my-svc.my-namespace.svc.cluster.local</cod... |
<p>I have a docker image with the option for property file like, </p>
<pre><code>CMD java -jar /opt/test/test-service.war
--spring.config.location=file:/conf/application.properties
</code></pre>
<p>I use the <code>-v</code> volume mount in my <code>docker run</code> command as follows.</p>
<pre><code>-v /usr/xyz/pr... | <p>That should be an <strong><a href="https://kubernetes.io/docs/concepts/storage/volumes/#hostpath" rel="noreferrer">host path volume</a></strong>, illustrated with this example pod.</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
name: test-pd
spec:
containers:
- image: k8s.gcr.io/test-webserver
name: te... |
<p>Is there a way to delete previous deployments with cli?</p>
<p>When I successfully run <code>oc import-image $APPLICATION</code> a new deployment appears with a RC and after a few runs I hit the RC max and will have to manually delete the previous deployments.</p>
<p>Is there a script similar to <code>oc delete rc... | <p>Over time you can end up with alot of replication controllers, and thus you need to clean them out. You can use <code>oc delete rc <rc-num></code> or even better <code>oc adm prune</code> to do this. Checkout <code>oc adm options</code> and <code>oc adm prune --help</code> for options.</p>
<p><code>
$ oc adm ... |
<p>I understand that in Kubernetes you don't want to "tie" a pod to a host, but in certain cases you might need to. </p>
<p>In my particular case I have a DB that lives on blockstorage which is mounted to a specific host. </p>
<p>What I am trying to accomplish with Kubernetes is the equivalent of a bind-mount in Dock... | <blockquote>
<p>I want to specify the directory on the host that I need mounted in the pod</p>
</blockquote>
<p>That should be <a href="https://kubernetes.io/docs/concepts/storage/volumes/#hostpath" rel="nofollow noreferrer">documented here</a></p>
<blockquote>
<p>A hostPath volume mounts a file or directory from... |
<p>I'm trying to run a SonarQube pod in Openshift but it seems to be mounting the persistent volume with root as the owner.</p>
<p>How can we change this to a non-root user?
I created my persistent volume with 'hostPath'.</p>
<p>You can find some more information below:</p>
<pre><code>Caused by: java.nio.file.Access... | <p>You can set a specific <code>securityContext</code> to</p>
<ul>
<li>change the group of mounted filesystems</li>
<li>change the user a pod is run as</li>
<li>pass SELinux options.</li>
</ul>
<p><a href="https://docs.openshift.org/latest/install_config/persistent_storage/pod_security_context.html" rel="nofollow nor... |
<p>I am trying to mount a NFS share (outside of k8s cluster) in my container via DNS lookup, my config is as below </p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
name: service-a
spec:
containers:
- name: service-a
image: dockerregistry:5000/centOSservice-a
command: ["/bin/bash"]
args: ["/etc/... | <p>As pointed out by @Giorgio Cerruti and as referenced in <a href="https://github.com/kubernetes/kubernetes/issues/44528/" rel="nofollow noreferrer">this github ticket</a> among others this is currently not possible as the node needs to be able to resolve the DNS entry and it does not resolve kube-dns. Two possible so... |
<p>I am running Kubernetes (Minikube) on my local Mac.</p>
<p>I am trying to setup a deployment with Docker image and getting the below error. But, the hello-world deployment with the Docker image "gcr.io/google-samples/node-hello:1.0" works as expected.</p>
<p>I am able to pull the image from a console on my... | <p>Looks like DNS in your minikube is broken, that's why you cannot pull anything.</p>
<p>Here is an <a href="https://github.com/kubernetes/minikube/issues/2302" rel="nofollow noreferrer">Issue on Github</a> with the similar problem.</p>
<p>Try to update your minikube and your hypervisor (in most of cases it is Virtu... |
<p>I was testing some commands and I ran</p>
<pre><code>$ kubectl delete nodes --all
</code></pre>
<p>and it <strike>deletes</strike> de-registers all the nodes including the masters. Now I can't connect to the cluster (Well, Obviously as the master is deleted).</p>
<p>Is there a way to prevent this as anyone could ... | <p>By default, you using something like a superuser who can do anything he want with a cluster.</p>
<p>For limit access to a cluster for other users you can use <a href="https://kubernetes.io/docs/admin/authorization/rbac" rel="nofollow noreferrer">RBAC</a> authorization for. By RBAC rules you can manage access and li... |
<p>I have setup a cron job on GCP Kubernetes. It runs once per day at 10:00am.
The job runs as expected however, I don't really understand what the charts say on the GCP K8S console.</p>
<p><a href="https://i.stack.imgur.com/cwXb4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cwXb4.png" alt="enter... | <p>I reproduced your situation by that way:</p>
<ol>
<li>Created CronJob with a name "Application"</li>
<li>Added an application using Deployment with a name "Application"</li>
</ol>
<p>And now, I see on graphics of Cron Job details information not only about a cronjob itself, but also about an application.</p>
<p>S... |
<p>What is the correct way to expose a service <strong>behind</strong> an ingress. Should I use nodePort? clusterIp? something else? because most tutorials just ignore this point. and some show the service using a nodePort and then add something like "would be enough for this demo" which isn't very reassuring.</p>
| <p>Services behind an ingress may simply be ClusterIP. The only reason you'd need NodePort is if you had some external LoadBalancer or something where you needed a static port on which you can access the service inside the cluster. As ingresses route traffic within the cluster, you can just use ClusterIP.</p>
|
<p>I have been playing around with Hyperledger to make it run on Kubernetes. And I was successful to do so. The only thing which I was not happy with the solution/work-around for the container that was spun up when chaincode is instantiated by the peer. </p>
<p>Kubernetes is simply not aware of this container as it wa... | <p>I have been investigating the same issue you are having. One alternative to using the docker daemon on your kubernetes node is spinning up a new container in your Pod using DnD (Docker in docker) technique. In this way you can successfully instantiate the chaincode container in a natural way (you will be able to use... |
<p>I am familiar with docker in docker (dind) but using along with <code>microsoft/azure-cli</code> image throw <code>docker command not found</code>.</p>
<p>Here is my setup for <code>gitlab-ci.yml</code> file. I have created <code>Service Principal</code> which is used to authenticate to azure cloud and respective r... | <p>The problem is that <code>microsoft/azure-cli</code> docker image does have docker installed and the docker socket is not mounted onto the container. This the <code>docker</code> command will fail.</p>
<p>You are using the <code>microsoft/azure-cli</code> just to login to the registery. But note that you can also l... |
<p>I'm using two VMs with Atomic Host (1 Master, 1 Node; Centos Image). I want to use NFS shares from another VM (Ubuntu Server 16.04) as persistent volumes for my pods. I can mount them manually and in Kubernetes (Version 1.5.2) the persistent volumes are successfully created and bound to my PVCs. Also they are mounte... | <p>I found the solution to my problem:
By accident I found log entries, that appear everytime I try to access the NFS volumes from my pods. They say, that SELinux has blocked the access to the folder because of different security context.</p>
<p>To resolve the issue, I simply had to turn on the corresponding SELinux b... |
<p>I'm trying to deploy a app to kubernetes cluster through jenkins using <code>Kubernetes Continuous Deploy</code> plugin. I copied the config <code>.yml</code> file into jenkins machine and gave the path in the build step and I'm getting a error:</p>
<blockquote>
<p>"No matching configuration files found" </p>
</b... | <p>I saw same error on my jenkins server then i fixed it by correcting the path.</p>
<p>Can you put your .yml files to your source control. Because Kubernetes Continuous Deploy plugin will check your workspace.</p>
<p>And plugin will check your path and it will not find it. I attached images and you can see my workin... |
<p>I use io.fabric8.kubernetes-client, version 3.1.8 to do RollingUpdate of kubernetes resource. It is fine for Deployment. But I meet an exception for StatefulSet. But it is also fine if I use 'kubectl apply -f ***.yaml' for the StatefulSet.</p>
<p>Code to RollingUpdate Deployment:</p>
<pre><code>public void createO... | <p>In StatefulSet, unlike Deployment, you can update only limited number of values - <code>replicas</code>, <code>template</code>, and <code>updateStrategy</code>.</p>
<p>You issue happening because Fabric trying to update values which is impossible to update.</p>
<p>The only thing you can do is carefully prepare a n... |
<p><em>helmfile</em> was released recently and we would like to adopt it.
<a href="https://github.com/roboll/helmfile" rel="nofollow noreferrer">https://github.com/roboll/helmfile</a></p>
<p><strong>my simple helmfile:</strong></p>
<pre><code>vim charts.yaml
...
releases:
# Published chart example
- name: prome... | <p>Working example <strong>hemlfile</strong> of usage. </p>
<pre><code>cat helmfile.yaml
context: <my_context> # not mandatory I guess
releases:
# Published chart example
- name: promnorbacxubuntu # name of this release
namespace: prometheus # target namespace
chart: stable/pro... |
<p>I am really new on kubernetes. I created a kubernetes cluster with this guide <a href="https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/" rel="nofollow noreferrer">using kubeadm</a>. The cluster consists of one master node and two nodes. Since I want to access the kubernetes web UI via master apis... | <p>Based on official <a href="https://kubernetes.io/docs/reference/generated/kube-apiserver/" rel="nofollow noreferrer">documentation</a>, <code>--authentication-mode=basic</code> is not a valid option for Kubernetes 1.9 api server.</p>
<p>Try to remove it, hope it will help.</p>
<p>What about exposing your dashboard... |
<p>I'm using coreos tectonic sandbox. My deployment.yaml file contains the container which should detect the docker daemon running on host via kubernetes.
The container uses docker daemon to identify docker events. For some reason docker daemon is not getting detected. </p>
<pre><code>deployment.yaml
containers:
... | <p>For run Docker in a Docker, you have 2 options - DooD (Docker out of Docker) and DinD (Docker in Docker). I think you need a first because you need access to events on a host machine.</p>
<p>Here is a good <a href="https://applatix.com/case-docker-docker-kubernetes-part-2/" rel="nofollow noreferrer">article</a> abou... |
<p>From a quick read of the Kubernetes docs, I noticed that the kube-proxy behaves as a Level-4 proxy, and perhaps works well for TCP/IP traffic (s.a. typically HTTP traffic). </p>
<p>However, there are other protocols like SIP (that could be over TCP or UDP), RTP (that is over UDP), and core telecom network signaling... | <blockquote>
<p>Also, it is true that currently there is no known implementation (open-source or closed-source) of Ingress API, that can allow a Kubernetes cluster to handle the above listed type of traffic ?</p>
</blockquote>
<p>Probably, and this <a href="https://www.ibm.com/support/knowledgecenter/en/SS4U29/ha.ht... |
<p>How can I isolate multicast traffic in one namespace in kubernetes. Ingress policy didn't solve this, I can capture multicast traffic from different namespace.</p>
| <p>Usually, you can use <a href="https://kubernetes.io/docs/concepts/services-networking/network-policies/" rel="nofollow noreferrer">Network Policy</a> to manage it. </p>
<p>Looks like now the only one Network Provider with a support of Network Policy has the support of multicast - Weave. </p>
<p>But, based on its <... |
<p>I have created a kubernetes cluster where I have a master node and two worker nodes. I initialised master node using below command </p>
<pre><code>sudo kubeadm init --token-ttl=0 --apiserver-advertise-address=192.168.0.27
</code></pre>
<p><code>192.168.0.27</code> is the ip address of master node. Then I used the ... | <p>As @Suresh Vishnoi mentioned, it is not possible to set a DNS name in current stable versions of Kubernetes because of <a href="https://github.com/kubernetes/kubernetes/blob/d7cadf5d180277cfed7fd57d1e1a125c538bd751/cmd/kubeadm/app/util/endpoint.go#L41" rel="nofollow noreferrer">implementation</a>. </p>
<p>But, merg... |
<p>I am trying to deploy a helm chart which uses <code>PersistentVolumeClaim</code> and <code>StorageClass</code> to dynamically provision the required sotrage. This works as expected, but I can't find any configuration which allows a workflow like</p>
<pre><code>helm delete xxx
# Make some changes and repackage char... | <p><a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims" rel="nofollow noreferrer">PersistenVolumeClain</a> creating just a mapping between your actual <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/" rel="nofollow noreferrer">PersistentVolume</a> and ... |
<p>Moving from VMs to Kubernetes.</p>
<p>We are running our services on multiple VMs. Services are running on multiple VMs and have VIP in front of them. Clients will be accessing VIP and VIP will be routing traffic to services. Here, we use SSL cert for VIP and VIP to VM also using HTTPS. </p>
<p>Here the service wi... | <p>Depends on the platform where you running Kubernetes (on-premises, AWS, GKE, GCE etc.) you have several ways to do it, but I will describe a solution which will work on all platforms - Ingress with HTTPS termination on it.</p>
<p>So, in Kubernetes you can provide access to your application inside a cluster using <a... |
<p>I have one kubernetes cluster with 4 nodes and one master. I am trying to run 5 nginx pod in all nodes. Currently sometimes the scheduler runs all the pods in one machine and sometimes in different machine.</p>
<p>What happens if my node goes down and all my pods were running in same node? We need to avoid this.</p... | <h1>Use podAntiAfinity</h1>
<p><strong>Reference: <a href="https://www.manning.com/books/kubernetes-in-action" rel="noreferrer">Kubernetes in Action Chapter 16. Advanced scheduling</a></strong></p>
<p>The podAntiAfinity with <strong>requiredDuringSchedulingIgnoredDuringExecution</strong> can be used to prevent the sa... |
<p>We presently have a setup where applications within our mesos/marathon cluster want to reach out to services which may or may not reside in our mesos/marathon cluster. Ingress for external traffic into the cluster is accomplished via an Amazon ELB sitting in front of a cluster of Traefik instances, which then choose... | <p>When you are using service-to-service communication inside a cluster, you are using <code>Service</code> abstraction which is something like a static point which will road traffic to the right pods. </p>
<p>Service endpoint available only from inside a cluster by it's IP or internal DNS name, provided by internal K... |
<p>So now that k8s is integrated directly with spark in 2.3 my spark submit from the console executes correctly on a kuberenetes master without any spark master pods running, spark handles all the k8s details:</p>
<pre><code>spark-submit \
--deploy-mode cluster \
--class com.app.myApp \
--master k8s://https://my... | <p>I afraid that is impossible for Spark 2.3, if you using native Kubernetes support.</p>
<p>Based on description from <a href="https://spark.apache.org/docs/latest/running-on-kubernetes.html" rel="nofollow noreferrer">deployment instruction</a>, submission process container several steps:</p>
<ol>
<li>Spark creates ... |
<p>I'm using docker on a bare metal server. I'm pretty happy with docker-compose to configure and setup applications.</p>
<p>Still some features are missing, like configuration management and monitoring maybe there are other solutions to solve this issues but I'm a bit overwhelmed by the feature set of Kubernetes and ... | <p>I think the Kubernetes is absolutely much your requests and it is what you need.</p>
<p>Let's start one by one.</p>
<blockquote>
<p>I have the feeling that it's too much focused on Cloud platforms where Machines are created on the fly (since I only have at most few bare metal Servers)</p>
</blockquote>
<p>No, i... |
<p>I running Kubernetes cluster on premises, initialized using KubeAdm. I configured <a href="https://kubernetes.io/docs/concepts/cluster-administration/networking/#flannel" rel="noreferrer">flannel</a> networking plugin.</p>
<p>When I exposing service as a NodePort, I'm not able to receive external IP. What do I miss... | <p>You would not get an external IP when exposing service as a nodeport. Exposing Service on a Nodeport means that your service would be available on externally via the NodeIP of any node in the cluster at a random port between 30000-32767(default behaviour) . </p>
<p>In your case , the port on which your service is e... |
<p>I have the following service... </p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: mongo
labels:
app: mongo
spec:
ports:
- name: mongo
port: 27017
clusterIP: None
selector:
app: mongo
</code></pre>
<p>And the following stateful set... </p>
<pre><code>apiVersion: apps/v1
kind: Sta... | <p>Add <code>bind_ip</code> to command:</p>
<pre><code> command:
- mongod
- "--replSet"
- rs0
- "--smallfiles"
- "--noprealloc"
- "--bind_ip"
- "0.0.0.0"
</code></pre>
<p>This <a href="https://docs.mongodb.com/manual/reference/program/mongod/#core... |
<p>As far as my understanding goes, the Kubernetes engine is meant for deploying applications that can be load balanced, for example, having an application which unhashes a string. If pod-a is on high load, it would be offloaded to pod-b. Correct me if I am wrong here, since if this is false, my following question will... | <p>Is Kubernetes the right choice?</p>
<p>-</p>
<p><a href="https://www.infoworld.com/article/3173266/containers/4-reasons-you-should-use-kubernetes.html" rel="noreferrer">Kubernetes is really useful</a> to loadbalance workloads, to provide high availability in case of failure to speed up test processes, and to incre... |
<p>We are attempting to run Elasticsearch on top of a kubernetes / flannel / coreos cluster.</p>
<p>As flannel <a href="https://github.com/coreos/flannel/issues/52" rel="nofollow">does not support multicast</a>, we cannot use Zen multicast discovery to allow the nodes to find each other, form a cluster and communicate... | <p>Version 6.2.0 is supporting kubernetes auto discovery </p>
<p>update your elasticsearch.yml as following </p>
<p>discovery.zen.ping.unicast.hosts: "kubernetes service name"</p>
|
<p>guys,</p>
<p>For various projects, I'm creating single Docker environments. Each Docker container consists of Debian, Nginx, Node.js, etc. and is going to use by developers as well as in production via Google Cloud's Kubernetes. Since the Node.js/module version should be everywhere the same, I would like to restric... | <p>It is almost impossible to limit your developers to run some commands in the container if they have an access to Dockerfiles and can somehow change a build flow. </p>
<p>But, because container providing isolation and you can build a custom container for which application based on your basic image, it can be not a b... |
<p>I am using the following version:</p>
<pre><code>Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.1", GitCommit:"3a1c9449a956b6026f075fa3134ff92f7d55f812", GitTreeState:"clean", BuildDate:"2018-01-04T11:52:23Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.I... | <p>Make sure the CA used to sign the CSRs (the <code>--cluster-signing-cert-file</code> file given to kube-controller-manager) is in the <code>--client-ca-file</code> bundle given to kube-apiserver (which is what authenticates client certs presented to the apiserver)</p>
<p>Also ensure the certificate requested is a c... |
<p>I'm moving to <code>kubernetes</code> using <code>traefik</code> as my Ingress Controller.</p>
<p>I have a single backend that should respond to 3000+ websites. Depending on the host, I need to add a custom header to the request before proxy passing it to the backend.</p>
<p>I can use the <code>ingress.kubernetes.... | <p>Yes, you need to create one Ingress object per one host, if you want different headers her host.</p>
<p>You can do it by Traefik:</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: traeffic-custom-request-header
annotations:
ingress.kubernetes.io/custom-request-headers: "mycustomhe... |
<p><strong>Objective</strong></p>
<p>I want to access the redis database in kubernetes, from a function inside ibm functions using javascript.</p>
<p><strong>Question</strong></p>
<p>How do I get the right URI, when redis is running on a Pod in Kubernetes?</p>
<p><strong>Situation</strong></p>
<p>I used this sampl... | <blockquote>
<p>As far as I understand by default no password configured.</p>
</blockquote>
<p>Yes, there is no default password in that image with Redis, you are right.</p>
<p>If you following the instruction you mentioned, you will use a <code>kubectl proxy</code>, which will forward port of your Redis in cluster... |
<p>I would like to add the docker command <code>--user $(id -u):$(id -g)</code> to my <code>k8s</code>deployment definition. What is the equivalent for that in k8s? </p>
<p>args or command?</p>
<p>How the container gets started normally: </p>
<pre><code>docker run -d -p 5901:5901 -p 6901:6901 --user $(id -u):$(id -g... | <p>That was requested initially in <a href="https://github.com/kubernetes/kubernetes/issues/22179" rel="nofollow noreferrer">kubernetes issue 22179</a>.</p>
<p>Implemented partially in:</p>
<ul>
<li><a href="https://github.com/kubernetes/kubernetes/pull/52077" rel="nofollow noreferrer">PR 52077: "API Changes for R... |
<p>I want to start two maria-db pod with same persistent storage and any point of time I should be able to access both the instance and data should be in sync between them. </p>
<p>I am trying to start two mariadb instance using same volume persistent storage in kubernetes. I am able to start both the instance. I am p... | <p>You can not run two MariaDB engines on the same storage, and if I understood you right this is what you expected. Even if you'd mount an RWX volume on two pods, if you put /var/lib/mysql of containers in two separate MaraiaDB pods in the same place, it will result in a conflict between database engines. For MariaDB ... |
<p>We got OOMKilled event on our K8s pods. We want in case of such event to run Native memory analysis command BEFORE the pod is evicted. Is it possible to add such a hook?</p>
<p>Being more specific: we run with <code>-XX:NativeMemoryTracking=summary</code> JVM flag. We want to run <code>jcmd <pid> VM.native_me... | <p>Looks like it is almost impossible to handle.</p>
<p>Based on an <a href="https://github.com/kubernetes/kubernetes/issues/40157" rel="noreferrer">answer on Github</a> about a gracefully stop on OMM Kill:</p>
<blockquote>
<p>It is not possible to change OOM behavior currently. Kubernetes (or runtime) could provid... |
<p>I want to do ssh between two pods in kubernetes. </p>
<p>Can anyone tell me how to do that? </p>
| <p>Oversimplifying the answer, you can not.</p>
<p>That is, under "normal" circumstances... Your containers in pod launch single process, that is your application, be it nodejs, php, java or whatever, so they do not have a running SSH server inside their namespaces. Unless you explicitly run it by ie. running a "fat" ... |
<p>I had a problem, maybe easy but I couldn't handle this. How to remove all k8s containers and images from local machine?</p>
<pre><code>gcr.io/google_containers/k8s-dns-sidecar-amd64 Up 36 minutes k8s_sidecar_kube-dns-6fc954457d-mwgvb_kube-system_fd5ebaed-c63c-11e7-b3c8-28d24484a79b_116
gcr.io/google_c... | <p>I was working with this guide a half year ago: <a href="https://kubernetes.io/docs/getting-started-guides/minikube/" rel="nofollow noreferrer">https://kubernetes.io/docs/getting-started-guides/minikube/</a> so I guess it using VirtualBox. Maybe you know how I can check this?</p>
<p>@Remario thanks for the tip, now ... |
<p>So i have the following <a href="https://blog.openshift.com/wp-content/uploads/refarch-ocp-on-vmw-1.png" rel="nofollow noreferrer">Openshift/Origin architecture</a> installed following the official <a href="https://docs.openshift.org/3.6/install_config/install/advanced_install.html" rel="nofollow noreferrer">Openshi... | <p>I afraid there is no way to do it by standard tools without adding a custom FluentD.</p>
<p>First of all, your FluentD in a cluster <a href="https://docs.openshift.com/container-platform/3.6/install_config/aggregate_logging.html#aggregated-fluentd" rel="nofollow noreferrer">reading a container logs</a> provided by ... |
<p>So I'm basically looking for anyone that can point me in the right direction for setting up Kubernetes to perform a common computation on many work items where each work item is a separate file.</p>
<p>I have been reading the documentation <a href="https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-... | <blockquote>
<p>PersistentVolume cannot be bound to more than one pod at once.</p>
</blockquote>
<p>Whether a PV is shared among Nodes/Pods (or not) is determined by the <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes" rel="nofollow noreferrer">accessMode</a>; it's not the case ... |
<p>Say if I have a <code>rabbitmq</code> service as follows:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: my-rabbitmq
spec:
ports:
- port: 6379
selector:
app: my-rabbitmq
</code></pre>
<p>And I have another deployment:</p>
<pre><code>apiVersion: apps/v1beta1
kind: Deployment
metadata:
na... | <p>kubernetes injects environment variables for a service's host, port, protocol among others into pod containers (see <a href="https://kubernetes.io/docs/concepts/containers/container-environment-variables/" rel="nofollow noreferrer">this doc</a>). </p>
<p><code>kubectl exec <pod> printenv</code> is one way to... |
<p>I'm currently looking for simplest possible JSON log messages that would simply write a severity and a message to Stackdriver logging from a container that is run in Kubernetes Engine and is using the managed Fluentd daemon.</p>
<p>Basically I'm writing single line JSON entries as follows.</p>
<p><div class="snipp... | <p>From the information you provided I guess fluentd is passing your whole JSON as as a jsonpayload as a <a href="https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry" rel="noreferrer">logEntry</a> and providing the logName, resource type and the rest of required information from the environment variable... |
<p>We're moving all of our infrastructure to Google Kubernetes Engine (GKE) - we currently have 50+ AWS machines with lots of APIs, Services, Webapps, Database servers and more.</p>
<p>As we have already dockerized everything, it's time to start moving everything to GKE.</p>
<p>I have a question that may sound too ba... | <h2>List of consideration to be taken merely as hints, I do not pretend to describe best practice.</h2>
<ul>
<li><p>Each pod you add brings with it some <strong>overhead</strong>, but you increase in terms of flexibility and availability making failure and maintenance of nodes to be less impacting the production. </p>... |
<p>Say if I have a <code>rabbitmq</code> service as follows:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: my-rabbitmq
spec:
ports:
- port: 6379
selector:
app: my-rabbitmq
</code></pre>
<p>And I have another deployment:</p>
<pre><code>apiVersion: apps/v1beta1
kind: Deployment
metadata:
na... | <p>Reading between the lines (and I hope this helps):</p>
<p>K8s automatically creates service environment variables for you inside each pod. See <a href="https://kubernetes.io/docs/concepts/services-networking/service/#environment-variables" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-netwo... |
<p>I have a project with two microservices and gateway generated through JHipster. I deployed the project in AWS cloud using <a href="https://aws.amazon.com/quickstart/architecture/heptio-kubernetes/" rel="nofollow noreferrer">Kubernetes by Heptio on AWS</a>. Kafka container failed to start after several attempts. When... | <p>I deleted and recreated cloud formation stack in AWS. I think the issue was due to the fact that I deleted <code>kube-system</code> namespace by mistake. I think resetting <code>kube-system</code> namespace also solves the problem, but I had to make some changes to cluster so I deleted it.</p>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.