prompt
stringlengths
65
38.7k
response
stringlengths
41
29.1k
<p>I am trying to set some values in server.xml using environment variables. From this <a href="https://stackoverflow.com/questions/67214216/how-to-set-org-apache-tomcat-util-digester-environmentpropertysource-in-tomcat">how to set org.apache.tomcat.util.digester.EnvironmentPropertySource in tomcat</a>, I create setenv...
<p>The <code>org.apache.tomcat.util.digester.EnvironmentPropertySource</code> class is available since <a href="https://tomcat.apache.org/tomcat-7.0-doc/changelog.html#Tomcat_7.0.101_(violetagg)" rel="nofollow noreferrer">Tomcat 7.0.108</a>, <a href="https://tomcat.apache.org/tomcat-8.5-doc/changelog.html#Tomcat_8.5.52...
<p>I am trying to run a pod where the default limit of my <strong>GKE AutoPilot Cluster is 500m vCPU</strong>.. But I want to run all my pods by 250m vCPU only. I tried the command <code>kubectl run pod-0 --requests=&quot;cpu=150m&quot; --restart=Never --image=example/only</code></p> <p>But I get a warning: <code>Flag ...
<p>Since kubectl v1.21 All generators are depricated.</p> <p>Github issue: <a href="https://github.com/kubernetes/kubernetes/issues/93100" rel="nofollow noreferrer">Remove generators from kubectl commands</a> quote:</p> <blockquote> <p>kubectl command are going to get rid of the dependency to the generators, and ultima...
<p>I have ingress yaml like below which makes ingress to proxy HTTPS to HTTP connection. I'm confused how can I make this same ingress to process also HTTP to HTTP connection. Meaning I want it to use the same rule for both incoming HTTP or HTTPS. Removing <code>tls</code> portion makes it work with HTTP but adding it ...
<p>You should redirect the HTTP request to your HTTPS listener. The requests hitting your Azure LB 80/443 listeners will be handled in the same way.</p> <p>Due to Azure App gateway <a href="https://github.com/Azure/application-gateway-kubernetes-ingress/issues/1001" rel="nofollow noreferrer">limitation</a>, you cannot ...
<p>Playing around with K8 and ingress in local minikube setup. Creating ingress from yaml file in networking.k8s.io/v1 api version fails. See below output. Executing</p> <pre><code>&gt; kubectl apply -f ingress.yaml </code></pre> <p>returns</p> <pre><code>Error from server (InternalError): error when creating &quot;ing...
<p>I had the same issue. I successfully fixed it using:</p> <p><code>kubectl delete -A ValidatingWebhookConfiguration ingress-nginx-admission</code></p> <p>then apply the yaml files:</p> <p><code>kubectl apply -f ingress_file.yaml</code></p>
<p>I have helm charts created for a microservice that I have built and everything is working as expected. Now, I have created a new k8s namespace and I want to try to deploy the same helm charts as my old namespace. Although, I have just one value that I need it different while everything else remain the same.</p> <p>D...
<p>David suggested the right way. You can use different <code>values.yaml</code> where you can specify the namespace you want to deploy the chart:</p> <pre><code>$ helm install -f another-namespace-values.yaml &lt;my-release&gt; . </code></pre> <p>It's also entirely possible to launch helm chart with multiple values. F...
<p>We are running a Java application in a Kubernetes cluster. The application itself doesn't have high demand for RAM, but I've noticed that it always consumes 1GB.</p> <pre><code>kubectl top pods NAME CPU(cores) MEMORY(bytes) my-application-c0ffee ...
<blockquote> <p>in case of running inside container, where reserved memory becomes committed</p> </blockquote> <p>No, reserved memory does not &quot;become committed&quot;. The Virtual Size and the Resident Set Size are different metrics, whether in a container or not. What sits in the physical memory is RSS.</p> <p><c...
<p>I have the following Ingress configuration:</p> <pre><code>apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: http-ingress spec: rules: - host: example-adress.com http: paths: - path: /apple pathType: Prefix backend: service: ...
<p>Posting this out of comment as it works.</p> <p>Based on your tls secret yaml, you tried to add certificate and private key using paths, which is not supported currently (<a href="https://kubernetes.io/docs/concepts/configuration/secret/#tls-secrets" rel="nofollow noreferrer">reference</a>) Fragment from reference:<...
<p>We have a service in our cluster that we call via ssh (test environment etc.). In this container we have different environment variables when we connect with ssh or we connect with kubectl.</p> <p>Can someone explain me what else is set here with the kubectl exec command?</p> <p>As an example a small excerpt from bo...
<p>The <code>kubectl exec</code> command allows you to remotely run arbitrary commands inside an existing container of a pod. <code>kubectl exec</code> isn’t much different from using <code>SSH</code> to execute commands on a remote system. <code>SSH</code> and <code>kubectl</code> should both work well with 99% of CLI...
<p>I am configuring a statefulset deploying 2 Jira DataCenter nodes. The statefulset results in 2 pods. Everything seems fine until the 2 pods try to connect to eachother. They do this with their <strong>short hostname</strong> being <em>jira-0</em> and <em>jira-1</em>.</p> <p>The jira-1 pod reports <em>UnknownHostExce...
<blockquote> <p>That solves my issue but I think it shouldn't be necessary to add this?</p> </blockquote> <p>From the <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/" rel="nofollow noreferrer">StatefulSet documentation</a>:</p> <blockquote> <p>StatefulSets currently require a Headless Se...
<p>When JVM crashes with <code>OutOfMemoryError</code> there are some options to store a dump:</p> <pre><code>-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=./java_pid&lt;pid&gt;.hprof </code></pre> <p>but what does it happen in kubernetes cluster after crashing? It seems kubernetes will clean up everything related ...
<p>just mount it as a volume.</p> <pre><code>volumeMounts: - name: heap-dumps mountPath: /dumps volumes: - name: heap-dumps emptyDir: {} </code></pre> <p><a href="https://danlebrero.com/2018/11/20/how-to-do-java-jvm-heapdump-in-kubernetes/" rel="nofollow noreferrer">How to do a jav...
<p>Running a k8 cronjob on an endpoint. Test works like a charm locally and even when I <code>sleep infinity</code> at the end of my entrypoint then curl inside the container. However once the cron kicks off I get some funky error:</p> <pre><code>[ec2-user@ip-10-122-8-121 device-purge]$ kubectl logs appgate-device-cron...
<p>The issue with my post was on the server itself due to some firewall with the IP whitelisting set up on the AWS cloud account. After that problem was addressed by the security team on the account I was able to pass the blocker.</p>
<p>I'm using the pre-packaged Kubernetes cluster that comes with docker desktop. I'm on a windows machine, running the Kubernetes on a Ubuntu-18.04 VM using WSL 2. On my Kubernetes cluster I run:</p> <pre><code>istioctl install --set profile=demo --set values.global.jwtPolicy=third-party-jwt </code></pre> <p>But I get ...
<p>In the error message that you've received there is a link that points to the documentation on that specific issue:</p> <ul> <li><em><a href="https://istio.io/latest/docs/ops/best-practices/security/#configure-third-party-service-account-tokens" rel="nofollow noreferrer">Istio.io: Latest: Docs: Ops: Best practices: S...
<p>I'm trying to submit my Pyspark application to a Kubernetes cluster (Minikube) using spark-submit:</p> <pre><code>./bin/spark-submit \ --master k8s://https://192.168.64.4:8443 \ --deploy-mode cluster \ --packages org.apache.spark:spark-sql-kafka-0-10_2.12:3.0.1 \ --conf spark.kubernetes.container.image='...
<p>Did you start out with the official Dockerfile (kubernetes/dockerfiles/spark/bindings/python/Dockerfile) as described in the <a href="https://spark.apache.org/docs/latest/running-on-kubernetes.html#docker-images" rel="nofollow noreferrer">Docker images section</a> of the documentation? You also need to specify an up...
<p>I am trying to configure Prometheus using Helm in Kubernetes and I have tried to execute the command as below and the deployment was successful.</p> <pre><code>$ helm install prometheus prometheus-community/prometheus --namespace prometheus --set nodeSelector.nodetype=infra NAME: prometheus LAST DEPLOYED: Tue Apr 2...
<p>You need to configure the nodeSelector for each component</p> <pre class="lang-yaml prettyprint-override"><code>alertmanager: nodeSelector: nodetype: infra nodeExporter: nodeSelector: nodetype: infra server: nodeSelector: nodetype: infra pushgateway: nodeSelector: nodetype: infra ...
<p>According to the Kubernetes docs a cluster can have up to 5000 nodes. Imagine I have then node0 with 1CPU, node1 with 2CPU, etc.</p> <p>Let's say I have a single-core, synchronous process which I want to run instances of. Am I then limited by the smallest node in a heterogeneous cluster of nodes? If not, can I enfor...
<blockquote> <p>Am I then limited by the smallest node in a heterogeneous cluster of nodes? If not, can I enforce choosing the node largest CPU (which would then limit me to the single node) or smallest CPU (which would then allow seamless and consistent parallel execution) or will Kubernetes do it in the background?</...
<p>We are running Postgres in Kubernetes. Our Prometheus pod monitoring always shows that Postgres fills up the entire pods memory in a shared or cached state.</p> <pre><code>free -h total used free shared buff/cache available Mem: 62G 1.7G 13G 11G ...
<p>I recommend that you disable memory overcommit by setting <code>vm.overcommit_memory = 2</code> in <code>/etc/sysctl.conf</code> and running <code>sysctl -p</code>. Don't forget to set <code>vm.overcommit_ratio</code> appropriately, based on the RAM and swap that you have.</p> <p>Than should keep the OOM killer at b...
<p>I have pod with this settings:</p> <pre><code>Node-Selectors: &lt;none&gt; Tolerations: node.kubernetes.io/memory-pressure:NoSchedule node.kubernetes.io/not-ready:NoExecute for 300s node.kubernetes.io/unreachable:NoExecute for 60s role_va </code></pre> <p>The...
<p>As Malgorzata said, Taints and Tolerations are only useful for the nodes to accept a certain kind of pods. E.g. a node with &quot;blue&quot; taint can only accept pods with &quot;blue&quot; toleration. However, it does not mean that the pod with &quot;blue&quot; toleration would end up only in the node with &quot;bl...
<p>I have Kubernetes Cluster where deployed and scaled Jenkins, below podTemplate yaml file which I run in Jenkins pipeline:</p> <pre><code>podTemplate(yaml: &quot;&quot;&quot; apiVersion: v1 kind: Pod spec: containers: - name: docker image: docker/compose command: ['cat'] tty: true volumeMounts: ...
<p>You should be able to set environment variables on your stage as following:</p> <pre><code> stage('Build and run Docker image') { environment { SOME_ENV_VAR = &quot;SOME_VAL&quot; } git branch: 'test', credentialsId: 'github-credentials', url: 'https://github.com/project/pro...
<p>I'm using helm3. My kubernetes deployment get crashed on 43 line of code below.</p> <p>Error in console: error converting YAML to JSON: mapping values are not allowed in this context</p> <p>yaml lint says this: <strong>(): found unexpected ':' while scanning a plain scalar at line 43 column 19</strong></p> <p>Whats...
<p>so my solution is:</p> <pre><code>- image: '{{.Values.dockerRegistry}}/{{.Values.dockerImage}}:{{.Values.version}}' </code></pre> <p>The problem was about printf function and colon symbol within</p> <pre><code>&quot;%s/%s:%s&quot; </code></pre>
<p>I've tried to change the default proxy_timeout(600s) to 3600s for tcp services in k8s maintained nginx-ingress.But its not working.</p> <p>I have exec the nginx-controller pods and got the following in nginx.conf.</p> <pre><code># TCP services server { preread_by_lua_block { ngx.var.proxy_up...
<p>Annotations does not work in tcp-services for updating <code>proxy_timeout</code> parameter in nginx. You need to update the configmap <code>ingress-nginx-controller</code> and add the <code>proxy-stream-timeout: &quot;3600s&quot;</code> under <code>data</code>. (A sample below)</p> <pre><code>apiVersion: v1 kind: C...
<p>I have deployed ECK (using helm) on my k8s cluster and i am attempting to install elasticsearch following the docs. <a href="https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-deploy-elasticsearch.html" rel="noreferrer">https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-deploy-elasticsearch.html</a></p> ...
<p>If anyone comes across this problem in the future, make sure your ingress is properly configured. The error message suggests that its a misconfiguration with the ingress.</p> <pre><code>received plaintext http traffic on an https channel, closing connection </code></pre> <p>In my case i am using <a href="https://kub...
<p>How can I use Mike Farah's YQ v4 to update a field that has special characters.</p> <p>e.g. manipulating below:</p> <pre><code> containers: - name: flyway image: xx.dkr.ecr.eu-west-1.amazonaws.com/testimage:60 </code></pre> <p>Errors for attempts:</p> <pre><code>$ yq e &quot;.spec.template.spe...
<p>Found this documentation: <a href="https://mikefarah.gitbook.io/yq/operators/env-variable-operators" rel="nofollow noreferrer">https://mikefarah.gitbook.io/yq/operators/env-variable-operators</a></p> <p>This worked for me:</p> <pre><code>$ echo $image xx.dkr.ecr.eu-west-1.amazonaws.com/testimage:61 $ myenv=$image yq...
<p>I wanna run a microservice which use DB. DB need to deploy in the same kubernetes cluster as well using PVC/PV. What is the kubernetes service name/command to use to implement such logic:</p> <ol> <li>Deploy the DB instance</li> <li>If 1 is successful, then deploy the microservice, else return to 1 and try (if 100 t...
<p>I would say you should add <a href="https://kubernetes.io/docs/concepts/workloads/pods/init-containers/#init-containers-in-use" rel="nofollow noreferrer">initContainer</a> to your microservice, which would search for the DB service, and whenever it's gonna be ready, then the microservice will be started.</p> <p>e.g...
<p>I can't figure out whats wrong with my role binding. I keep getting this error while trying to get metrics for my pod.</p> <p><code>&quot;pods.metrics.k8s.io &quot;my-pod-name&quot; is forbidden: User &quot;system:serviceaccount:default:default&quot; cannot get resource &quot;pods&quot; in API group &quot;metrics.k8...
<p>ClusterRole &amp; ClusterRolebinding are non-namespaced resources. So, remove the namespace line from your YAML file.</p> <p>Alternatively, use Role &amp; RoleBinding if you want to scope to a namespace.</p>
<p>I try to deploy wordpress/mysql in kubernetes. I want mysql and wordpress to use different volumes. I'm trying to write nfs for wordpress and hostpath for mysql.</p> <p>But wordpress and mysql are not connected. I don't know why. I'd appreciate your help.</p> <p>here's my code: Mysql.yaml</p> <pre><code>apiVersion: ...
<p>you have provided the port number at last in environment variable</p> <p>please try with out it</p> <pre><code>env: - name: WORDPRESS_DB_HOST value: mysql:3306 </code></pre> <p>instead use this</p> <pre><code>env: - name: WORDPRESS_DB_HOST value: MySQL </code></pre> <p>you can che...
<p><strong>Context:</strong> I am using Linux and Windows nodes in a Kubernetes cluster. Depending on the OS where a pod is deployed, I need to use a specific image.</p> <p><strong>Question:</strong> Is there a way to express this in a Kubernetes yaml files: &quot;if this label exist on the pod you are deploying, then ...
<p>The proper way to do this is to build &quot;multi-arch&quot; images, e.g. so that your container image contains binaries for multiple architectures. See e.g. <a href="https://cloud.google.com/kubernetes-engine/docs/tutorials/building-windows-multi-arch-images" rel="nofollow noreferrer">Building Windows Server multi-...
<p>I am abit confused on the kubernetes nginx virtual subroute. <a href="https://docs.nginx.com/nginx-ingress-controller/configuration/virtualserver-and-virtualserverroute-resources/#virtualserverroute-subroute" rel="nofollow noreferrer">https://docs.nginx.com/nginx-ingress-controller/configuration/virtualserver-and-vi...
<p>So the path is the URL which will be exposed by the Nginx to world outside. What happens to that path internally depends on the action's sub attributes, some examples:</p> <p>Here the <code>/coffee</code> is what end user sees but the request is sent to root of coffee service. So if the coffee would be a service in ...
<p>I want to get the list of the nodes and their status in Kubernetes via the go client. I am using <code>clientset.CoreV1().Nodes().List(metav1.ListOptions{})</code> and I am able to get the list of nodes and some information such as node lables but I cannot find the <code>status.phase</code> there (for pods that give...
<p>You can access it through <code>node.Status.Condition</code></p> <pre><code>nodes, _ := client.CoreV1().Nodes().List(context.TODO(), metav1.ListOptions{}) for _, node := range nodes.Items { fmt.Printf(&quot;%s\n&quot;, node.Name) for _, condition := range node.Status.Conditions { fmt.Printf(&quot;\t...
<p>I am trying to setup an <a href="https://kubernetes.github.io/ingress-nginx/" rel="nofollow noreferrer">nginx kubernetes ingress</a>. I am able to serve http and websockets content on different routes at the moment.</p> <p>However I am not able to add GRPC routes on the same host. Adding this annotation <code>nginx....
<p>As you want the annotation <code>nginx.ingress.kubernetes.io/backend-protocol: &quot;GRPC&quot;</code> to apply only on certain routes of your host, you could declare two Ingress definitions. The first one for all HTTP routes, the second one for GRPC routes.</p> <p>The Nginx Ingress Controller will pick all the Ingr...
<p>I have an application deployed on Kubernetes (Google cloud). For the deployment to function, it needs to return a 200 status response to "/healthz" and "/". I have this set up on my Express server as a route returning a response like so:</p> <pre><code>app.use('/healthz', ((_req, res) =&gt; { logGeneral.info(...
<p>Using an API route is the correct answer. Create a new file in /pages/api called healthcheck.js with this content:</p> <pre><code>export default function handler(req, res) { res.status(200).json({ &quot;status&quot;: &quot;ok&quot; }) } </code></pre> <p>The endpoint will be at (hostname)/api/healthcheck</p>
<p>Trying to add insecure registry to containerd config as below:</p> <pre><code>[plugins.&quot;io.containerd.grpc.v1.cri&quot;.cni] bin_dir = &quot;/opt/cni/bin&quot; conf_dir = &quot;/etc/cni/net.d&quot; max_conf_num = 1 conf_template = &quot;&quot; [plugins.&quot;io.containerd.grpc.v1.cri...
<p><code>ctr</code> <strong>does not</strong> read the <code>/etc/containerd/config.toml</code> config file, this config is used by cri, which means <code>kubectl</code> or <code>crictl</code> would use it.</p> <p>The error log <code>http: server gave HTTP response to HTTPS client</code>, shows that the registry is u...
<p>I am trying to add the two flags below to apiserver in the /etc/kubernetes/manifests/kube-apiserver.yaml file:</p> <pre><code>spec: containers: - command: - kube-apiserver - --enable-admission-plugins=NodeRestriction,PodNodeSelector - --admission-control-config-file=/vagrant/admission-control.ya...
<p>You need to create a <code>hostPath</code> volume mount like below</p> <pre><code>volumeMounts: - mountPath: /vagrant name: admission readOnly: true ... volumes: - hostPath: path: /vagrant type: DirectoryOrCreate name: admission </code></pre>
<p>I'm using 0.14.2 Terraform version. I'm trying to deploy an EKS cluster with two nodes with this code:</p> <pre><code>resource &quot;aws_eks_cluster&quot; &quot;cluster&quot; { enabled_cluster_log_types = [] name = var.cluster_name role_arn = aws_iam_role.cluster.arn ver...
<p>Nodes can fail to join a cluster for a variety of reasons.</p> <ol> <li>a failure during cloud-init may be preventing them from registering with the cluster control plane.</li> <li>there may be IAM authentication failures.</li> </ol> <p>Debugging steps:</p> <ol> <li><p>Ssh into a node and check <code>/var/log/cloud-...
<p>I have a Service on GKE of type LoadBalancer that points to a GKE deployment running nginx. My nginx has all of the timeouts set to 10 minutes, yet HTTP/HTTPS requests that have to wait on processing before receiving a response get cutoff with 500 errors after 30 seconds. My settings:</p> <pre><code>http { prox...
<p>As of April 2021 you can do this via GKE/GCE configuration. <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-features#create_backendconfig" rel="nofollow noreferrer">Here</a> are the instructions. Essentially you create a <code>BackendConfig</code> resource similar to this:</p> <pre class="la...
<p>In Docker a client container can refer to a server container by different names by using link aliasing:</p> <pre><code>--link server-container:my_preferred_server </code></pre> <p>A second client can use its own choice of names</p> <pre><code>-- link server-container:server </code></pre> <p>Can I achieve this in...
<p>I just had the same need and I was able to add an external Service, which points to the FQDN of the other service within the cluster:</p> <pre><code>apiVersion: v1 kind: Service metadata: name: &quot;my-alias&quot; spec: type: ExternalName externalName: &quot;other-service.my-namespace.svc.cluster.local&quot; ...
<p>I have deployed postgresql pod on kubernetes pod, and want to know how can I access postgresql gui. I am not able to access it with ingress path, as I got to know ingress are meant for https purpose only whereas postgres follows TCP protocol. Any lead how can I access through GUI?</p> <p>deployment.yaml</p> <pre><co...
<p>Ingress API are only for Layer 7 (HTTP). In your case you want to access Layer 4 (TCP).</p> <p>To achieve you goal, you can:</p> <ul> <li>Use a <a href="https://kubernetes.io/docs/concepts/services-networking/service/#nodeport" rel="nofollow noreferrer">Nodeport</a> on your service</li> <li>A Ingress Controller that...
<p>I have a postgres pod deployed on OpenShift and a PVC that I think that I correctly attached but I could be wrong. This is my PVC and it is correctly Bound -</p> <pre><code>apiVersion: v1 kind: PersistentVolumeClaim metadata: name: postgres-pvc spec: accessModes: - ReadWriteOnce resources: requests: st...
<p>as you can see the error</p> <blockquote> <p>already attached to another node xx.xx.xxx.x and there are active pods [postgres-7-6p6sz] using that</p> </blockquote> <p>you are utilizing a block storage as pv which has <strong>accessModes</strong> of <code>ReadWriteOnce</code> that means at any given time volume could...
<p>While learning Kubernetes going by the book Kubernetes for developer, I am stuck at this point now.</p> <p>I am trying to start Rabbitmq pod but but after lot of troubleshooting I have managed to get to this point but do not get clue where do I fix to get rid of the permission denied error.</p> <pre><code># kubectl ...
<p>When creating an image, the image creator often chooses to use a user other than root to run the process. This is the case for your image, and the user does not have write permissions on the <code>/bitnami</code> directory. You can verify this by commenting out the volume.</p> <p>To fix the issue, you need to set a ...
<p>EDIT: I rewrote the question with a fully reproducible example.</p> <p>I have a sample Django app with the base getting started <a href="https://docs.djangoproject.com/en/3.2/intro/tutorial01/" rel="nofollow noreferrer">https://docs.djangoproject.com/en/3.2/intro/tutorial01/</a>, that is, there are two paths <code>/...
<p>I have come to the conclusion that it's not possible to use path-based Ingress for a Django app, probably due to something related to Django's internals.</p> <p>Every example out there uses host-based rules, and indeed, that just work. For example, the Ingress above can be changed to the following, and it will work....
<p>We have a GKE cluster with <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-upgrades" rel="noreferrer">auto-upgrading nodes</a>. We recently noticed a node become unschedulable and eventually deleted that we suspect was being upgraded automatically for us. Is there a way to confirm (or other...
<p>You can use the following advanced logs queries with Cloud Logging (previously Stackdriver) to detect upgrades to <strong>node pools</strong>:</p> <pre><code>protoPayload.methodName=&quot;google.container.internal.ClusterManagerInternal.UpdateClusterInternal&quot; resource.type=&quot;gke_nodepool&quot; </code></pre...
<p>I'm trying to restart my kubernetes deployment via the kubernetes api using the @kubernetes/client-node Library. I'm not using deployment scale because i only need one deployment (db and service container) per app.</p> <p>I also tried to restart a single container inside the deployment via exec (/sbin/reboot or kill...
<p>Really seems like there is a bug in the node Kubernetes client library. On PATCH requests it should set the content type to &quot;application/json-patch+json&quot; but instead it sends the content type as &quot;application/json&quot;. Thats why you get unsupported media type back by the api.</p> <p>Furthermore you n...
<p>I have a GKE/GCE ingress file which has 2 hosts.</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: my-ingress spec: rules: - host: myfirstdomain # &lt;-------- override this via kustomize http: paths: - path: /abc b...
<p>You can not do that using <strong><a href="https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/patchesstrategicmerge/" rel="noreferrer">strategic merge</a></strong> since the <code>spec.rules</code> is an array of items. You have to use <strong><a href="https://kubectl.docs.kubernetes.io/references...
<p>I created a flask app to run in container.</p> <p><strong>Dockerfile</strong></p> <pre><code>FROM python:3.7 LABEL MAINTAINER=&quot;Anirban&quot; RUN mkdir /app WORKDIR /app COPY . /app/ RUN pip install -r requirements.txt RUN python setup.py install ENV PORT 5000 ENV SERVER_NAME &quot;0.0.0.0:5000&quot; EXPOSE 5000...
<p>I got the issue. As it runs on minikube, it would be minikube IP that I needed to hit. Below command gives the minikube IP:</p> <pre><code>minikube ip </code></pre> <p>Below command returns IP and corresponding service port</p> <pre><code>minikube service --url userauthapp-lb-svc </code></pre>
<p>Any suggestions on how track of kubectl configs(~/.kube/config) which allows you to access the kubernetes clusters? I have clusters running on different environments(local/prod) where i connect to the <strong>same</strong> namespace where project is deployed on and whenever i need to connect to a particular cluste...
<h4>Using kubectl</h4> <p>Kubectl has built in support for <a href="https://v1-18.docs.kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#config" rel="nofollow noreferrer">managing contexts</a>. After you add a context in <code>~/.kube/config</code> file, manually or, via <code>aws eks update-kubeconfig</c...
<p>I mean is there a one to one or many to one relationship between pod and PVC? Can I connect two or more pods to the same PVC(persistent volume claims) without deleting or disconnecting the earlier created pods?</p>
<blockquote> <p>Can I connect two or more pods to the same PVC(persistent volume claims) without deleting or disconnecting the earlier created pods?</p> </blockquote> <p>Yes, this works. But in practice this is a bit more complicated.</p> <p>Persistent Volumes can be created with different <a href="https://kubernetes.i...
<p>I have a <strong>Private AKS cluster</strong> deployed in a VNET on Azure. Once I deployed it, a private endpoint and a private DNS zone were created by default therefore making the cluster accessible from VM's which are part of the same VNET. (<em>I have a VM deployed in the same VNET as the AKS cluster and &quot;k...
<p>The better way to perform the &quot;kubectl&quot; commands from your local machine to your private AKS cluster is to use <a href="https://learn.microsoft.com/en-us/azure/aks/private-clusters#aks-run-command-preview" rel="nofollow noreferrer">AKS Run Command (Preview)</a>. This feature allows you to remotely invoke c...
<p>I have 3 ingress pointing to the same service. In my kubernetes pod, how can i find the hostname and from which subdomain request is coming . my backend code in golang server.<br /> when the request comes to any pod, i want to know from which subdomain(x,y,x) request has come to pod. Currently in the golang code it...
<p>Try to use the <code>X-Forwarded-Host</code> header added by the ingress controller</p>
<p>I am new in <code>AWS</code> and <code>EKS</code>. Everything is going well except I am not able to figure out How to expose the ingress IP/Domain for public usage?</p> <p>I tested on <code>minikube</code> and using <code>minikube ip</code>, I was able to run the application. How should I do it in <code>AWS EKS</cod...
<p>You have to install the ingress controller basically which handles and manages the ingress object.</p> <p>there are multiple ingress controllers available in the market for the Kubernetes you can use one of as per need.</p> <p><a href="https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/" rel...
<p>This is the first time I deployed Cluster Autoscaler (CA) on EKS.</p> <p>The CA configuration file contains Limits &amp; Requests:</p> <pre><code> Limits: │ cpu: 100m │ ...
<p><a href="https://docs.aws.amazon.com/eks/latest/userguide/cluster-autoscaler.html" rel="nofollow noreferrer">Documentation</a> is your friend:</p> <ol> <li>The limits and requests fields in the Cluster Autoscaler (which will basically be a Deployment on k8s) definition will be valid for each pod that will be spawned...
<p>after watching a view videos on RBAC (role based access control) on kubernetes (of which <a href="https://www.youtube.com/watch?v=U67OwM-e9rQ" rel="nofollow noreferrer">this one</a> was the most transparent for me), I've followed the steps, however on k3s, not k8s as all the sources imply. From what I could gather (...
<p>As we can find in the <a href="https://kubernetes.io/docs/reference/access-authn-authz/certificate-signing-requests/#normal-user" rel="nofollow noreferrer">Kubernetes Certificate Signing Requests documentation</a>:</p> <blockquote> <p>A few steps are required in order to get a normal user to be able to authenticate ...
<p>I have question about kubernetes ingress.</p> <p>I want to use ingress with my Amazon account and/or private cloud and want to assign external IP.</p> <p>It is possible to assign external ip for services : <a href="http://kubernetes.io/docs/user-guide/services/#external-ips" rel="noreferrer">Services documentation...
<p>Looking at this <a href="https://github.com/kubernetes-sigs/aws-load-balancer-controller/issues/1867" rel="nofollow noreferrer">issue</a>, it seems you can define annotation on your service and map it to existing <a href="https://aws.amazon.com/premiumsupport/knowledge-center/intro-elastic-ip-addresses/#:%7E:text=An...
<p>I have several apps of different shapes and purposes, each with their own <code>templates/</code> folder as generated by <code>helm create chart</code>. The templates within each App are sufficiently different to justify having them as one-offs. However, the <code>_helpers.tpl</code> is identical for all of them. ...
<p>I wound up solving this by inverting my file structure into something like:</p> <pre><code>Parent App |--Chart.yaml // new |--values.yaml // new |--templates // new |----_helpers.tpl // automagically gets referenced in charts/*/templates |--apps (source code stuff, irrelevant) |--charts |----App1 |------Chart.yaml |...
<p>I have deployed ingress-nginx helm chart ( 3.20.1 , <a href="https://github.com/kubernetes/ingress-nginx/tree/master/charts/ingress-nginx" rel="nofollow noreferrer">https://github.com/kubernetes/ingress-nginx/tree/master/charts/ingress-nginx</a> ) into k8s cluster.</p> <p>Some of the Ingresses configured for applica...
<p>Fixed ( or worked around the problem ) by explicitly adding an Ingress route for every host that gets served in the cluster:</p> <pre><code>apiVersion: networking.k8s.io/v1 kind: Ingress metadata: annotations: kubernetes.io/ingress.class: nginx name: default-route-per-host namespace: ingress spec: rules:...
<p>I'm using Ubuntu 20.04.2 LTS. I installed microk8s 1.20.6 rev 2143 and experimenting with ingress. I must be missing something - but it doesn't work as I expect it to. I tracked the strange behavior down to the following configuration:</p> <p>ingress.yaml:</p> <pre class="lang-yaml prettyprint-override"><code>apiVer...
<p><a href="https://kubernetes.github.io/ingress-nginx/examples/rewrite/" rel="nofollow noreferrer">https://kubernetes.github.io/ingress-nginx/examples/rewrite/</a> explains how to use <code>rewrite-target</code> annotation. I was able to make it work with the following ingress.yaml:</p> <pre class="lang-yaml prettypri...
<p>I'm applying aws-efs-csi driver like this on a kubernates cluster:</p> <pre><code>kubectl apply -k &quot;github.com/kubernetes-sigs/aws-efs-csi-driver/deploy/kubernetes/overlays/stable/?ref=release-1.0&quot; </code></pre> <p>I need to edit the configuration file to add credentials for pulling docker images.</p> <p>I...
<p>It’s a daemonset.</p> <p><code>kubectl -n kube-system edit ds/efs-csi-node</code></p>
<p>I'm playing with the Elasticsearch operator Kubernetes and created two stateful sets (see <a href="https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-orchestration.html" rel="nofollow noreferrer">https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-orchestration.html</a>):</p> <pre class="lang-yaml prettyp...
<p>it's due to the operator you are using for the Elasticsearch. Operator manage the <strong>statefulset</strong> and will update if you delete it.</p> <blockquote> <p>Behind the scenes, ECK translates each NodeSet specified in the Elasticsearch resource into a StatefulSet in Kubernetes.</p> </blockquote> <p>if you rea...
<p>I want to install several private python packages when I create an instance (AI platform).</p> <p>I had the following startup script but it did not install what I needed (but also didnt show any errors):</p> <p>startup_script.sh:</p> <p><code>pip install my_custom_libraries</code></p> <p>why does it not work and wha...
<p>you check the start up script logs at :</p> <pre><code>Compute Engine &gt; (Your Instance Name) &gt; Logs &gt; Serial port 1 (console) </code></pre> <p>also, I am not sure your install have by default python and pip installed ?</p> <p>startup_script.sh:</p> <pre><code>#! /bin/bash apt-get update apt-get install -yq ...
<p>We have configured Grafana <code>user</code> and <code>admin</code> roles using <code>Grafana.ini</code> which works great.</p> <p>Now we want to provide some permission to user to see <strong>specific dashboards</strong>, e.g. user X can see 5 dashboard and user Y can see 8 dashboards according to some configurati...
<p>You need to deploy your Grafana instance with a persistent storage. Either:</p> <ul> <li>Keep using the built-in sqlite db - just ensure to use <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/" rel="nofollow noreferrer">PVC</a> to store it's data. The default path can be set using this <a hre...
<p>I deployed istio/bookinfo on kubernetes, and I want to install stress on the microservice container to inject fault. However, When I use</p> <pre><code>kubectl exec -it reviews-v1-f55d74d54-kpxr2 -c reviews --username=root -- /bin/bash </code></pre> <p>to log in the container, it show that the user is still default....
<p>This is not supported.</p> <p>Source code suggests it's a TODO feature: <a href="https://github.com/kubernetes/kubectl/blob/a0af655b7abaf06983c99ad5a4dc8f02ae5eb3e5/pkg/cmd/exec/exec.go#L100" rel="noreferrer">kubernetes/kubectl/pkg/cmd/exec/exec.go</a></p> <p>The <code>--username</code> flag explained by kubectl:</p...
<p>Two years ago while I took CKA exam, I already have this question. At that time I only could do was to see k8s.io official documentation. Now just curious on generating pv / pvc / storageClass via pure kubectl cli. What I look for is similar to the similar logic as deployment, for example:</p> <pre><code>$ kubectl c...
<h2>TL;DR:</h2> <p>Look, bookmark and build index your brain in all yaml files in this Github directory (content/en/examples/pods) before the exam. 100% legal according to CKA curriculum.</p> <p><a href="https://github.com/kubernetes/website/tree/master/content/en/examples/pods/storage/pv-volume.yaml" rel="nofollow nor...
<p>This might be simple, but I can't seem to figure out why a bash script mounted as a configmap cannot be ran as root:</p> <pre><code>root@myPodId:/opt/nodejs-app# ls -alh /path/fileName lrwxrwxrwx 1 root root 18 Sep 10 09:33 /path/fileName -&gt; ..data/fileName root@myPodId:/opt/nodejs-app# whoami root root@myPo...
<p>See here: <a href="https://github.com/kubernetes/kubernetes/issues/71356#issuecomment-441169334" rel="noreferrer">https://github.com/kubernetes/kubernetes/issues/71356#issuecomment-441169334</a></p> <p>You need to set the defaultMode on the ConfigMap to the permissions you are asking for:</p> <pre><code>volumes: - n...
<p>I have 2 EKS clusters, in 2 different AWS accounts and with, I might assume, different firewalls (which I don't have access to). The first one (Dev) is all right, however, with the same configuration, UAT cluster pods is struggling to resolve DNS. The Nodes can resolve and seems to be all right.</p> <p>1) ping 8.8....
<p>Note that this issue may present itself in many forms (e.g. DNS not resolving is just one possible case). The <code>terraform-awk-eks</code> module exposes a terraform input to create the necessary security group rules that allow these inter worker-group/node-group communications: <code>worker_create_cluster_primary...
<p>I am building my <em>docker</em> image and then deploy using <em>kubernetes</em>.</p> <p>When I execute the command:</p> <pre><code>kubectl get pods NAME READY STATUS RESTARTS AGE lmhfhfhf-def-abc 0/1 Error 0 2m </code></pre> <p>I am almost sure that, it's ...
<p>Welcome to the community @witti_minds</p> <p>@user2830517 and @andD have generally answered it, however I'd like to add a bit more details and sources.</p> <p>Your pod is crashed, however since it was scheduled, options used for running pods will work (<a href="https://kubernetes.io/docs/tasks/debug-application-clus...
<p>This is a Kubespray deployment using calico. All the defaults are were left as-is except for the fact that there is a proxy. Kubespray ran to the end without issues.</p> <p>Access to Kubernetes services started failing and after investigation, there was <strong>no route to host</strong> to the <em>coredns</em> serv...
<p>This is what works for me, I tried to install my k8s cluster using kubespray configured with calico as CNI and containerd as container runtime</p> <pre><code>iptables -P INPUT ACCEPT iptables -P FORWARD ACCEPT iptables -P OUTPUT ACCEPT iptables -F [delete coredns pod] </code></pre>
<p>I learning about k8s and Helm so I started to create a simple flask app which uses mongondb, I have the deployment, the service and the ingress installed with helm and are working fine. For the mongo container I am using the chart from Bitnami, but I need to insert some data on creation, as I do wih the normal deplo...
<p>You've probably figured this out by now, because you were close. I was able to do what you're looking to do using the following in my parent Chart's <code>values.yaml</code>:</p> <pre><code>mongodb: initdbScripts: my_init_script.js: | db = db.getSiblingDB(&quot;cars_db&quot;); db.car_tb.drop(); ...
<p>I am trying to access a remote kubernetes cluster with kubectl. In order to copy/paste cluster credentials in the kubeconfig file I tried to access with &quot;<strong>~/.kube/config</strong>&quot; command but there is an error saying &quot;<strong>No such file or directory</strong>&quot;.</p> <p>Could anyone please ...
<p>In my case I had KUBECONFIG variable set to &quot;~/.kube/config&quot; in .bashrc. The file existed &amp; had correct permissions yet it wasn't being resolved somehow. Turned out I had to use ${HOME} in place of ~. That did the trick.</p>
<p>We're moving a legacy app to Kubernetes. We will have many instances of it running (a Kubernetes namespace per customer), so we want to automate our application upgrade process.</p> <p>Kubernetes has well established patterns for rolling upgrades, but I can't use them (yet). My application requires the following pro...
<p>Yes, there is an existing process for that:</p> <ol> <li><p>Use the <code>kubectl scale</code> command to scale down the existing Deployment to zero replicas: <code>kubectl scale --replicas=0 deploy/my-legacy-deployment</code></p> </li> <li><p>Wait for that to stabilize (there's your requested downtime ;-)</p> <p>Us...
<p>I read the following <a href="https://kubernetes.io/docs/tutorials/kubernetes-basics/expose/expose-intro/" rel="nofollow noreferrer">kubernetes docs</a> which resulted in the following yaml's to run postgresql &amp; pgadmin in a cluster:</p> <pre><code>--- pgadmin-deployment.yaml apiVersion: apps/v1 kind: Deployment...
<hr /> <p>Problems here</p> <ol> <li>you are trying to reach <strong>node internal ip</strong> <code>10.43.225.170</code> instead of <strong>external</strong> one.</li> <li>nodePort service configured incorrectly. In addition you are trying to call incorrect port</li> </ol> <hr /> <p>You haven't specified what platfor...
<p>There is no clear information about how to make a backup and restore from a regular node like node01 for instance, I mean:</p> <ul> <li><p><a href="https://kubernetes.io/docs/tasks/administer-cluster/configure-upgrade-etcd/" rel="nofollow noreferrer">Operating etcd clusters for Kubernetes</a> shows information like ...
<p>It is impossible to backup cluster from a regular node using etcd. <a href="https://www.veeam.com/blog/backup-kubernetes-master-node.html" rel="nofollow noreferrer">The etcd can only be run on a master node.</a></p> <p>But you can backup your Kubernetes cluster by command: <code>etcdctl backup</code>. Here you can ...
<p>I have several apps of different shapes and purposes, each with their own <code>templates/</code> folder as generated by <code>helm create chart</code>. The templates within each App are sufficiently different to justify having them as one-offs. However, the <code>_helpers.tpl</code> is identical for all of them. ...
<p>If one Helm chart includes another as a subchart, any <code>{{ define }}</code> templates anywhere in any of the parent or child charts are visible to all of the charts to be <code>{{ include }}</code>d or <code>{{ template }}</code>d. This means that you can create a <a href="https://docs.helm.sh/docs/topics/libra...
<p>Is there a way to access existing validation specs? For example, I want to be able to set NodeAffinity on my CRD, and would like to just $ref: . I found the entire API here: <a href="https://github.com/kubernetes/kubernetes/blob/master/api/openapi-spec/swagger.json" rel="nofollow noreferrer">https://github.com/kuber...
<p>There unfortunately isn't a way to do nicely this currently. We solved the problem by writing <a href="https://gist.github.com/danrspencer/f695a22b15b1e4e3b3cae75a7a8a93ec" rel="nofollow noreferrer">a horrible Bash script</a> to rip the definition out of Kubernetes and included it via Helm templating into our CRD.</...
<p>I have two EKS Clusters in a VPC.</p> <ol> <li><p>Cluster A running in Public subnet of VPC [Frontend application is deployed here]</p> </li> <li><p>Cluster B running in Private subnet of VPC [ Backend application is deployed here]</p> </li> </ol> <p>I would like to establish a networking with these two cluster such...
<p>At the high level, you will need to expose the backend application via a K8s service. You'd then expose this service via an ingress object (<a href="https://docs.aws.amazon.com/eks/latest/userguide/alb-ingress.html" rel="nofollow noreferrer">see here</a> for the details and how to configure it). Front end pods will ...
<p>I have been trying to run an external-dns pod using the guide provided by k8s-sig group. I have followed every step of the guide, and getting the below error.</p> <pre><code>time=&quot;2021-02-27T13:27:20Z&quot; level=error msg=&quot;records retrieval failed: failed to list hosted zones: WebIdentityErr: failed to re...
<p>I also struggled with this error.</p> <p>The problem was in the definition of the trust relationship.</p> <p>You can see in some offical aws tutorials (like <a href="https://docs.aws.amazon.com/eks/latest/userguide/create-service-account-iam-policy-and-role.html" rel="noreferrer">this</a>) the following setup:</p> <...
<p>I have a script that I want to run using a dockerfile that looks like this:</p> <pre><code>FROM debian:unstable-slim RUN apt-get update &amp;&amp; apt-get install -y netcat-traditional httpie postgresql-client COPY go.sh /tmp/go.sh WORKDIR /tmp CMD [&quot;bash&quot;, &quot;-c&quot;, &quot;/tmp/go.sh&quot;] </code...
<p>The <code>/tmp</code> directory is generally intended for temporary file storage. It's common to mount a RAM disk (<code>tmpfs</code>) there, and it's possible the Kubernetes setup does this without you noticing it.</p> <p>You can address this by storing your script in a location that's on the default <code>PATH</c...
<p>I'm following <a href="https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#check-required-ports" rel="nofollow noreferrer">this</a> and am about to ask our IT team to open the hardware firewall port for me:</p> <p><strong>Control-plane node(s)</strong></p> <div class="s-table-conta...
<p>The answer is: <em>it depends</em>.</p> <ul> <li>You may have specified a different port for serving HTTP with <code>--port</code> flag</li> <li>You may have disabled serving HTTP altogether with <code>--port 0</code></li> <li>You are using latest version of K8s</li> </ul> <p>Last one is most probable as <a href="ht...
<p>Kubernetes creates one PersistentVolume for each VolumeClaimTemplate definition on an statefulset. That makes each statefulset pod have its own storage that is not shared across the replicas. However, I would like to share the same volume across all the statefulset replicas.</p> <p>It looks like the approach should ...
<p>I wholeheartedly agree with the comments made by @Jonas and @David Maze:</p> <blockquote> <p>You can do this, it should work. There is no need to use volumeClaimTemplates unless your app needs it.</p> </blockquote> <blockquote> <p>Two obvious problems are that ReadWriteMany volumes are actually a little tricky to ge...
<p>I have prometheus config that works on my cluster deployed by terraform. Now, I would like to setup Prometheus using the same prometheus.yml locally (outside terraform). I created a new project to set up Promethese using docker-compose and use the same prometheus.yml file but when I go to prometheus site, it seems l...
<p>You are running the <strong>Prometheus</strong> at the local and server level both.</p> <p>server one working fine and getting the metrics of Kubernetes containers as it's on kubernetes.</p> <p>while docker-compose one not working due to you are running it locally on docker not on kubernetes cluster.</p> <p>it's the...
<p>The certificate file of cert-manager is mounted on the nginx volume and is being used.</p> <p>e.g</p> <p><strong>nginx deploy.yaml -</strong></p> <pre><code> volumes: - name: secret-volume secret: secretName: my.test.app.com - name: configmap-volume configMap: name: nginxconfigma...
<p>Not sure that the certificate is for your specific application using <strong>Nginx</strong> or main <code>Nginx ingress</code> which is handing the whole traffic of your cluster.</p> <p>if it is the main <strong>Nginx</strong> which is handling the whole traffic of your cluster you can create the <strong>ingress</st...
<p>I have install bitnami/external-dns on my EKS Kubernetes cluster. The role of the pod is to create new records in my Route53 hosted zone once an Ingress expects the records to be there. No problems to this point.</p> <p>But when removing the Ingress, the Route53 records are not deleted. What is expected to delete th...
<p>The default <code>--policy</code> option in the Chart is <code>upsert-only</code>, this is different from the underlying default in ext-dns itself which is <code>sync</code>. In <code>upsert-only</code> mode, it will not delete anything. This is usually for safety as cleanup can happen in batches and under user supe...
<p>I am trying to use helm charts with k0s.</p> <p>Having my own helm-charts app, I would like to create a local repo. But I cannot use the <code>serve</code> command since I am using version: 3.5.4 and the serve command had been ditched for security concerns.</p> <p>I am not sure now how to create a local repo ? and w...
<p>I would try to use <a href="https://github.com/helm/chartmuseum" rel="nofollow noreferrer">ChartMuseum</a> instead. You can follow the <a href="https://chartmuseum.com/docs/#using-with-local-filesystem-storage" rel="nofollow noreferrer">docs to create a local filesystem chart</a>.</p> <p>You simply deploy the same w...
<p>I am trying to understand the Node-Controller in Kubernetes. Kubernetes <a href="https://kubernetes.io/docs/concepts/architecture/nodes/#heartbeats" rel="nofollow noreferrer">documentation</a> mentions that node heartbeats are done using NodeStatus and LeaseObject updates. Someone, please explain why both mechanisms...
<p><a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.21/#lease-v1-coordination-k8s-io" rel="nofollow noreferrer">Lease</a> is a lightweight resource, which improves the performance of the node heartbeats as the cluster scales.</p> <p>The Lease objects are tracked as a way of helping the heartbea...
<p>My Kubernetes user is not admin in the cluster. So I just cannot create a cluster role binding for filebeat service account. I am using auto discover in filebeat. Can someone help how can I achieve this without clusterrole.</p> <pre><code>apiVersion: v1 kind: ConfigMap metadata: name: filebeat-config namespace:...
<p>Unfortunately, it will not work the way you want it and the error you are getting indicates it perfectly:</p> <pre><code>Performing a resource sync err kubernetes api: Failure 403 pods is forbidden: User &quot;system:serviceaccount:xxxxx:filebeat&quot; cannot list resource &quot;pods&quot; in API group &quot;&quot; ...
<p>I am using K8s 1.21.0 in a bare metal configuration without a loadbalancer. I've installed nginx ingress in a NodePort configuration using helm:</p> <p><code>helm install ********** nginx-stable/nginx-ingress --set &quot;controller.service.type=NodePort&quot; --namespace=nginx-ingress</code></p> <p>Edit: I've also t...
<p>Ok, I ditched the helm installed nginx ingress controller and went with the bare metal installation as documented here:</p> <p><a href="https://kubernetes.github.io/ingress-nginx/deploy/#bare-metal" rel="nofollow noreferrer">https://kubernetes.github.io/ingress-nginx/deploy/#bare-metal</a></p> <p>As soon as this was...
<p>I'm trying to configure a daemonset to run on the global pid namespace resulting the ability to see other processes in the host, including the containers' processes.</p> <p>I couldn't find an option to achieve this. In general, what I'm looking for is close to the sidecar container <code>shareProcessNamespace</code>...
<p>There is an attribute that allows this - <code>hostPID: true</code></p> <p>So the yaml file should looks something like that:</p> <pre><code>apiVersion: apps/v1 kind: DaemonSet metadata: name: busybox spec: selector: matchLabels: name: busybox template: metadata: labels: name: busyb...
<p>I am trying to use helm charts with k0s.</p> <p>Having my own helm-charts app, I would like to create a local repo. But I cannot use the <code>serve</code> command since I am using version: 3.5.4 and the serve command had been ditched for security concerns.</p> <p>I am not sure now how to create a local repo ? and w...
<p>Yes it does, you can also utilize k8slens.dev to easily deploy helm charts to your Kubernetes clusters. Regardless of the distro..</p>
<p>I've got this ingress.yaml base configuration:</p> <pre><code>apiVersion: extensions/v1beta1 kind: Ingress metadata: labels: sia: aza app: asap-ingress-internal name: asap-ingress-internal annotations: kubernetes.io/ingress.class: &quot;nginx-external&quot; nginx.ingress.kubernetes.io/use-regex...
<p>You can use a json patch for this, below is an example.</p> <p>Here is an example <code>kustomization.yaml</code>. It will call out a patch in the <code>patches</code> section:</p> <pre><code>apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - ../../base/app1 patches: - target: kind: I...
<p>Since we don't need to configure most of the Infrastructure services for Containers and Kubernetes, still we have ability to manage different Infrastructure services. Does this make them Infrastructure as a Service or Platform as a Service?</p>
<p>kubernetes is considered PaaS when the control p<a href="https://learn.microsoft.com/en-us/azure/aks/concepts-clusters-workloads" rel="noreferrer">lane components</a>: the scheduler, the API server, ETCD (key-value metadata)and controller are managed by the provider some examples are Microsoft <a href="https://azur...
<p>I tried to run a Helm upgrade before running <code>helm repo update</code> and now it seems to be permanently stuck in &quot;STATUS: pending-upgrade&quot; and won't let me try to run the upgrade again.</p> <p>Trying to run: <code>helm upgrade --namespace coder --install --force --atomic --wait --version 1.13.2 --val...
<p>This solution worked for me:</p> <pre><code>kubectl get secrets kubectl delete secret sh.helm.release.v1.&lt;RELEASE_NAME&gt;.v&lt;LATEST_REVISION&gt; </code></pre> <p>Following the resolution described in <a href="https://github.com/helm/helm/issues/8987#issuecomment-786149813" rel="noreferrer">this issue</a></p>
<p>I use next command to check dns issue in my k8s:</p> <pre><code>kubectl apply -f https://k8s.io/examples/admin/dns/dnsutils.yaml kubectl exec -i -t dnsutils -- nslookup kubernetes.default </code></pre> <p>The nslookup result is:</p> <pre><code>;; connection timed out; no servers could be reached command terminated ...
<p>Finally, I find the root cause, this is hardware firewall issue, see <a href="https://github.com/flannel-io/flannel/blob/master/Documentation/troubleshooting.md#firewalls" rel="nofollow noreferrer">this</a>:</p> <blockquote> <p><strong>Firewalls</strong><br/> When using udp backend, flannel uses UDP port 8285 for se...
<p>I have a Tekton <code>Pipeline</code> and <code>PipelineRun</code> definitions. But, I couldn't achieve to run <code>Pipeline</code> via passing parameter.</p> <pre><code>apiVersion: tekton.dev/v1beta1 kind: PipelineRun metadata: generateName: build-deploy- labels: tekton.dev/pipeline: build-deploy spec: s...
<p>You cannot pass those parameters when using <code>kubectl create</code>.</p> <p>There are two alternatives:</p> <h2>Use tkn cli</h2> <p>You can use <a href="https://github.com/tektoncd/cli" rel="nofollow noreferrer">tkn</a>, a purpose made CLI for Tekton. Then you can start a run of a Pipeline with, e.g.:</p> <pre><...
<p>I just installed the controller via Helm, I can list the helm packages via <code>helm list</code>, but is it possible to list all the controllers running in the cluster via <code>kubectl</code> or <code>api-query</code>?</p>
<p>Not sure if there is a way to list controllers in k8s. every resource/object in k8s is controlled by a controller (control loop) with spec fields as values for desired state. if you have deployed a controller outside control plane (built-in controllers) then what i will do to find the controller:</p> <ol> <li>find t...
<p>Recently, I tried to setup letsencrypt using microk8s and the default ingress controller on a bare-metal server.</p> <p>I found a few guides online that were very useful but it seems as if there must have been a recent update to microk8s that changed the way the ingress controller is configured.</p> <p>To save you g...
<p><strong>This guide is to set up Letsencrypt with Kubernetes using Microk8s and the default Ingress controller.</strong></p> <p><strong>Versions used:</strong></p> <p><em>microk8s version 1.21/stable</em></p> <p><em>cert-manager v1.3.1</em></p> <p><strong>Pre-requisite:</strong> Forward ports 80 &amp; 443 to your ser...
<p>I've added <code>—-runtime-config=batch/v2alpha1=true</code> to the <code>kube-apiserver</code> config like so:</p> <pre><code> ... other stuff command: - "/hyperkube" - "apiserver" - "--admission-control=NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,ResourceQu...
<p>You may use the latest API versions here <code>apiVersion: batch/v1beta1</code> that should fix the issue.</p>
<p>Azure Admins created a cluster for us. On VM I installed <code>&quot;az cli&quot; and &quot;kubectl&quot;</code>. With my account from Azure Portal I can see that Kubernetes Service and Resource Group to which it belongs. From the level of that cluster in Azure Portal I can see that I have a role:</p> <blockquote> <...
<p>In my case to refresh recently granted credentials helped this one:</p> <pre class="lang-sh prettyprint-override"><code>az account set --subscription &quot;your current subscription name&quot; </code></pre> <p>It led to re-login and fix the issue.</p>
<p>Hi there I was reviewing the GKE autopilot mode and noticed that in cluster configureation istio is disabled and I'm not able to change it. Also installation via istioctl install fail with following error</p> <pre><code> error installer failed to update resource with server-side apply for obj MutatingWebhook...
<p><strong>TL;DR</strong></p> <p>It is not possible at this moment to run istio in GKE autopilot mode.</p> <p><strong>Conclusion</strong></p> <p>If you are using Autopilot, you don't need to manage your nodes. You don't have to worry about operations such as updating, scaling or changing the operating system. However, ...
<h1>Installation Process</h1> <p>I am all new to Kubernetes and currently setting up a Kubernetes Cluster inside of Azure VMs. I want to deploy Windows containers, but in order to achieve this I need to add Windows worker nodes. I already deployed a Kubeadm cluster with 3 master nodes and one Linux worker node and thos...
<p>Are you still having this error? I managed to fix this by downgrading windows kube-proxy to at least 1.20.0. There must be some missing config or bug for 1.21.0.</p> <pre class="lang-sh prettyprint-override"><code>curl -L https://github.com/kubernetes-sigs/sig-windows-tools/releases/latest/download/kube-proxy.yml | ...
<p>I have minikube installed on Windows10, and I'm trying to work with <a href="https://kubernetes.io/docs/tasks/access-application-cluster/ingress-minikube/" rel="noreferrer">Ingress Controller</a></p> <p>I'm doing:</p> <blockquote> <p>$ minikube addons enable ingress</p> </blockquote> <pre><code>* After the addon is ...
<p>As already discussed in the comments the Ingress Controller will be created in the <code>ingress-nginx</code> namespace instead of the <code>kube-system</code> namespace. Other than that the rest of the tutorial should work as expected.</p>
<p>I have created subnets in GCP with allotted secondary IP ranges for pods and services. And have started a GKE cluster by providing the above secondary IP ranges for services and pods. Lets call this cluster-A.</p> <p>Now I want to create another GKE cluster within same region, and want to use same subnets. Can I use...
<p>The pod secondary CIDR ranges and sub-networks can be shared across multiple clusters. However, Services secondary CIDR ranges must be different across multiple clusters and cannot be shared because secondary service ranges are unique to a given cluster.</p> <p>Sharing IP ranges is not recommended as :</p> <p>1.It c...
<p>I have around 200-300 yaml files lying around and What I am trying to achieve is to change only the image: option in few of my yaml files, I have a shell script which can get the required yaml files, and I just want to achieve changing the image: key only.</p> <p><strong>Solution Tried:</strong></p> <p>Used a tool <...
<p>This should get you the expected result :</p> <pre><code>for i in ${deployment[@]}; do yq eval '.spec|=select(.selector.matchLabels.component==&quot;portal-1&quot;) .template.spec.containers[0].image = &quot;gcr.io/myrepo/mynginx:1.2.3&quot;' deployment-$i.yaml done </code></pr...
<p>I want to periodically restart the deployment using k8s cronjob.</p> <p>Please check what is the problem with the yaml file.</p> <p>When I execute the command from the local command line, the deployment restarts normally, but it seems that the restart is not possible with cronjob. e.g $ kubectl rollout restart deplo...
<p>as David suggested run cron of <strong>kubectl</strong> is like by executing the command</p> <pre><code>apiVersion: batch/v1beta1 kind: CronJob metadata: name: hello spec: schedule: &quot;*/5 * * * *&quot; jobTemplate: spec: template: spec: serviceAccountName: sa-jp-runner ...