prompt stringlengths 65 38.7k | response stringlengths 41 29.1k |
|---|---|
<p>For various reasons (the primary one being that I am lazy) I want to mount my wordpress files to /var/www/html/blog rather than /var/www/html and then use the sidecar pattern to have nginx and wordpress-fpm share a directory. I mounted an emptydir to /var/www/html which I expected to be empty (Duh!) and then copy in... | <p>You're starting from the <a href="https://hub.docker.com/_/wordpress" rel="nofollow noreferrer">Docker Hub <code>wordpress</code> image</a>, which has <a href="https://github.com/docker-library/wordpress/tree/1d90641dc2075168fe59df2f02502df068cc5531/latest/php7.4/fpm-alpine" rel="nofollow noreferrer">its Docker imag... |
<p>I deployed Postgresql on Azure Kubernetes Service (AKS). It works fine.
But when I login to the pod with <code>kubectl exec -it pod_name bash</code>, it's automatically login with "<strong>postgres</strong>" user and I can't switch to the "<strong>root</strong>" user.</p>
<p>If I could able to lo... | <p>You can add pod <code>securityContext</code>. where you can set the <code>UID 0</code> which is for root user. By default then, The Pod will run as root user. <a href="https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod" rel="nofollow noreferrer">Ref</a></p>
... |
<p>The <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="noreferrer">Kubernetes Service doc</a> shows the below explanation of how Node security groups are updated for each NLB Service.</p>
<p><a href="https://i.stack.imgur.com/skGyr.png" rel="noreferrer"><img src="https://i.stack.imgur.co... | <p>The <a href="https://docs.aws.amazon.com/eks/latest/userguide/network-load-balancing.html#network-load-balancer" rel="nofollow noreferrer">EKS documentation</a> says something about this.</p>
<blockquote>
<p>For each NLB that you create Amazon EKS adds one inbound rule to the
node's security group for client traffic... |
<p>I have created a pod in Kubernetes(Google Cloud) and its streaming data via imagezmq.</p>
<p>Python code which is streaming the data(Inside Kubernetes Pod)-</p>
<pre><code>import imagezmq
sender = imagezmq.ImageSender(connect_to='tcp://127.0.0.1:5555', REQ_REP=False)
sender.send_image('rpi_name',data)
</code></pre>... | <p>I found the solution.</p>
<p>Changing the ip from 127.0.0.1 to 0.0.0. solved the issue for me.</p>
<pre><code>import imagezmq
sender = imagezmq.ImageSender(connect_to='tcp://0.0.0.0:5555', REQ_REP=False)
sender.send_image('rpi_name',data)
</code></pre>
<p>Then exposing the pod with LoadBalancer type did the work.</... |
<p>I have set up 3 node kubernetes using 3 VPS and installed rook/ceph.</p>
<p>when I run</p>
<pre><code>kubectl exec -it rook-ceph-tools-78cdfd976c-6fdct -n rook-ceph bash
ceph status
</code></pre>
<p>I get the below result</p>
<pre><code>osd: 0 osds: 0 up, 0 in
</code></pre>
<p>I tried</p>
<pre><code>ceph device ls
<... | <p>I have similar problem that OSD doesn't appear in <code>ceph status</code>, after I install and teardown for test multiple times.</p>
<p>I fixed this issue by running</p>
<pre><code>dd if=/dev/zero of=/dev/sdX bs=1M status=progress
</code></pre>
<p>to completely remove any information on such raw block disk.</p>
|
<p>I have a <code>values.yaml</code> file in which I have given <code>spring_datasource_hikari_maximum_pool_size: "10"</code></p>
<p>In <code>deployment yaml</code> I have used this value as</p>
<pre><code> - name: SPRING_DATASOURCE_HIKARI_MAXIMUM-POOL-SIZE
value: {{ .Values.spring_datasource_hikari_maxim... | <p>I was able to resolve this by using <strong>double quotes</strong> on the <code>value</code> itself in <code>deployment.yaml</code> file</p>
<pre><code>- name: SPRING_DATASOURCE_HIKARI_MAXIMUM-POOL-SIZE
value: "{{ .Values.spring_datasource_hikari_maximum_pool_size }}"
</code></pre>
<p>Since this was a <s... |
<p>I have enabled the VPA on cluster as read only mode and tried to collect the VPA recommendation data. But I could not find a good documentation or any API details specific to the Vertical Pod Autoscaling. I have found it for the Horizontal Pod Autoscaler but not for the VPA.</p>
| <p>I endup doing little different way. I used <a href="https://book.kubebuilder.io/cronjob-tutorial/gvks.html" rel="nofollow noreferrer">GVK API</a> to query using custom object API. I listed all the namespaces using corev1api and then did
<code>list_namespaced_custom_object(group="autoscaling.k8s.io", versio... |
<p>I have a next js app that I am trying to deploy to a kubernetes cluster as a deployment. Parts of the application contain axios http requests that reference an environment variable containing the value of a backend service.</p>
<p>If I am running locally, everything works fine, here is what I have in my <code>.env.l... | <p><strong>Make sure kubernetes part did the job right</strong></p>
<p>First what's needed to check if environment actually get to the pod. Your option works, however there are cases when <code>kubectl exec -it pod_name -- sh / bash</code> creates a different session and all configmaps can be reloaded again.</p>
<p>So ... |
<p>I know that <code>kubectl delete pod <pod_name></code> will remove the pod and a new pod will be auto-created if it is managed by a deployment.</p>
<p>Just want to know if there's a way to make the recreation happen before removal? Just like rolling restart one single pod with surge.</p>
| <p>There is no easy way but there is a workaround, although it requires few steps that need to be done one by one and is not error prone but I'll just show it to you to see that this can be done but <strong>you probably should not do this</strong>.</p>
<p>Let's first create a test deployment:</p>
<pre><code>$ kubectl c... |
<p>I'm currently facing a weird issue with K8S. Indeed I'm creating a container with an envFrom statement and the env variable is pulled from a secret:</p>
<pre><code>envFrom:
- secretRef:
name: my-super-secret
</code></pre>
<p>I have created the secret with the base64 encoded value, and when I echo the variable ... | <p>How did you encode the value?</p>
<p>Using this (on Mac)</p>
<pre><code>echo -n "base64encodedvalue" | base64
YmFzZTY0ZW5jb2RlZHZhbHVl
</code></pre>
<p>I can access my values just fine in my Containers, without a trailing space.</p>
<pre><code>echo YmFzZTY0ZW5jb2RlZHZhbHVl | base64 -d
base64encodedvalue
</... |
<p>I have REST API Web service on Internal GKE cluster which I would like to expose with internal HTTP load balancing.</p>
<p>Let's call this service "blue" service:
I would like to expose it in following mapping:</p>
<pre><code>http://api.xxx.yyy.internal/blue/isalive -> http://blue-service/isalive
http:/... | <p>I solved the problem and writing it here to memo it and hopefully someone will find it as useful.</p>
<ul>
<li><p>First problem is that I have mixed annotations types. one of GKE ingress controller and second for Nginx Server controller. Currently GKE ingress controller doesn't support URL rewrite feature, so I need... |
<p>I have a few yaml files that contains some values. I want to read that files while helm deploying and create configmaps for each of them.</p>
<p>I've added config file under the helm charts. ( Same level with templates folder )</p>
<p><a href="https://i.stack.imgur.com/kGOni.png" rel="nofollow noreferrer">chart stru... | <p>Fix your template, adding a separator between objects.</p>
<pre><code>{{- $files := .Files }}
{{- range $key, $value := .Files }}
{{- if hasPrefix "config/" $key }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ $key | trimPrefix "config/" | replace ".yaml" "" | replace... |
<p>I've configured my cluster and node pools for Workload Identity (<a href="https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity" rel="nofollow noreferrer">https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity</a>) but in order to get it to work, I need to also make my pods use t... | <p><code>serviceAccountName</code> is a property of the pod spec object, not the container. So, it should be:</p>
<pre><code>spec:
replicas: 3
selector:
matchLabels:
app: my-application
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
met... |
<p>I am deploying a EKS cluster to AWS and using alb ingress controller points to my K8S service. The ingress spec is shown as below.</p>
<p>There are two targets <code>path: /*</code> and <code>path: /es/*</code>. And I also configured <code>alb.ingress.kubernetes.io/auth-type</code> to use <code>cognito</code> as aut... | <p>This question comes up a lot, so I guess it needs to be PR-ed into their documentation.</p>
<p>Ingress resources are cumulative, so you can separate your paths into two separate Ingress resources in order to annotate each one differently. They will be combined with all other Ingress resources across the entire clust... |
<p>I am using K8s ManagedCertificate to create a certificate on GCE. I wanted to add a new subdomain to my cert, so update the yaml file and did kubectl apply. I tried to describe my cert to see if everything is ok but found an error</p>
<pre><code>Warning BackendError 16m (x144 over 36h) managed-certificate-control... | <p>As John Hanley mentioned you can't update SSL cert. <a href="https://cloud.google.com/compute/docs/reference/rest/v1/sslCertificates#methods" rel="noreferrer">Google API for SSL cert doesn't have an update method</a>. So deleted the resource using <code>kubectl delete -f <cert>.yaml</code> and created it again... |
<p>our autoscaling (horizontal and vertical) works pretty fine, except the downscaling is not working somehow (yeah, we checked the usual suspects like <a href="https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#i-have-a-couple-of-nodes-with-low-utilization-but-they-are-not-scaled-down-why" ... | <blockquote>
<p>Is it possible in general that the auto scaler starts an extra pod on the free node and removes the old pod from the old node?</p>
</blockquote>
<p>Yes, that should be possible in general, but in order for the cluster autoscaler to remove a node, it must be possible to move <strong>all pods</strong> run... |
<p>I have a problem with a simple react app that was created using <code>npx create-react-app react-app</code>. Once deployed on k8s, I got this:</p>
<p><code>Uncaught SyntaxError: Unexpected token '<'</code></p>
<p>However, if I would to <code>kubectl port-forward</code> to the pod and view the app at localhost:3... | <p>I ran into the same issue as you have described. I solved it by splitting up the Ingress for the front-end and the API.</p>
<p>In your case this would look something like this:</p>
<p>Front-end ingress service (without rewrite target):</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ori... |
<p>I am trying out the Kubernetes NFS volume claim in a replication controller example [1].</p>
<p>I have setup the NFS server, PV and PVC. And my replication controller looks like this</p>
<pre><code>apiVersion: v1
kind: ReplicationController
metadata:
name: node-manager
labels:
name: node-manager
spec:
re... | <p>I had the same problem then realized that nfs-server.service status is disabled. After activating, the problem has been solved.</p>
|
<p>I am trying to deploy Windows Container image on the following software stack</p>
<pre><code>Windows 10 Pro + Docker Desktop + Embedded Kubernetes in docker desktop
</code></pre>
<p>Due to some reason <code>'embedded kubernetes'</code> does not recognize <code>'local images'</code> no matter whatever <code>--image-p... | <p>Allthough <code>imagePullPolicy: never</code> should do the trick for you, there could be some certificate related issues.</p>
<p>Personally I avoided using locally built Docker images because of those issues.</p>
<p>You can try to integrate docker push to docker hub in your workflow or build a docker registry in yo... |
<p>I want to understand who has created a namespace and who has access to a specific namespace in Openshift.</p>
<p>This is specifically required as would require to block access and be very selective about access.</p>
| <p>Who has created a specific namespace in OpenShift, can be found checking the parent Project annotations:</p>
<pre><code>$ oc describe project example-project
Name: example-project
Created: 15 months ago
Labels: <none>
Annotations: alm-manager=operator-lifecycle-manager.olm-oper... |
<p>We are using client-go to create kubernetes jobs and deployments. Today in one of our cluster (kubernetes v1.18.19), I encounter below weird problem.</p>
<p>Pods of kubernetes Job are always stuck in Pending status, without any reasons. <code>kubectl describe pod</code> shows there are no events. Creating Jobs from ... | <p>I fixed the issue.</p>
<p>We use a custom scheduler for NPU devices and default scheduler for GPU devices. For GPU devices, the scheduler name is "default-scheduler" other than "default". I passed "default" for those kube Jobs, this causes the pods to stuck in pending.</p>
|
<p>I started looking more closely to kubernetes, containers and virtualization technologies since my employer has decided to move everything to Azure and AKS.</p>
<p>From what I understand, everything in AKS will be running <a href="https://learn.microsoft.com/en-us/azure/aks/concepts-clusters-workloads#nodes-and-node-... | <p>A (Linux) container is a set of 1 or more processes that are isolated from the rest of the system through <a href="https://en.wikipedia.org/wiki/Linux_namespaces" rel="nofollow noreferrer">Linux namespaces</a>. Namespaces are a feature of the Linux kernel that partitions kernel resources (mounts, network devices etc... |
<p>I have a set of Pods running commands that can take up to a couple seconds. There is a process that keeps track of open request & which Pod the request is running on. I'd like the use that information when scaling down pods - either by specifying which pods to try to leave up, or specifying which pods to shut ... | <p>You can annotation specific pod with <code>controller.kubernetes.io/pod-deletion-cost: -999</code> and enable <code>PodDeletionCost</code> featuregate. This feature is implement alpha in 1.21 and beta in 1.22.</p>
<blockquote>
<p><code>controller.kubernetes.io/pod-deletion-cost</code> annotation can be set to offer... |
<p>I tried to configure envoy in my kubernetes cluster by following this example: <a href="https://www.envoyproxy.io/docs/envoy/latest/start/quick-start/configuration-dynamic-filesystem" rel="nofollow noreferrer">https://www.envoyproxy.io/docs/envoy/latest/start/quick-start/configuration-dynamic-filesystem</a></p>
<p>M... | <p>I think the answer to your issue is that the filesystem events that Envoy uses to reload its xDS config are not triggered by configmap volumes. <a href="https://github.com/mumoshu/crossover#why-not-use-configmap-volumes" rel="nofollow noreferrer">See more explanation in the README for the crossover utility.</a></p>
|
<p>I notice that when the job for a certain pod is finished running, and when I access this Kubernestes Engine > Workloads page. I don't see data on CPU, Memory usage anymore. Could you please let me know if there is a way to have this information for the succeeded jobs? The tester team needs to monitor the CPU and ... | <p>You can use Monitoring > Metrics Explorer, here: <a href="https://console.cloud.google.com/monitoring/metrics-explorer" rel="nofollow noreferrer">https://console.cloud.google.com/monitoring/metrics-explorer</a> .</p>
<p>A job is going to create a pod so you can explore metrics like <code>container/cpu/limit_utili... |
<p>I need to find out if all deployments having label=a is in READY state? Example is below. I need to return true or false based on wether all deployments are in READY or NOT ready? I can parse text but I think there might be a more clever way with just kubectl and json path or something</p>
<pre><code>PS C:\Users\art... | <p>Add <code>-o yaml</code> to see the YAML objects for each, which you can then use to build a <code>-o jsonpath</code> like <code>-o jsonpath='{range .items[*]}{.status.conditions[?(@.type == "Available")].status}{"\n"}{end}'</code>. You can't do logic operations in JSONPath so you'll need to filt... |
<p>I am trying to install and configure Airflow on MAC via pip and venv. using this tutorial: <a href="https://my330space.wordpress.com/2019/12/20/how-to-install-apache-airflow-on-mac/" rel="nofollow noreferrer">https://my330space.wordpress.com/2019/12/20/how-to-install-apache-airflow-on-mac/</a>. I am at the point wer... | <p>I found out that I had a permission error and then used sudo python -m pip install apache-airflow-providers-cncf-kubernetes which solved this issue.</p>
|
<p>I'm trying to scale my Statefulset object horizontally using KEDA with K8S.</p>
<p>I put in the 'deploymentName' key the value of my Statfulset name but the scaling is not taking into action.</p>
<p>Is KEDA suuport it?</p>
<pre><code>apiVersion: keda.k8s.io/v1alpha1
kind: ScaledObject
metadata:
name: test
nam... | <p>Yes it support Statefulset
you have to mention it explicitly under .spec.scaleTargetRef
go through <a href="https://keda.sh/docs/2.3/concepts/scaling-deployments/" rel="nofollow noreferrer">scaledObject</a></p>
|
<p>I would like to run a shell script inside the Kubernetes using CronJob, here is my CronJon.yaml file :</p>
<pre><code>apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: hello
spec:
schedule: "*/1 * * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name... | <p>As correctly pointed out in the comments, you need to provide the script file in order to execute it via your <code>CronJob</code>. You can do that by mounting the file within a <a href="https://kubernetes.io/docs/concepts/storage/volumes/" rel="nofollow noreferrer">volume</a>. For example, your <code>CronJob</code>... |
<p>I am trying to run spark from jupyterhub against a eks cluster that uses IRSA.I followed examples presented in
<a href="https://stackoverflow.com/questions/64625111/aws-eks-spark-3-0-hadoop-3-2-error-noclassdeffounderror-com-amazonaws-servic">AWS EKS Spark 3.0, Hadoop 3.2 Error - NoClassDefFoundError: com/amazonaws/... | <p>Identified the issue was the aws region associated with spark pods.Included was region variable on the base spark docker image and the issue got resolved</p>
|
<p>Currently I'm using microk8s to run local cluster.
<br />
When I run <code>k get pods -A</code>, this result shown</p>
<pre><code>...
kube-system kubernetes-dashboard-7ffd448895-56tlr 1/1 Running 1 3d14h
...
</code></pre>
<p>Ok.. It means there's a pod kubernetes-dashboard running in kube-sys... | <p>The result of <code>k get pods -A</code> indicates that the pod is in the namespace <code>kube-system</code>. Unless a resource is in the default namespace, you must specify the namespace:</p>
<pre><code>k port-forward -n kube-system kubernetes-dashboard-7ffd448895-56tlr 10443:443
</code></pre>
<p>Alternatively, you... |
<p>I have set up an Arango instance on Kubernetes nodes, which were installed on a VM, as mentioned in the ArangoDB docs <a href="https://www.arangodb.com/docs/stable/tutorials-kubernetes.html" rel="nofollow noreferrer">ArangoDB on Kubernetes</a>. Keep in mind, I skipped the <code>ArangoLocalStorage</code> and <code>Ar... | <p>Posting this community wiki answer to point to the github issue that this issue/question was resolved.</p>
<p>Feel free to edit/expand.</p>
<hr />
<p>Link to github:</p>
<ul>
<li><em><a href="https://github.com/arangodb/kube-arangodb/issues/734" rel="nofollow noreferrer">Github.com: Arangodb: Kube-arangodb: Issues: ... |
<p>Hi guys I have an error and I can't find the answer. I am trying to deploy a very simple MySQL deployment:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: mysql
name: mysql
spec:
replicas: 1
selector:
matchLabels:
app: mysql
template:
metadata:
labels:
... | <p>Answered in comments, the password was corrupted which threw off the setup scripts.</p>
|
<p>I am re-designing a dotnet backend api using the CQRS approach. This question is about how to handle the Query side in the context of a Kubernetes deployment.</p>
<p>I am thinking of using MongoDb as the Query Database. The app is dotnet webapi app. So what would be the best approach:</p>
<ol>
<li><p>Create a sid... | <p>I would start with the most simple approach and that is to place the write and read side together because they belong to the same bounded context.</p>
<p>Then in the future if it is needed, then I would consider adding more read side or scaling out to other regions.</p>
<p>To get started I would also consider adding... |
<p>I am running Kafka on Kubernetes using the Kafka Strimzi operator. I am using incremental sticky rebalance strategy by configuring my consumers with the following:</p>
<pre><code>ConsumerConfig.PARTITION_ASSIGNMENT_STRATEGY_CONFIG,
org.apache.kafka.clients.consumer.CooperativeStickyAssignor.class.getName()
</... | <p>The consumer rebalance happens whenever there is a change in the metadata information of a consumer group.</p>
<p>Adding more consumers (scaling in your words) in a group is one such change and triggers a rebalance. During this change, each consumer will be re-assigned partitions and therefore will not know which of... |
<p>I was having ingress installed but I got some error so I tried to reinstall niginx
I run that first comment</p>
<pre><code>kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.47.0/deploy/static/provider/aws/deploy.yaml
</code></pre>
<p>but as I have a custom configuration I trie... | <p>This happens cause I install nginx twice in different namespaces</p>
<p>I fixed it by remove helm install</p>
|
<p>I have built a ASP.NET Core <a href="https://learn.microsoft.com/en-us/aspnet/core/fundamentals/host/hosted-services?view=aspnetcore-5.0&tabs=visual-studio" rel="noreferrer">Worker Service</a> (it processes messages off a queue) that is running on kubernetes. Since it is a background service, it currently does n... | <p>Thanks to the pointers of @pinkfloydx33 I was able to build this solution:</p>
<p>Program.cs</p>
<pre><code>public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureServices((hostContext, services) =>
{
services.AddHealthChecks() // Register s... |
<p>Small question regarding Kubernetes, and the kubectl command please.</p>
<p>Currently, I perform three separate actions:</p>
<p>action 1:
<code>kubectl -n=mynamespace apply -f /path/to/manifest.yml</code></p>
<p>Based on the successful creation, when I see the <code>created</code> I perform action 2, in order to ret... | <p>Not really. There is <code>kubectl run -i</code> but I don't think that's what you're looking for? Really the answer is "don't". <code>kubectl exec</code> is intended only for very rare debugging use and if you're doing it enough to be annoyed, something is probably very very wrong with your workflow. What... |
<p>I would like to monitor all ELK service running in our kubernetes clusters to be sure, that is still running properly.</p>
<p>I am able to monitor Kibana portal via URL. ElasticSearch via Prometheus and his metrics (ES have some interested metrics to be sure, that ES is working well).</p>
<p>But exist something simi... | <p>There is an exporter for ElasticSearch found here: <a href="https://github.com/prometheus-community/elasticsearch_exporter" rel="nofollow noreferrer">https://github.com/prometheus-community/elasticsearch_exporter</a> and an exporter for Kibana found here: <a href="https://github.com/pjhampton/kibana-prometheus-expor... |
<p>I am upgrading Airflow from version 1.10 to 2.1.0. My project uses <code>KubernetesPodOperator</code> to run tasks on <code>KubernetesExecutor</code>. All were working fine in Airflow 1.10. But when I upgraded Airflow 2.1.0, pods were able to run the tasks and after successful completion, it is restarting with <code... | <pre><code>restartPolicy: Always
</code></pre>
<p><strong>Always means that the container will be restarted even if it exited with a zero exit code (i.e. successfully).</strong> You can explicitly specify <code>restartPolicy: Never</code>. It Always by default</p>
<p>Check <a href="https://stackoverflow.com/a/66922296/... |
<p>I have a Jenkins pipeline using the kubernetes plugin to run a <a href="https://github.com/docker-library/docker/blob/65fab2cd767c10f22ee66afa919eda80dbdc8872/18.09/dind/Dockerfile" rel="nofollow noreferrer">docker in docker</a> container and build images:</p>
<pre><code>pipeline {
agent {
kubernetes {
... | <p>First of all, I think the way you think it can be achieved natively in kubernetes - wouldn't work. You either have to re-use same PVC which will make build pods to access same PV concurrently, or if you want to have a PV per build - your PVs will be stuck in <code>Released</code> status and not automatically availab... |
<p>When I check the definition of "WebhookClientConfig" of API of Kubernetes I found comments like this:</p>
<pre><code>// `caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate.
// If unspecified, system trust roots on the apiserver are used.
// +optional
CABund... | <p>It is a good practice to use secure network connections. A Webhook-endpoint in Kubernetes is typically an endpoint in a private network. A custom private CABundle can be used to generate the TLS certificate to achieve a secure <a href="https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-cont... |
<p>I have a kubernetes cluster and i have more than 15 microservices running in it, Each REST API send me a custom header lets say "version":"1.2.0", i need to check this version from each REST api and throw a custom error if it doesn't match with the value i have.</p>
<p>Suppose i have a mobile app... | <p>With <code>Nginx ingress</code>, you will be able to inject the secret into the request if it's coming outside and forward request to service</p>
<pre><code>nginx.ingress.kubernetes.io/configuration-snippet: |
proxy_set_header My-Custom-Header $http_my_custom_header;
</code></pre>
<p>since as your all microservice... |
<p>I am trying to use a TPU with Google Cloud's Kubernetes engine. My code returns several errors when I try to initialize the TPU, and any other operations only run on the CPU. To run this program, I am transferring a Python file from my Dockerhub workspace to Kubernetes, then executing it on a single v2 preemptible T... | <p>There are actually no errors in this workload you've provided or the logs. A few comments which I think might help:</p>
<ul>
<li><code>pip install tensorflow</code> as you have noted installs <code>tensorflow-gpu</code>. By default, it tries to run GPU specific initializations and fails (<code>failed call to cuInit:... |
<p>I understood kube-proxy can run in iptables or ipvs mode. Also, calico sets up iptables rules.</p>
<p>But does calico iptables rules are only installed when kube proxy is running in iptables mode OR these iptables rules are installed irrespective to kube-proxy mode?</p>
| <p>According to the <a href="https://docs.projectcalico.org/networking/enabling-ipvs" rel="nofollow noreferrer">documentation</a>:</p>
<blockquote>
<p>Calico ipvs support is activated automatically if Calico detects that
kube-proxy is running in that mode.</p>
</blockquote>
|
<p>My custom definition</p>
<pre><code>apiVersion: something.com/v1alpha1
kind: MyKind
metadata:
name: test
spec:
size: 1
image: myimage
</code></pre>
<p><a href="https://stackoverflow.com/questions/64297139/createdeployment-with-kubernetes-javascript-client">Here</a> is an answer that shows how to crea... | <pre><code>const k8s = require('@kubernetes/client-node')
const kc = new k8s.KubeConfig();
kc.loadFromDefault();
const k8sClient = kc.makeApiClient(k8s.CustomObjectsApi);
var body = {
"apiVersion": "something.com/v1alpha1",
"kind": "MyKind",
"metadata": {
... |
<p>I would like to know if there is a possibility to apply liveness and readiness probe check to multiples containers in a pod or just for one container in a pod.
I did try checking with multiple containers but the probe check fails for container A and passes for container B in a pod.</p>
| <p>Welcome to the community.</p>
<p><strong>Answer</strong></p>
<p>It's absolutely possible to apply multiple probes for containers within the pod. What happens next depends on a probe.</p>
<p>There are three probes listed in <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes" r... |
<p>I'm trying to run a tomcat container in K8S with a non-root user, to do so I set User 'tomcat' with the appropriate permission in Docker Image. I have a startup script that creates a directory in /opt/var/logs (during container startup) and also starts tomcat service.</p>
<pre><code>#steps in Dockerfile
#adding tomc... | <p>You need to set the <code>fsGroup</code> to <code>1001</code> which is the <code>runAsGroup</code>.</p>
<p>When any volume mount in any path, by default the owner of the mounted directory is root. you can't change the owner of the mounted path in K8s world. But In k8S You have permission to set the group ID with FsG... |
<p>I am trying to create a Kubernetes deployment from local docker images. And using imagePullPolicy as <strong>Never</strong> such that Kubernetes would pick it up from local docker image imported via tar.</p>
<p><strong>Environment</strong></p>
<ul>
<li>
<pre><code> SingleNodeMaster # one node deployment
</code></pr... | <p>This happens due to container runtime being different than docker. I am using containerd , after switching container runtime to docker , it started working.</p>
|
<p>I would like from time to time delete all my pods or replicaset to have a clean reboot of my services.</p>
<p>For example on my cluster I have</p>
<ul>
<li>service-1 (deployment)</li>
<li>service-2 (deployment)</li>
<li>app-1 (deployment)</li>
<li>app-2 (deployment)</li>
</ul>
<p>Each deployment have a replicaset an... | <p>to recreate the pods of your deployment use command: <code>kubectl rollout restart ${RESOURCENAME}</code> where resourcename is the name of the deployment</p>
|
<p>In the <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/verticalpodautoscaler" rel="nofollow noreferrer">google documentation</a>, it says that:</p>
<blockquote>
<p>Vertical Pod autoscaling frees you from having to think about what
values to specify for a container’s CPU <strong>requests and limits<... | <p>VPA is capable of setting the limit when you set the <code>controlledValues</code> to <code>RequestAndLimits</code> option. However, it does not recommend what the limit should be. With this requests are being calculated based on actual values where limits are calculated based on the current pod's requests and limi... |
<p>I want to add a new control plane node into the cluster.</p>
<p>So, I run in an existing control plane server:
<code>kubeadm token create --print-join-command</code></p>
<p>I run this command in new control plane node:</p>
<pre><code>kubeadm join 10.0.0.151:8443 --token m3g8pf.gdop9wz08yhd7a8a --discovery-token-ca-c... | <p>You also need to pass the <code>--config</code> flag to your <code>kubeadm init phase</code> command (use <code>sudo</code> if needed). So instead of:</p>
<pre><code>kubeadm init phase upload-certs --upload-certs
</code></pre>
<p>you should for example run:</p>
<pre><code>kubeadm init phase upload-certs --upload-cer... |
<p>As the title suggests, GCP-LB or the HAProxy Ingress Controller Service which is exposed as type LoadBalancer is distributing traffic unevenly to HAProxy Ingress Controller Pods.</p>
<p><strong>Setup:</strong><br />
I am running the GKE cluster in GCP, and using HAProxy as the ingress controller.<br />
The HAProxy S... | <p>Kubernetes is integrated with GCP Load Balancer. K8s provides primitives such as ingress and service for users to expose pods through L4/L7 load balancers. Before the introduction of NEGs, the load balancer distributed traffic to VM instances and “kube-proxy” programs iptables to forward traffic to backend pods. Thi... |
<p>I'm running <code>flink run-application</code> targetting Kubernetes, using these options:</p>
<pre><code>-Dmetrics.reporter.prom.class=org.apache.flink.metrics.prometheus.PrometheusReporter
-Dmetrics.reporter.prom.port=9249
</code></pre>
<p>I specify a container image which has the Prometheus plugin copied into <co... | <p>You are misunderstanding the concept of <strong>exposed ports</strong>.<br />
When you expose a port in kubernetes with the <code>ports</code> option (the same apply with Docker and the <code>EXPOSE</code> tag), nothing is open on this port from the outside world.</p>
<p>It's basically just a hint for users of that ... |
<p>I am trying to setup Fluent Bit for Kuberentes on EKS + Fargate. I was able to get logs all going to one general log group on Cloudwatch but now when I add fluent-bit.conf: | to the data: field and try to apply the update to my cluster, I get this error:</p>
<blockquote>
<p>for: "fluentbit-config.yaml": a... | <p>As per <a href="https://docs.aws.amazon.com/eks/latest/userguide/fargate-logging.html" rel="nofollow noreferrer">docs</a> (at the very bottom of that page and yeah, we're in the process of improving them, not happy with the current state) you have a couple of sections in there that are not allowed in the context of ... |
<p>If I have a deployment with only a single replica defined, can I ensure that only ever one pod is running?</p>
<p>I noticed that when I do something like <code>kubectl rollout</code> for a very short amount of time I will see two pods in my logs.</p>
| <blockquote>
<p>If I have a deployment with only a single replica defined, can I ensure that only ever one pod is running?</p>
</blockquote>
<p>It sounds like you are asking for "at most one Pod" semantics. Also consider what happens when a Node becomes <em>unresponsive</em>.</p>
<p>This is point where <a hre... |
<p>I have a CoreDNS running in our cluster that uses the Kube DNS service. I want to disable the AutoScaler and the Kube-DNS deployment or scale it to 0.</p>
<p>As soon as I do this, however, it is always automatically scaled up to 2. What can I do?</p>
| <p>The scenario you are going through is described by the <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/custom-kube-dns" rel="nofollow noreferrer">official documentation</a>.</p>
<ul>
<li><p>Make sure that you created your custom CoreDNS as described <a href="https://cloud.google.com/kubernetes-engine... |
<p>I am trying to get the pod name with highest CPU utilization using kubectl command.
Able to retrieve list using following command but unable to write a jsonpath query to fetch the name of first pod from the output.
Appreciate any help in this regard. Thanks!</p>
<pre><code>kubectl top pod POD_NAME --sort-by=cpu
</co... | <p><code>kubectl top</code> doesn't appear to enable <code>--output</code> formatting and so no JSON and thus no JSONPath :-(</p>
<p>You can:</p>
<pre class="lang-sh prettyprint-override"><code>kubectl top pod \
--sort-by=cpu \
--no-headers \
--namespace=${NAMESPACE} \
| head -n 1
</code></pre>
<p>I think it would be u... |
<p>We have requirement to setup on prem kubernetes that can continue to serve applications even when there is disconnection from internet.</p>
<p>We are considering Redhat openshift. My question is does redhat openshift continue to service existing workloads during network outage?</p>
<p>I understand that during outage... | <p>As with all Kubernetes distributions, applications running on the cluster will continue to run even without an internet connection (obviously as long as the application itself does not rely on internet access).</p>
<p>As you correctly note, new applications can typically not be started without access to the registry... |
<p>I have a <code>kubernetes</code> cluster having 5 nodes, deployed on aws using <a href="https://github.com/kubernetes/kops" rel="nofollow noreferrer">kops</a>.</p>
<p>I have a setup a load balancer and <code>ingress-nginx</code> controller for reverse proxy.</p>
<p>So, all incoming request come to a <em>single ip</e... | <p>You have to set the NAT gateway for this scenario.</p>
<p>So using the NAT gateway all the out bound request will be diverted using the one VM and you will get single IP for the out bound traffic also.</p>
<p>You can read more about the <strong>NAT</strong> : <a href="https://cloud.google.com/nat/docs/overview" rel=... |
<p>I have two kubernetes clusters running on Azure AKS.</p>
<ul>
<li>One cluster named APP-Cluster which is hosting application pods.</li>
<li>One cluster named Vault-Cluster which the Hashicorp Vault is installed on.</li>
</ul>
<p>I have installed Hashicorp Vault with Consul in HA mode according to below official docu... | <p>The way you interact with <code>Vault</code> is via HTTP(s) API. That means you need to expose the <code>vault</code> service running in your <code>Vault-Cluster</code> cluster using one of the usual methods.</p>
<p>As an example you could:</p>
<ul>
<li>use a service of type <a href="https://kubernetes.io/docs/conce... |
<p>I have created an Autopilot cluster on GKE</p>
<p>I want to connect and manage it with <a href="https://github.com/kubernetes-client/python" rel="nofollow noreferrer">Python Kubernetes Client</a></p>
<p>I am able to get the kubeconfig of cluster</p>
<p>I am able to access the cluster using kubectl on my local system... | <p>Here's what I figured out. I think it's a good solution because it prevents man in the middle attacks (uses SSL) unlike other python snippets in the wild.</p>
<pre><code>from google.cloud.container_v1 import ClusterManagerClient
from kubernetes import client
from tempfile import NamedTemporaryFile
import base64
impo... |
<p>spec.rules[0].http.backend.servicePort: Invalid value: "80": must contain at least one letter or number (a-z, 0-9)", Error while calling NetworkingV1beta1Api.createNamespacedIngress() api</p>
<p>I am using io.kubernetes:client-java-api:12.0.1 version as a dependency in gradle</p>
<p>Below is my ingres... | <p>For starters, v1beta1 annotation is deprecated and v1 should be used instead. <strong>Pathtype</strong> should also be specified.</p>
<p><strong>PathType</strong> determines the interpretation of the Path matching, and can be one of the following values:</p>
<ol>
<li><strong>Exact</strong>: Matches the URL path exac... |
<p>I created a <code>Deployment</code>, <code>Service</code> and an <code>Ingress</code>. Unfortunately, the <code>ingress-nginx-controller</code> pods are complaining that my <code>Service</code> does not have an Active Endpoint:</p>
<p><code>controller.go:920] Service "<namespace>/web-server" does not... | <p><a href="https://stackoverflow.com/users/13524500/c-nan">C-Nan</a> has solved the problem, and has posted a solution as a comment:</p>
<blockquote>
<p>I found the issue. The Pod was started, but not in Ready state due to a failing readinessProbe. I wasn't aware that an endpoint wouldn't be created until the Pod is i... |
<p>When I run <code>kubectl get secrets</code> after doing a <code>helm upgrade --install <release-name></code> in Kubernetes cluster, our secrets got messy.</p>
<p>Is there any way to stop having <code>sh.helm.release.v1.</code> whenever I declare <code>kubectl get secrets</code>?</p>
<p><a href="https://i.stack... | <p>No, these secrets are where Helm stores its state.</p>
<p>When you install or upgrade a release, Helm creates a new secret. The secret who’s name ends in <code>.airflow.v29</code> contains all the information Helm has about revision number <code>29</code> of the <code>airflow</code> release.</p>
<p>Whenever you run ... |
<h1>Problem</h1>
<p>I have generated keys and certificates by OpenSSL with the secp256k1, run <code>rke</code> version v1.2.8 from the Rancher Kubernetes Engine (RKE), and got the following error:</p>
<pre><code>FATA[0000] Failed to read certificates from dir [/home/max/cluster_certs]: failed to read certificate [kube-... | <blockquote>
<p>Which curves are supported today by Kubernetes for the certificates if <code>secp256k1</code> yields the <code>x509: unsupported elliptic curve</code> error message?</p>
</blockquote>
<p>To try to answer this question I will look directly at the <a href="https://go.googlesource.com/go/+/8bf6e09f4cbb0242... |
<p>I am using a yaml config to create a network load balancer in AWS using kubectl.
The load balancer is created successfully and the target groups are attached correctly.</p>
<p>As the part of settings, I have passed annotations required for AWS, but all annotations are not applied when looking at the Load Balancer in... | <p>I think this is a version problem.
I assume you are running the in-tree cloud controller and not an external one (see <a href="https://github.com/kubernetes/kubernetes/tree/master/pkg/cloudprovider#deprecation-notice" rel="nofollow noreferrer">here</a>).</p>
<p>The annotation <code>service.beta.kubernetes.io/aws-loa... |
<p>I have deployed <a href="https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-deploy-eck.html" rel="nofollow noreferrer">ECK</a> on my kubernetes cluster(all vagrant VMs). The cluster has following config.</p>
<pre><code>NAME STATUS ROLES AGE VERSION
kmaster1 Ready control-p... | <p>I hope this helps ... Here is how I set a "LoadBalancer" using nginx and forward traffic to HTTPS services:</p>
<pre><code> kubectl get nodes -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
asd-master-1 R... |
<p>I am learning Kubernetes and I am having some doubts I read that Node can't be a part of the namespace and as shown below.</p>
<pre><code>$ kubectl api-resources
NAME SHORTNAMES APIGROUP NAMESPACED KIND
nodes no false N... | <p>A <strong>namespace</strong> is virtually you are defining while your Node and work load are actual stuff that is running.</p>
<blockquote>
<p>Namespaces are intended for use in environments with many users spread
across multiple teams, or projects. For clusters with a few to tens of
users, you should not need to cr... |
<p>I have followed <a href="https://aws.amazon.com/blogs/containers/fluent-bit-for-amazon-eks-on-aws-fargate-is-here/" rel="noreferrer">this guide</a> to configure Fluent Bit and Cloudwatch on my EKS cluster, but currently all of the logs go to one log group. I tried to follow a separate tutorial that used a kubernetes... | <p>So I found out that it is actually simple to do this.</p>
<p>The default tag of input on fluent bit contains the name of the service you are logging from, so you can actually stack multiple [OUTPUT] blocks each using the wildcard operator around the name of your service <em></em>. That was all I had to do to get the... |
<p>I have a StatefulSet with 3 pods. The first is assigned to the master role, the rest have a read replica role.</p>
<pre><code>redis-0 (master)
redis-1 (replica)
redis-2 (replica)
</code></pre>
<p>How can I create a Kubernetes Service that matches only the pods <code>redis-1</code> and <code>redis-2</code>? Basically... | <p>You may use <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#pod-name-label" rel="noreferrer">pod name labels</a> of your redis statefulset to create the service to access a particular read replica pod.</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: redis-1
spec:
type... |
<p>I want my prometheus server to scrape metrics from a pod.</p>
<p>I followed these steps:</p>
<ol>
<li>Created a pod using deployment - <code>kubectl apply -f sample-app.deploy.yaml</code></li>
<li>Exposed the same using <code>kubectl apply -f sample-app.service.yaml</code></li>
<li>Deployed Prometheus server using <... | <p>You need to use the <code>prometheus-community/kube-prometheus-stack</code> chart, which includes the Prometheus operator, in order to have Prometheus' configuration update automatically based on ServiceMonitor resources.</p>
<p>The <code>prometheus-community/prometheus</code> chart you used does not include the Pro... |
<p>I am new to DevOps. I wrote a deployment.yaml file for a Kubernetes cluster I just created on Digital Oceans. Creating the deployment keeps bringing up errors that I can't decode for now. This is just a test deployment in preparation for the migration of my company's web apps to kubernetes. </p>
<p>I tried editing ... | <p>Since this is the top result of the search, I thought I should add another case when this can occur. In my case, it was coming because there was no double quote on numeric env. var. Log did provide a subtle hint, but it was not very helpful.</p>
<p><strong>Log</strong></p>
<pre><code>..., bigger context ...|c-server... |
<p>What is the simplest way to find out the Availability of a K8s service over a period of time, lets say 24h. Should I target a pod or find a way to calculate service reachability</p>
| <p>I'd recommend to not approach it from a binary (is it up or down) but from a "how long does it take to serve requests" perspective. In other words, phrase your availability in terms of SLOs. You can get a very nice automatically generated SLO-based alter rules from <a href="https://promtools.dev/alerts/lat... |
<p>I have an application running in kubernetes pod (on my local docker desktop, with kubernetes enabled), listening on port 8080. I then have the following kubernetes configuration</p>
<pre><code>apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: myrelease-foobar-app-gw
namespace: default
spec:
... | <p>I suppose that port has to be mapped on the Istio Ingress Gateway. So if you want to use a custom port, you might have to customize that.</p>
<p>But usually it should not be a problem if multiple Gateways use the same port, it does not cause a clash. So for that use case it should not be necessary to do that.</p>
|
<p>I have changed my image in docker from Alpine base image to node:14.16-buster, While running the code I am getting 'apk not found' error.</p>
<p>Sharing the codes snippet :</p>
<pre><code>FROM node:14.16-buster
# ========= steps for Oracle instant client installation (start) ===============
RUN apk --no-cache add l... | <p>The issue comes from the fact that you're changing your base image from Alpine based to Debian based.</p>
<p>Debian based Linux distributions use <code>apt</code> as their package manager (Alpine uses <code>apk</code>).</p>
<p>That is the reason why you get <code>apk not found</code>. Use <code>apt install</code>, b... |
<p><strong>what do I want to do?</strong></p>
<p>I'm trying to deploy telegraf in my Kubernetes cluster so that I can use Telegraf's <strong>Prometheus</strong> input plugin to read the data (metrics) from a particular URL and write the metrics in a file using telegraf's output <strong>file</strong> plugin.</p>
<p><str... | <p>You forgot to enable metrics in <a href="https://github.com/influxdata/helm-charts/blob/master/charts/telegraf/values.yaml#L170-L173" rel="nofollow noreferrer">values.yaml</a>, its disabled by default.
Correct part is</p>
<pre><code>metrics:
health:
enabled: true
collect_memstats: false
</code></pre>
<p>Chan... |
<p>I'm overwhelmed with the number of options in Kubernetes.</p>
<p>There is a typical(the most suggested) way of deploying microservices: you create a deployment yaml that contains what type of image to pull, the number of replicas, listening ports of the app, etc. Then you might want to create more yaml's to expose t... | <p>Deployments do the OPs job for you while you drink coffee. What I mean by this is that a Deployment ensures that the desired state defined in your deployment manifest is maintained automatically (best effort). So, if a pod crashes, deployment will bring it up without human intervention.</p>
<p>However, using a POD Y... |
<p>My DockerFile looks like :</p>
<pre><code> FROM openjdk:8-jdk-alpine
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar"]
</code></pre>
<p>and my yml file looks like :</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: imagename
... | <p>you need to add a service type clusterIP to your database like that:</p>
<h3>MySQL Service:</h3>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Service
metadata:
name: mysql-service
labels:
app: mysql
spec:
ports:
- port: 3306
selector:
app: mysql
tier: mysql
cluster... |
<p>I have an application that relies on a kafka service.</p>
<p>With Kafka connect, I'm getting an error when trying to <code>curl localhost:8083</code>, on the Linux VM that's running the kubernetes pod for Kafka connect.</p>
<p><code>curl -v localhost:8083</code> gives:</p>
<ul>
<li>Rebuilt URL to: localhost:8083/</l... | <p>You can't connect to a service running inside your cluster, from outside your cluster, without a little bit of tinkering.</p>
<p>You have three possible solutions:</p>
<ol>
<li><p>Use a service with type <code>NodePort</code> or <code>LoadBalancer</code> to make the service reachable outside the cluster.</p>
<p>See ... |
<p>I am deploying pgadmin and postgres on kubernetes. When i look at deployments I see that 2 deployments are not ready. When I look at logs of Pgadmin, I see that it gives error as it can not connect to postgres. I use configmap to connect pgadmin to postgres. When I look at logs of postgres I see error.</p>
<p>Logs:<... | <p>After analysing the comments it looks like below resources have been helpful to solve this problem:</p>
<ol>
<li><a href="https://stackoverflow.com/questions/30848670/how-to-customize-the-configuration-file-of-the-official-postgresql-docker-image">How to customize the configuration file of the official PostgreSQL Do... |
<p>After a long struggle I just created my cluster, deployed a sample container busybox now i am trying to run the command exec and i get the following error:</p>
<p><strong>error dialing backend: x509: certificate signed by unknown authority</strong></p>
<p>How do i solve this one: here is the command output with v=9 ... | <p>**Edited for simplicity:</p>
<p>my cluster operator kube-apiserver was degraded, causing my certificate failures. Resolving that degradation was necessary to resolve the overarching problem, resulting in x509 errors. Validate that all masters are in READY, pods in your apiserver projects are also scheduled and ready... |
<p>I'm using the golang kubernetes client to create kubernetes pods and execute remote commands in them. However, I'm finding that I can't get feedback on the status of the remote execution until it's finished because I can't figure out how to stream the logs of the remote command. Here's my current implementation for ... | <p>This is only a partial answer but if I set use the following <code>PodExecOptions</code> and <code>StreamOptions</code> then I see each log line get printed in real time (note that <code>Tty</code> is <code>true</code> and I'm using stdin and stdout, not custom buffers):</p>
<pre class="lang-golang prettyprint-overr... |
<p>I have a kubeless version of <code>v1.0.8</code> and I am building a machine learning mechanism that requires functions autoscaling on demand (approximately requests the generation of 100 pods per hour).</p>
<p>Being an anonymous Docker Hub user limits my downloads to 100 container image pull requests per six hours.... | <p>A good start is to set the <code>imagePullPolicy</code> for your <code>PodSpec</code> to <code>IfNotPresent</code>, so that you'll only have to pull once per version per node.</p>
<p>Depending on the criticality of the workload you should also consider mirroring the image to a container registry you control. You don... |
<p>Here are steps to reproduce:</p>
<pre><code>minikube start
kubectl run nginx --image=nginx
kubectl expose deployment nginx --port=80 --type=ClusterIP
kubectl run -i --tty --rm alpine --image=alpine --restart=Never -- sh
apk add --no-cache bind-tools
</code></pre>
<p>Now let's try to query kibe-dns for <code>nginx... | <h2>Answer</h2>
<p>Dig does not complete the query by default with the search path. The search path is set in <code>/etc/resolv.conf</code>. The <code>+search</code> flag enables the search path completion.</p>
<h4>From the Man Pages</h4>
<blockquote>
<p><strong>+[no]search</strong><br />
Use [do not use] the search li... |
<p>I am testing Project Calico on a small Kubernetes cluster and I try to figure out which one between "global policy" and "network policy" will be applied to the data stream first.</p>
<p>What I understand:</p>
<ul>
<li>the data path with Calico is that the pod's host is always the next hop and the... | <p>Global vs non-global is not a factor in deciding the order that policies are applied in. Ordering is determined by the "order" field on Calico <a href="https://docs.projectcalico.org/reference/resources/networkpolicy" rel="noreferrer">NetworkPolicy</a> and <a href="https://docs.projectcalico.org/reference... |
<p>In my project I have to create a kubernetes cluster on my GCP with an External Load Balancer service for my django app. I create it with this <code>yaml</code> file:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: mydjango
namespace: test1
labels:
app: mydjango
spec:
ports:
- name: http
... | <p>If you want to serve HTTPS, you need a certificate. For that, you can follow this documentation with <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/managed-certs" rel="nofollow noreferrer">Google managed certificates</a>.</p>
<p>You also have to define an ingress to route the traffic.</p>
|
<p>I am getting <code>unknown image flag</code> when creating a deployment using <code>minikube</code> on <code>windows 10</code> <code>cmd</code>. Why?</p>
<pre><code>C:\WINDOWS\system32>minikube kubectl create deployment nginxdepl --image=nginx
Error: unknown flag: --image
See 'minikube kubectl --help' for usage.
... | <p>When using <a href="https://minikube.sigs.k8s.io/docs/handbook/kubectl/" rel="noreferrer">kubectl bundled with minikube</a> the command is little different.</p>
<p>From the <a href="https://minikube.sigs.k8s.io/docs/handbook/kubectl/" rel="noreferrer">documentation</a>, your command should be:</p>
<pre><code>minikub... |
<p>I have an aws s3 bucket at <code>bucket.com.s3-website.us-east-2.amazonaws.com/subfolder/static-site-folder/</code></p>
<p>I want to route a domain directly to the sub-folder /subfolder/static-site-folder/</p>
<p>This is because I want to have multiple static sites on a single bucket.</p>
<p>So I want something like... | <p>Domain Name System (DNS) web service providers, such as Route53, do not "see" your folders. They only operate at the domain level, but url paths.</p>
<p>Probably the easiest way to achieve what you want would be by setting up <a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Downl... |
<p>I'm currently writing the manifests for a few services in my home server that require persistent storage. I want to use PVs and PVCs. Do I create one single big PV and share that among all services? Or is it a 1:1 relation between PVCs and PVs?</p>
<p>I'm not asking about the different between PVs and PVCs. This has... | <p>It is a one-to-one relationship.</p>
<p>You can have many PVs in your environment. A specific PVC is a <strong>claim</strong> for a specific instance that match your requested criterias, e.g. size and type. The volume will be claimed and hold your data as long as your PVC-resource exist in your cluster, but if you d... |
<p>Hi I am trying to deploy my application with zero downtime. My app is quite frequent with database ddl changes. What are all the possible ways to achieve it with zero transaction failure in the app. Though we can use kubernetes to achieve zero downtime of the application, I don't want any failures in service request... | <p>This has nothing to do with Kubernetes. You will have the same problems or challenges when you install your application on bare metal servers, on VMs or on plain Docker. Have a look at <a href="https://spring.io/blog/2016/05/31/zero-downtime-deployment-with-a-database" rel="nofollow noreferrer">https://spring.io/blo... |
<p>I have the following code using the k8s python client:</p>
<pre><code>config.load_incluster_config()
v1 = client.CoreV1Api()
object_meta = k8s.V1ObjectMeta(generate_name='myprefix',
namespace='my_name_space')
body = k8s.V1Secret(string_data=data, kind='Secret', type='my_type', metadata... | <p>You can pass the secret name into this code and get the example of the secret</p>
<pre><code>from kubernetes import client, config
config.load_kube_config()
v1 = client.CoreV1Api()
secret = v1.read_namespaced_secret("Secret-name", "Namespace-Name")
print(secret)
</code></pre>
<p>decode the secret... |
<p>I would like to deploy a minimal k8s cluster on AWS with Terraform and install a Nginx Ingress Controller with Helm.</p>
<p>The terraform code:</p>
<pre><code>provider "aws" {
region = "us-east-1"
}
data "aws_eks_cluster" "cluster" {
name = module.eks.cluster_id
}
data &... | <p>In the <code>eks</code> modules you are prefixing the cluster name with <code>eks-</code>:</p>
<pre><code>cluster_name = "eks-${var.cluster_name}"
</code></pre>
<p>However you do not use the prefix in your subnet tags:</p>
<pre><code>"kubernetes.io/cluster/${var.cluster_name}" = "shared&q... |
<p>Can someone explain the difference between what you get in the outputs of a helm list and kubectl get deployments command ? I'm running these commands on a sever and some entries appear whether you do a <code>Helm List</code> or a <code>Kubectl get deployments</code> command and some entries only appear if you run e... | <p><code>Helm</code> is a tool aimed at packaging <code>Kubernetes</code> "apps" as a collection of Kubernetes <code>resources</code> named <code>Helm charts</code>. A deployed version of an Helm chart is called <code>Release</code>.</p>
<p>Among the existing resources that can be part of an Helm Chart, one o... |
<p>So I have an Helm template:</p>
<pre><code> spec:
containers:
- name: {{ .Values.dashboard.containers.name }}
image: {{ .Values.dashboard.containers.image.repository }}:{{ .Values.dashboard.containers.image.tag }}
imagePullPolicy: Always
env:
- name: BASE_PA... | <p>Just remove the <code>env:</code> from your bit.</p>
<pre><code> env:
- name: BASE_PATH
value: /myapp/web
{{- if .Values.extraEnvs}}
{{- range .Values.extraEnvs }}
- name: {{ .name }}
value: {{ .value }}
{{- end }}
... |
<p>So I have an Helm template:</p>
<pre><code> spec:
containers:
- name: {{ .Values.dashboard.containers.name }}
image: {{ .Values.dashboard.containers.image.repository }}:{{ .Values.dashboard.containers.image.tag }}
imagePullPolicy: Always
env:
- name: BASE_PA... | <p>The <code>toYaml</code> way:</p>
<pre><code>spec:
containers:
- name: {{ .Values.dashboard.containers.name }}
image: {{ .Values.dashboard.containers.image.repository }}:{{ .Values.dashboard.containers.image.tag }}
imagePullPolicy: Always
env:
- name: BASE_PATH
value: /myapp/... |
<p>I have a .NET Core pod that needs to access to SQL Server pod in Kubernetes(docker-desktop).
Using port forwarding I can connect to that SQL Server from SQL Server Management Studio. But when I trying to connect from .NET Core pod then it says</p>
<blockquote>
<p>The server was not found or was not accessible</p>
</... | <p>It`s my bad. Actually selector of service was wrong.</p>
<pre><code> selector:
name: sqlserver
</code></pre>
<p>It should be</p>
<pre><code> selector:
app: sqlserver
</code></pre>
<p>Thank you all</p>
|
<p>I'm trying to set up a proxy service in the Kubernetes cluster using istio. I have created two different domains. If the domain is foo.com it should be redirected to an external URL else it should be routed to an app server. I have configured this using virtual service and service entry. But when I hit foo.com it is... | <p>if to redirect when <code>foo.com</code> domain get hit</p>
<pre><code>apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: github
spec:
hosts:
- "raw.githubusercontent.com"
location: MESH_EXTERNAL
ports:
- number: 443
name: https
protocol: TLS
resolution: DNS
<... |
<p>I have a managed azure cluster (AKS) with nginx ingress in it.
It was working fine but now nginx ingress stopped:</p>
<pre><code># kubectl -v=7 logs nginx-ingress-<pod-hash> -n nginx-ingress
GET https://<PRIVATE-IP-SVC-Kubernetes>:443/version?timeout=32s
I1205 16:59:31.791773 9 round_trippers.go:42... | <p>On my OCP 4.7 (OpenShift Container Registry) instances with 3 of master and 2 of worker nodes, the following log appears after <code>kubelet</code> and <code>oc</code> commands.</p>
<pre><code>$ kubectl version
Client Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.1-5-g76a04f... |
<p>So I have an API that's the gateway for two other API's.
Using docker in wsl 2 (ubuntu), when I build my Gateway API.</p>
<pre><code>docker run -d -p 8080:8080 -e A_API_URL=$A_API_URL B_API_URL=$B_API_URL registry:$(somePort)//gateway
</code></pre>
<p>I have 2 environnement variables that are the API URI of the t... | <p>You just have to hardwire them. Kubernetes doesn't know anything about your local machine. There are templating tools like Helm that could inject things like Bash is in your <code>docker run</code> example but generally not a good idea since if anyone other than you runs the same command, they could see different re... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.