prompt stringlengths 65 38.7k | response stringlengths 41 29.1k |
|---|---|
<p>I am deploying my application in a read only kubernetes cluster, so I am using volumes and volumeMounts for tmp folder for apache server. Upon start of apache server within read only pod, I am getting this error:</p>
<pre><code>chown: changing ownership of '/var/lock/apache2.fm2cgWmnxk': Operation not permitted
</co... | <p>Hello, hope you are envoying your Kubernetes journey !</p>
<p>I wanted to try this on my kind (Kubernetes in docker) cluster locally. So this is what I've done:</p>
<p>First I have setup a kind cluster locally with this configuration (info here: <a href="https://kind.sigs.k8s.io/docs/user/quick-start/" rel="nofollow... |
<p>I am working through "learn kubernetes the hard way" and am at the "bootstrapping the etcd cluster" step: <a href="https://github.com/kelseyhightower/kubernetes-the-hard-way/blob/master/docs/07-bootstrapping-etcd.md" rel="nofollow noreferrer">https://github.com/kelseyhightower/kubernetes-the-hard... | <p>I encountered similar error .
First , I did a mistake in using master-1 ip address in listen-peer-urls,listen-client-urls ,advertise-client-urls & listen-client-urls</p>
<p>Second , try to test if telnet works on telnet 2380.
And if doesnt work , then open firewall on both masters</p>
<p>sudo firewall-cmd --add... |
<p>I have an app running in a kubernetes managed docker container, using Azure Kubernetes Service (AKS). I can output logs to a text file for the app deployment using:</p>
<pre><code>kubectl logs deployment/my-deployment > out.txt
</code></pre>
<p>This gives me a file of around max 28Mb. When I get the docker logs f... | <p><a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#logs" rel="nofollow noreferrer"><code>Kubectl logs</code></a> might read logs with a default log rotation, meaning the <a href="https://stackoverflow.com/a/39398892/6309">logrotate service is active</a>.</p>
<p>Check the content of cat ... |
<p>Let's take this processor as an example: <em>a CPU with 2 cores and 4 threads (2 threads per core)</em>.</p>
<p>From what I've read, such a CPU has 2 physical cores but can process 4 threads simultaneously through hyper threading. But, in reality, one physical core can only truly run one thread at a time, but using ... | <p>This gets very complicated. So k8s doesn't actually manage this it just provides a layer on top of the underlying container runtime (docker, containerd etc). When you configure a container to use 100 <code>millicore</code> k8's hands that down to the underlying container runtime and the runtime deals with it. Now on... |
<p>I have two variable containing my namespaces names:</p>
<pre><code>$KUBE_NAMESPACE_DEV ="stellacenter-dev"
$KUBE_NAMESPACE_STAGE "stellacenter-stage-uat"
</code></pre>
<p>Now I want to modify the following .gitlab-ci.yaml configuration to include the namespace logic:</p>
<pre><code>deploy_dev:
... | <p>You can remove the <code>namespace: NAMESPACE</code> from the manifest, and apply the resource in a namespace using the commandline.</p>
<pre><code>- kubectl apply -f ./provider-service.yml -n ${KUBE_NAMESPACE_DEV}
- kubectl apply -f ./provider-service.yml -n ${KUBE_NAMESPACE_STAGE}
</code></pre>
|
<p>I have tried to deploy Camunda Platform 8 using Helm Chart (<a href="https://artifacthub.io/packages/helm/camunda-platform/camunda-platform" rel="nofollow noreferrer">https://artifacthub.io/packages/helm/camunda-platform/camunda-platform</a>) but am unable to use ingress or load balancer IP for identity service as i... | <p>Like any helm chart you can overwrite the configuration values via separate (custom) values.yaml file. The exact entry for your yaml file will be
<code>global:</code>
<code> identity.auth.publicIssuerUrl: *yourcustomtokenissuerendpoint*</code></p>
<p>More details on helm global variables and how to use/override can ... |
<p>I have joined a project where we deploy our apps on Azure cloud. The apps are in docker containers orchestrated by kubernetes.</p>
<p>We get the data from a POD log file with this command (YAML code below)</p>
<p>kubectl logs --namespace=app-prod <br />
deployment/app-fd-prod <br />
> $(logFile)</p>
<p>where logF... | <p>pod logs get rotated for you as pointed out by @jordanm in the comments. You need a log aggregation tool like the ELK/EFK stack (Elastic + Logstash + kibana or Elastic + fluentd + kibana) or Promtail + loki + grafana. These stacks tail the logs of containers, do some fancy parsing / manipulation and ships it to pers... |
<p>We are following the below article to establish C# client connection to the Ignite Cluster, both of them deployed in the Kubernetes.</p>
<p><a href="https://ignite.apache.org/docs/latest/installation/kubernetes/amazon-eks-deployment#creating-service" rel="nofollow noreferrer">https://ignite.apache.org/docs/latest/in... | <p>This API is not yet available for .NET, the <a href="https://issues.apache.org/jira/browse/IGNITE-13011" rel="nofollow noreferrer">relevant ticket</a> is in progress and most likely will be included into the next release.</p>
<p>For now, you can list a set of server IPs for your thin clients explicitly. And for your... |
<p>I'm trying to do a k8s tutorial on youtube <a href="https://www.youtube.com/watch?v=X48VuDVv0do&t=5428s" rel="nofollow noreferrer">https://www.youtube.com/watch?v=X48VuDVv0do&t=5428s</a>.
An error occured that k8s pod failed to connect mongodb when I create the deployment mongo-express. Please kindly help!</... | <p>I followed the same tutorial and faced the same issue. The problem is with docker. Starting minikube with docker was the issue, seems like docker has some limitations. Install hyperkit if you are using MacOS, Hyper-V if Windows or install virtualbox if you are using some distribution of linux.</p>
<p>Then start mini... |
<p>Is there some way to force pod creation order on Kubernetes?</p>
<p>I have a scenario where Kubernetes are selecting a node pool with few resources and the first pod to be deployed consume a very small resource, but the next one consumes a lot of resources and the deployment fails.</p>
<p>So I was wondering if there... | <p>You can use <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector" rel="nofollow noreferrer">Node Selector</a> on your Pod’s specification, you just need <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#built-in-node-labels" rel="nofollow nore... |
<p>I use istio-ingress gateway and virtualservice to expose different microservices. So far all of them have been http services, so it was straight-forward to follow istio's documentation.</p>
<p>But with kafka I am facing some issues. I am using <a href="https://github.com/bitnami/charts/tree/master/bitnami/kafka" rel... | <p>edit your istio-ingressgateway and add 9092 for tcp port</p>
<pre><code>kubectl edit svc -nistio-system istio-ingressgateway
</code></pre>
<p>add</p>
<pre><code>- name: kafka-broker
port: 9092
protocol: TCP
targetPort: 9092
</code></pre>
|
<p>My GKE deployment consists of N pods (possibly on different nodes) and a shared volume, which is <a href="https://kubernetes.io/docs/concepts/storage/dynamic-provisioning/" rel="nofollow noreferrer">dynamically provisioned</a> by <code>pd.csi.storage.gke.io</code> and is a Persistent Disk in GCP. I need to initializ... | <p><code>...I need to have one disk shared among all pods</code></p>
<p>You can try Filestore. First your create a FileStore <a href="https://cloud.google.com/filestore/docs/creating-instances" rel="nofollow noreferrer">instance</a> and save your data on a FileStore volume. Then you <a href="https://cloud.google.com/ku... |
<p>I'm using Terraform to provision an EKS cluster (mostly following the example <a href="https://learn.hashicorp.com/terraform/aws/eks-intro" rel="nofollow noreferrer">here</a>). At the end of the tutorial, there's a method of outputting the configmap through the <code>terraform output</code> command, and then applyin... | <p>Well, I don't know if that is fresh yet but I was dealing with the same troubles and found out that:</p>
<p><a href="https://github.com/terraform-aws-modules/terraform-aws-eks/issues/699#issuecomment-601136543" rel="nofollow noreferrer">https://github.com/terraform-aws-modules/terraform-aws-eks/issues/699#issuecomme... |
<p>Imagine the following deployment definition in kubernetes:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
env: staging
spec:
...
</code></pre>
<p>I have two questions in particular:</p>
<p>1). The label <code>env: staging</code> won't be available in created pods. ho... | <blockquote>
<p>1). the label env: staging won't be available in created pods. how can I access this data programmatically in client-go?</p>
</blockquote>
<p>You can get the <code>Deployment</code> using client-go. See the example <a href="https://github.com/kubernetes/client-go/tree/master/examples/create-update-delet... |
<p>Is there a way query cpu request and limit with kubectl for each container in a kubernetes context / namespace, just as I can query cpu usage with kubectl top pods.</p>
| <p><a href="https://kubernetes.io/docs/reference/kubectl/jsonpath/" rel="nofollow noreferrer">Requests and limits</a> are the mechanisms Kubernetes uses to control resources such as CPU and memory. Requests are what the container is guaranteed to get. If a container requests a resource, Kubernetes will only schedule it... |
<p>I have an AWS EKS cluster running in a custom VPC with 2 public and 2 private subnets. The node groups (for my backend) run in the 2 private subnets so they can't be accessed directly.</p>
<p>I would like to create an API Gateway which exposes the microservices in the node group so my front-end and third party softw... | <p>You need to use API Gateway private integrations to expose services running in EKS using NLB. Please check the below article for overall solution .</p>
<p><a href="https://aws.amazon.com/blogs/containers/integrate-amazon-api-gateway-with-amazon-eks/" rel="nofollow noreferrer">https://aws.amazon.com/blogs/containers... |
<p>how to list the Kubernetes pod which has CharDevice in it ?</p>
<p>I could able to get the pod with CharDevice, but need to print the pod name only</p>
<pre><code>kubectl get pod -o jsonpath='{spec.volumes.hostPath.type=="CharDevice"}'
</code></pre>
| <p>You can get json first and use <code>jq</code> to get desired result :</p>
<pre><code>kubectl get pod -o json |
jq -r '.items[]|select(any(.spec.volumes[];.hostPath.type=="CharDevice")).metadata.name'
</code></pre>
|
<p>How to setup Apache Pulsar transaction coordinator in Kubernetes setup? I couldn't see much docs on this, though I could modify the <code>broker.conf</code> configmap unsure if that even works.</p>
| <p>The transaction coordinator is a part of the broker, I think you just enable the transaction feature in the broker configmap is ok</p>
|
<p>Trying to install kubernetes dashboard in Ubuntu 16.04 resulting in x509: certificate signed by unknown authority error.</p>
<p>Kubernetes cluster with a single node is running fine and deployments are happening too.</p>
<p>Tried enabling apiserver-host property in kubernetes-dashboard.yaml file without any lock.<... | <p>Had the same issue after resetting k8s to defaults while having <code>kubectl proxy</code> running.</p>
<p>Simply restarting <code>kubectl proxy</code> fixed the issue :)</p>
|
<p>I want to deploy redis pod which loads a list. Then I will have kubernetes job which will execute bash script with variable taken from that list in redis.</p>
<p>How can I make this redis pod to be auto deleted when all items from a list are used?</p>
| <p>By default, Kubernetes keeps the completed jobs and associated objects for debugging purposes, and you will lose all the generated logs by them when deleted.</p>
<p>That being said, a job can be automatically deleted by using the <a href="https://kubernetes.io/docs/concepts/workloads/controllers/job/#ttl-mechanism-f... |
<p>I have a configmap created. I have added data as a key-value pair in configmap</p>
<pre><code>data:
EXTERNAL_CONFIG_FILE: /user/app/api/config
</code></pre>
<p>I need to use this variable to set a mount path in deployment</p>
<pre><code>- name: config-properties-volume-mnt
mountPath: {{ $EXTERNAL_CONFIG_FILE }... | <p><strong>It's not possible to dynamically define any parameter on a manifest</strong>, you have to use the Helm or Kustomize</p>
<p>Or else you can use the <strong>sed</strong> to replace the <strong>Text</strong> in manifest simply</p>
<p>You can not use this way, <strong>configmap</strong> and <strong>secret</stron... |
<p>Is it possible for a pod to act like a spawner? When someone calls the api service in the first pod, it should spawn a new pod. This seems like a very simple thing but I cant really figure out where to look in the docs. Someone already mentioned using operators but I dont really see how that would aid me.</p>
<p>Im ... | <p>Have you looked into Kubespawner part of JupyterHub ?</p>
<p>I have been trying to find alternatives to Kubespawner and Kubernetes Operators might be the answer. <a href="https://kubernetes.io/docs/concepts/extend-kubernetes/operator/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/extend-kubernetes/o... |
<p>I'm not quite sure if which of the following approaches is the better approach to create a controller in kubernetes however I know that:</p>
<ul>
<li>I don't want to create a custom resource by any means.</li>
<li>I do only want to fetch information about k8s native resources (pods, ...) given that there might be a ... | <p>If you don't want to "control" anything, there is no need to create a <em>controller</em>.</p>
<p>If you just want to "read" and "watch" resources, you can use <a href="https://github.com/kubernetes/client-go" rel="nofollow noreferrer">client-go</a> and see e.g. <a href="https://www.cnc... |
<p>My GKE deployment consists of N pods (possibly on different nodes) and a shared volume, which is <a href="https://kubernetes.io/docs/concepts/storage/dynamic-provisioning/" rel="nofollow noreferrer">dynamically provisioned</a> by <code>pd.csi.storage.gke.io</code> and is a Persistent Disk in GCP. I need to initializ... | <p>With GKE 1.21 and later, you can enable the <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/persistent-volumes/filestore-csi-driver" rel="nofollow noreferrer">managed Filestore CSI driver</a> in your clusters. You can enable the driver for new clusters</p>
<pre><code>gcloud container clusters create... |
<p>I can't get Kubernetes to pull my private docker image.</p>
<p>I have a kubernetes secret called <code>regcred</code> in my <code>default</code> namespace looking like:</p>
<pre class="lang-json prettyprint-override"><code>{"auths": {"index.docker.io": {"username": "Username",... | <p>It was a problem with my image and the pod spec needed to be:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Pod
metadata:
name: private-reg
spec:
containers:
- name: private-reg-container
image: jor2/hello-world:latest
imagePullSecrets:
- name: regcred
</code></pre>
|
<p>I have the file <code>example-workflow-cowsay.yml</code>:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: hello-world-
spec:
entrypoint: whalesay
templates:
- name: whalesay
container:
image: docker/whalesay
command... | <p>Yes, it's right there in the <a href="https://github.com/argoproj/argo-workflows/blob/master/examples/README.md#argo-cli" rel="nofollow noreferrer">readme</a> (<a href="https://github.com/argoproj/argo-workflows/blob/37a8a81df1d7ef3067596199f96974d31b200b88/examples/README.md#argo-cli" rel="nofollow noreferrer">vers... |
<p>Streamlit server (run e.g. with <code>streamlit run app-name.py</code>) upon first run for each user requires interaction from her - accepting or rejecting this intro message:</p>
<pre><code> Welcome to Streamlit!
If you are one of our development partners or are interested in
getting personal technical suppor... | <p>In the <a href="https://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options" rel="noreferrer">streamlit documentation</a> you can find a detailed list of configurable options.
Scroll down and you will find the headless option.
Just edit the config file.</p>
<p><code>headless = true</c... |
<p>I'm having difficulty trying to get kustomize to replace contents of an item in a list.</p>
<p>My kustomize file</p>
<pre><code>apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- resource.yaml
patches:
- patch.yaml
</code></pre>
<p>My patch.yaml file</p>
<pre><code>apiVersion: apps/v... | <p>If I remember correctly patches in kustomize by default uses strategic merge, so you need to nullify <code>valueFrom</code>, so your patch should look like:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: web-service
spec:
template:
spec:
initContainers:
- name: web-service-... |
<p>Is there a way to ensure that pods are scaled one at a time when setting replica greater than one?</p>
<p>Example: Replica set to 3</p>
<ol>
<li>Pod 1 - Initializing , pod 2 - Waiting, pod 3 - Waiting</li>
<li>Pod 1 - Running , pod 2 - Initializing, pod 3 - Waiting</li>
<li>Pod 1 - Running , pod 2 - Running, pod 3 -... | <p>You can acomplish this behavior using <code>StatefulSets</code>. As it goes from <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#deployment-and-scaling-guarantees" rel="nofollow noreferrer">Kubernetes docs</a></p>
<blockquote>
<ul>
<li>For a StatefulSet with N replicas, when Pods are ... |
<p>I have an up&running SolrCloud v8.11 cluster on Kubernetes, with solr-operator.</p>
<p>The backup is enabled on S3 bucket.</p>
<p>How can I correctly write the request to perform a <code>RESTORE</code> of a backup stored in a S3 bucket?</p>
<p>I'm unable to figure out what should it be the <code>location</code> ... | <p>A bit late, but I came across this question while searching for the same answer. There was <a href="https://lists.apache.org/list?users@solr.apache.org:2022-2:S3%20backup" rel="nofollow noreferrer">a thread on the mailing list</a> that helped me to figure out how this is supposed to work.</p>
<p>I found the document... |
<p>I'm setting up a CI/CD pipeline for deploying a Kubernetes-based application in an automated way. Part of this deployment involves creating other service accounts and their associated roles.</p>
<p>When my pipeline runs, deployment fails with this error message:</p>
<pre><code>Error: roles.rbac.authorization.k8s.io ... | <p>Sadly, the one permission that was missing was</p>
<pre><code>container.roles.escalate
</code></pre>
<p>Even including every other <code>container.*</code> permission was insufficient; <code>container.roles.escalate</code> was still needed.</p>
<p>This is unfortunate because it makes the cluster more vulnerable to p... |
<p>Copied from here: <a href="https://github.com/kubeflow/pipelines/issues/7608" rel="nofollow noreferrer">https://github.com/kubeflow/pipelines/issues/7608</a></p>
<p>I have a generated code file that runs against Kubeflow. It ran fine on Kubeflow v1, and now I'm moving it to Kubeflow v2. When I do this, I get the fol... | <p>Turns out it has to do with not compiling with the right execution mode on.</p>
<p>If you're getting this, your code should look like this.</p>
<pre><code>Compiler(mode=kfp.dsl.PipelineExecutionMode.V2_COMPATIBLE).compile(pipeline_func=root_module.root, package_path=str(package_yaml_path))
</code></pre>
|
<p>How to modify istio meshconfig access log format when the output accessLogEncoding set to JSON, changing the format as <a href="https://istio.io/latest/docs/tasks/observability/logs/access-log/" rel="nofollow noreferrer">describe on the docs</a> didn't work.</p>
<pre><code>spec:
meshConfig:
accessLogFile: /dev... | <p>It works!, This is what i needed:</p>
<pre><code>spec:
meshConfig:
accessLogFile: /dev/stdout
accessLogEncoding: JSON
accessLogFormat: |
{
"protocol": "%PROTOCOL%",
"upstream_service_time": "%REQ(x-envoy-upstream-service-time)%",
&qu... |
<p>How can I define multiple secrets in one file?
Seems that providing multiple secrets doesn't work.</p>
<pre><code>apiVersion: v1
kind: Secret
metadata:
name: ca-secret
labels:
app.kubernetes.io/managed-by: Helm
type: kubernetes.io/tls
data:
tls.crt: LS0tLDR
tls.key: LS0tLDR
apiVersion: v1
kind: Secret
me... | <p>You can have separate manifests in one yaml file by separating them with <code>---</code>. This will work:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Secret
metadata:
name: ca-secret
labels:
app.kubernetes.io/managed-by: Helm
type: kubernetes.io/tls
data:
tls.crt: LS0tLDR
... |
<p>I recognised a strange behavior after upgrading laravel from 8 to 9. I have a scheduler that executes some jobs.</p>
<p>Kernel.php:</p>
<pre class="lang-php prettyprint-override"><code>$schedule->job(new ImportAzApplications, 'imports')
->everyFiveMinutes()
->onOneServer()
->onFailure(functio... | <p>I have to excuse myself to the community. The Problem was actually caused by an pipeline workflow.</p>
<p>I run <code>laravel</code> on <code>kubernetes</code>. There're multiple pod for different exercises available.</p>
<h2><code>app</code></h2>
<p>the actual laraval application</p>
<h2><code>queue</code></h2>
<p>... |
<p>I have a very simple program:</p>
<pre><code>package main
import (
"fmt"
"github.com/vishvananda/netlink"
)
func main() {
_, err := netlink.LinkByName("wlp164s0")
if err != nil {
fmt.Println("error finding VIP Interface, for building DHCP Link : %v&quo... | <p>After some experimentation, I have come to an understanding that the docker option "--net host" is not the same as "hostNetwork: true" in k8s. I wrongly assumed they produce similar behavior.</p>
<ul>
<li>docker --net host option makes the host interfaces available in the container which is usefu... |
<p>I've installed minikube over VirtualBox in a Windows 10 Home</p>
<p>I am trying to run command: <code>minikube tunnel</code> but I get an error:</p>
<pre><code>Status:
machine: minikube
pid: 10896
route: 10.96.0.0/12 -> 192.168.99.101
minikube: Running
services: []
er... | <p>Solution to this : This solution works to me</p>
<p>Run minikube tunnel in powershell . Run PowerShell as administrator</p>
<pre><code>PS C:\Users\QL752LU> minikube tunnel
Status:
machine: minikube
pid: 9272
route: 10.96.0.0/12 -> 192.168.59.100
minikube: Running
service... |
<p>We followed the solution suggested in <a href="https://stackoverflow.com/questions/71957287/apache-ignite-c-sharp-client-connection-configuration-for-kubernetes">Apache Ignite C# Client Connection configuration for kubernetes</a> as thick client to connect the ignite cluster running in kubrenetes.</p>
<p>We get the ... | <p>In addition to Pavel's response, instead of building your own docker image, you can utilize base image available in GridGain edition: <a href="https://hub.docker.com/r/gridgain/community-dotnet" rel="nofollow noreferrer">https://hub.docker.com/r/gridgain/community-dotnet</a></p>
<p>GridGain Community edition is buil... |
<p>We followed the solution suggested in <a href="https://stackoverflow.com/questions/71957287/apache-ignite-c-sharp-client-connection-configuration-for-kubernetes">Apache Ignite C# Client Connection configuration for kubernetes</a> as thick client to connect the ignite cluster running in kubrenetes.</p>
<p>We get the ... | <p>This Ignite issue on Alpine Linux was fixed in 2.13, which was released yesterday - please try upgrading.</p>
<p><a href="https://issues.apache.org/jira/browse/IGNITE-16749" rel="nofollow noreferrer">https://issues.apache.org/jira/browse/IGNITE-16749</a>
<a href="https://www.nuget.org/packages/Apache.Ignite/2.13.0" ... |
<p>I deployed a EKS cluster via a IAM user and need to give full cluster permission to other aws sso users. I followed this instruction <a href="https://docs.aws.amazon.com/eks/latest/userguide/add-user-role.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/eks/latest/userguide/add-user-role.html</a> but stil... | <p>You should specify:</p>
<pre><code>- rolearn: arn:aws:iam::<aws account id>:role/<federated user>
username: {{SessionName}}
groups:
- system:masters
</code></pre>
<p>Please note that "< aws account id >" is the ID of the AWS account in which the EKS cluster is created, and "&... |
<p>I am installing <code>kube-prometheus-stack</code> with Helm and I am adding some custome scraping configuration to Prometheus which requires authentication. I need to pass <code>basic_auth</code> with <code>username</code> and <code>password</code> in the <code>values.yaml</code> file.</p>
<p>The thing is that I ne... | <p><a href="https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config" rel="nofollow noreferrer">Scrape config</a> support specifying <code>password_file</code> parameter, so you can mount your own secret in volumes and volumemMounts:</p>
<p>Disclaimer, haven't tested it myself, not using ... |
<p>We have a Kubernetes Pod which provides multiple metric endpoints (<code>:3093/metrics</code> and <code>:9113/metrics</code>), but it also has an port which doesn't provide any metric (<code>:80</code>).</p>
<p><strong>TL;DR:</strong> Is is possible to scrape only the ports <code>3093</code> and <code>9113</code>?<... | <p>The suggestion outlined <a href="https://github.com/prometheus/prometheus/issues/3756#issuecomment-767147462" rel="nofollow noreferrer">here</a> allows scraping multiple endpoints per pod. The idea is to give custom names to container ports, which must be scraped, so these names can be used later during relabeling p... |
<p>I have install a minikube on my linux-laptop (Computer A)</p>
<p><a href="https://i.stack.imgur.com/WdHb7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WdHb7.png" alt="enter image description here" /></a></p>
<p>and deploy some service on it :</p>
<pre><code>$ minikube service list</code></pre>
... | <p>First as the doc explain I try to play with <code>minikube</code> startup options.</p>
<pre><code>minikube start --listen-address='0.0.0.0' --ports=80,443
</code></pre>
<p>But as we can see it doesn't change anything:</p>
<pre><code>$ docker container ls |grep minikube
0aafb00fd97d gcr.io/k8s-minikube/kicbase:v0.0... |
<p>it there for Kubernetes an option to set a DNS alias as in can be done within a host file (62.116.156.20 servera)? Where servera is an external server. As a result any pod within the cluster can get in contact to server via DNS.</p>
<p>Thanks</p>
| <p>It totally depends how you configure and deploy your pods. There is an option to add a custom DNS entry to the host file of every pod documented here: <a href="https://kubernetes.io/docs/tasks/network/customize-hosts-file-for-pods/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/network/customize-hosts-f... |
<p>I have a FastAPI app with the following code</p>
<pre class="lang-py prettyprint-override"><code> @app.on_event("startup")
async def startup_event():
"""Initialize application services"""
print("Starting the service")
</code></pre>
<p>when I run Fa... | <p>So, actually, there is no problem with my code, FastAPI, asyncio, or Kubernetes.</p>
<p>Everything was actually working correctly, it's just that the output was buffered.</p>
<p>After adding flush=True to the print statement, everything showed.</p>
<p>I am answering this in case some poor soul stumbles upon this thr... |
<p>I'm trying to understand how the Kubernetes <strong>HorizontalPodAutoscaler</strong> works.
Until now, I have used the following configuration:</p>
<pre><code>apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: my-deployment
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
... | <p>Here is a manifest example for what you need, that includes <strong>Memory Metrics</strong>:</p>
<pre><code>apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
name: web-servers
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: web-servers
minReplicas: 1
maxRepl... |
<p>Can somebody please help me understand why is</p>
<pre><code>kubectl get all --all-namespaces
</code></pre>
<p>lists resources from all namespaces but not Ingress. Even if I specify a particular namespace like the following I still don;t get the Ingress resource</p>
<pre><code>kubectl get all -n app-space
</code></p... | <p><code>kubectl get all</code> is not intended to list all resources cause that would produce unexpected outputs, instead it's meant to list only some most used api resources. check the this <a href="https://github.com/kubernetes/kubernetes/pull/28955#issuecomment-232652070" rel="nofollow noreferrer">Pull Request</a> ... |
<p>I'm running Kubernetes with docker desktop on windows. DD is up-to-date, and the <code>kubectl version</code> command returns 1.22 as both the client and server version.</p>
<p>I executed <code>kubectl run my-apache --image httpd</code>, then <code>kubectl get all</code>, which only shows
<a href="https://i.stack.im... | <p>The <code>kubectl run</code> command create pod not deployment, I mean it used to create in the past before kubernetes version 1.18 I guess.</p>
<p>For deployment you have run this command</p>
<p><code>kubectl create deployment my-apache --image httpd</code></p>
|
<p>I have a K8S service (app-filestash-testing) running like following:</p>
<pre><code>NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
app-filestash-testing ClusterIP 10.111.128.18 <none> 10000/TCP 18h
kubernetes ClusterIP 10.96.0.1 <none>... | <p>From: <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/#what-is-ingress" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/ingress/#what-is-ingress</a></p>
<blockquote>
<p>An Ingress does not expose arbitrary ports or protocols. Exposing services other than HTT... |
<p>Iam able to connect to Kubernetes cluster using Fabric8 api with the following code :</p>
<pre><code> String masterUrl = "<Kube Master Url>";
Map<String, String> certFileNamesMap = getCertificates();
Config config = new ConfigBuilder().withMasterUrl(masterUrl)... | <p>Iam able to figure out the way, we need to use /.kube/config file and copy all the certificates into that file itself, then there is an api in kubernetes java client which reads the config file and gives access to kube cluster.</p>
|
<p>I have a nodejs application running on Google Kubernetes Engine (v1.20.8-gke.900)</p>
<p>I want to add custom header to get client's Region and lat long so I refer to <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/ingress" rel="nofollow noreferrer">this article</a> and <a href="https://cloud.googl... | <p>Actually the issue was with Ingress Controller, I missed to defined "<code>cloud.google.com/backend-config</code>". Once I had defined that I was able to get the custom header. Also I switched to <strong>GKE Ingress controller</strong> (<code>gce</code>) from <code>nginx</code>. But the same things works w... |
<p>Is it possible to obtain Kubernetes logs for a dedicated time range?</p>
<p>All I can do right now is to make a dump of about the last-hour log for the single pod using <code>kubectl logs > dump.log</code> cmd.</p>
<p>But for debugging reasons, it's necessary to obtain the logs for the last week. I was unable to ... | <p><strong>AWK</strong> is an awesome tool in Unix/Linux systems for these types of logical operations</p>
<p>So, to display logs in between two-time ranges (ex: 10 AM to 11 AM):</p>
<ol>
<li><p>Using <code>--since-time</code> and <code>awk</code></p>
<p><code>kubectl logs pod_name --since-time=2022-04-30T10:00:00Z | a... |
<p>I would like to migrate an application from one GKE cluster to another, and I'm wondering how to accomplish this while avoiding any downtime for this process.</p>
<p>The application is an HTTP web backend.</p>
<p>Usually how I'd usually handle this in a non GCP/K8S context is have a load balancer in front of the app... | <p>I see 2 approaches:</p>
<ol>
<li>In the new cluster get a new IP address and update the DNS record to point to the new load balancer</li>
<li>See if you can switch to Multi-cluster gateways, however that would probably require you to use approach 1 to switch to multi-cluster gateways as well: <a href="https://cloud.... |
<p>Consider this Kubernetes Pod:</p>
<pre><code># pod.yaml
apiVersion: v1
kind: Pod
metadata:
name: testing123
spec:
containers:
- name: testing123
image: busybox:latest
command: ['sh', '-c', 'echo "Hello, Kubernetes!" && sleep 3600']
</code></pre>
<p>If I deploy this Pod and run <code>l... | <p>Containers logs are captured from their command line / entrypoint stdout and stderr.</p>
<p>When you enter a container (kubectl exec), you spawn a new process, with its own stdin/stdout/stderr.</p>
|
<p>I use the following function, and I need to <strong>raise</strong> the coverage of it (if possible to 100%), the problem is that typically I use <code>interface</code> to handle such cases in Go and for this specific case not sure how to do it, as this is a bit more <strong>tricky</strong>, any idea?</p>
<p><code>Th... | <p>Whenever I find myself in this scenario, I found that the easiest solution is to create <em>missing</em> interfaces myself. I limit these interfaces to the types and functions that I am using, instead of writing interfaces for the entire library. Then, in my code, instead of accepting third-party concrete types, I a... |
<ol>
<li><p>Using WordPress php-apache-7.4 as base image, I created a Docker file with few customisation and created an image. I am using the same docker-entrypoint.sh, wp-config-docker.php files from the Docker Hub official image.</p>
</li>
<li><p>Using the image when I create a container on Docker Desktop it works fi... | <p>As mentioned in the comment above by David Maze, the issue is due to building the image on Mac M1 Pro.</p>
<p>To fix this I need to add <code>FROM --platform=linux/amd64 <image>-<version></code> in the Dockerfile and build or you can run the below command while running the build</p>
<p><code>docker build... |
<p>I wanted to know exactly what is the difference between '>-' and '|-' especially in kubernetes yaml manifests</p>
| <p>Newlines in folded block scalars (<code>></code>) are subject to line folding, newlines in literal block scalars (<code>|</code>) are not.</p>
<p>Line folding replaces a single newline between non-empty lines with a space, and in the case of empty lines, reduces the number of newline characters between the surrou... |
<p>I have <code>sizeLimit</code> property under <code>emptyDir</code> set to 2Gi in my template base file. I want to remove the <code>sizelimit</code> and just have <code>emptyDir: {}</code>. I've been unable to achieve this using Kustomization overlays. I will detail my folder structure and kustomization yamls below.<... | <p>NB: This answer assumes a recent version of Kustomize (I'm running 4.5.2 locally). Your examples are using deprecated syntax (the <code>bases</code> section was deprecated <a href="https://github.com/kubernetes-sigs/kustomize/blob/661743c7e5bd8c3d9d6866b6bc0a6f0e0b0512eb/site/content/en/blog/releases/v2.1.0.md#resou... |
<p>Is it possible to scale down a pod to 0 replicas when other pod is down?I'm familiar with the basics of the Horizontal Auto-Scaling concept, but as I understand it scales pod up or down only when demands for resources (CPU, memory) changes.
My CI pipeline follows a green/blue pattern, so when the new version of the ... | <p>If you have a <strong>CI</strong> pipeline you can just run the kubectl command and scale down the deployment before deploying the blue-green this way no resource wasting will be there.</p>
<p>However yes, you can scale <strong>UP/DOWN</strong> the deployment or application based on the custom metrics.</p>
<p>i woul... |
<p>Imagine we have a folder of <code>.yaml</code> files containing kubernetes objects, let's say, deployments, configmaps and HPAs.</p>
<pre><code>./file1.yaml # {'kind': 'Deployment', ... }, {'kind': 'ConfigMap', ...}
./file2.yaml # {'kind': 'ConfigMap', ... }, {'kind': 'HorizontalPodAutoscaler', ... }
</code></pre>
<... | <p>I am not entirely sure what the YAML files actually look like. The part after <code>#</code> in your example
isn't correct YAML, so I made things up.</p>
<p>This doesn't affect processing to get what you want. As long as you have valid, loadable YAML,
just recursive over the data and replace entries.</p>
<p>You need... |
<p>I think the question has most of the information. If I have a Service that is a ClusterIP Service, and a Pod accesses that Service, since the load balancing is built into the routing table, are the routing rules smart enough to prefer traffic to the local Node? Is there a way to configure it so that the traffic do... | <p><a href="https://kubernetes.io/docs/concepts/services-networking/service/#internal-traffic-policy" rel="nofollow noreferrer">internalTrafficPolicy</a> is probably what you are looking for.</p>
|
<p>Our team is planning the migration of legacy enterprise application developed in ASP.net web-Forms, to .Net Core 6 as use the containerized approach. For this, mostly we will target the Kubernetes container orchestration platform.</p>
<p>The application is highly configurable and can be integrated with related apps ... | <p>You can do it without restarting the POD using configmap only, however still it more depends on your application end.</p>
<p>You can inject your configmap and mount it to POD Kubernetes auto-reload the config map if mounted to the directory. To note it does not work if you are using the <strong>subpath</strong>.</p>... |
<p>My Rancher cluster is setup around 3 weeks. Everything works fine. But there is one problem while installing MetalLB. I found there is no kubeproxy in my cluster. Even there no kube-proxy pod in every node. I could not follow installation guide to setup config map of kube-proxy</p>
<p>For me, it is really strange to... | <p>Finally, I find my kibe-proxy. It is process of host not docker container.</p>
<p>In Racher, we should edit cluster.yml to put extra args for kube-proxy. Rather will apply in every node of cluster automatically.</p>
<pre class="lang-sh prettyprint-override"><code>root 3358919 0.1 0.0 749684 42564 ? Ssl ... |
<p>I am spinning up a new Jupyter notebook instance from Jupiter hub and wish to have Kubernetes API access from inside the spun up container. According to the <a href="https://zero-to-jupyterhub.readthedocs.io/en/latest/administrator/security.html#kubernetes-api-access" rel="nofollow noreferrer">docs</a>, I added the ... | <p>In order to make kubectl use the projected token, the environment variables KUBERNETES_SERVICE_PORT and KUBERNETES_SERVICE_HOST must be set in your environment. These are automatically injected upon pod start, but likely only for your user, not for the sudo <code>root</code> user.</p>
<p>Make sure to pass these vari... |
<p>Below is my app definition that uses <a href="https://azure.github.io/secrets-store-csi-driver-provider-azure/docs/demos/" rel="nofollow noreferrer">azure csi store provider</a>. Unfortunately, this definition throws <code>Error: secret 'my-kv-secrets' not found</code> why is that?</p>
<h3>SecretProviderClass</h3>
<... | <p>It turned out that secrets store csi works only with <code>volumeMounts</code>. So if you forget to specify it in your yaml definition then it will not work! Below is fix.</p>
<h3>Pod</h3>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Pod
metadata:
labels:
run: debug
name: debug
spe... |
<p>We have one Kubernetes cluster running and we want to connect it to a new cluster. I found Google Clouds <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/multi-cluster-services" rel="nofollow noreferrer">multicluster-service (MCS API)</a> which seems promising, but it needs all <a href="https://cloud.... | <p>i think you can not <strong>move</strong> the cluster to another VPC, although you can create a new or clone the cluster to new VPC.</p>
<p>You can clone the existing one by using <strong>DUPLICATE</strong> tab in cluster details however it will just create infrastructure with the same config specs, during that time... |
<p>I have a Kubernetes cluster set up on Google Kubernetes Engine. I have a pod that hosts an RTMP application. This application requires two ports, one for HTTP and one for RTMP. I have set up an ingress Nginx load balancer. It routes the HTTP traffic correctly. I want to be able to route the RTMP traffic as well. But... | <p>RTMP is a TCP-based protocol and standard Ingress does not support TCP services.</p>
<p>The NGINX Ingress controller (which it looks like you are using) can <a href="https://kubernetes.github.io/ingress-nginx/user-guide/exposing-tcp-udp-services/" rel="nofollow noreferrer">be configured to expose TCP services</a>.</... |
<p>I had a clean Azure subscription and created AKS using Standard SKU and very basic setup (2 D2as_v4 nodes, default settings). Installed NGINX like:</p>
<pre><code>helm install ingress-nginx ingress-nginx/ingress-nginx
</code></pre>
<p>Then put there a dummy app and made it accessible via Ingress + ClusterIP service:... | <p>Not quite sure but it sounds like you ran into this issue: <a href="https://github.com/Azure/AKS/issues/2903" rel="nofollow noreferrer">https://github.com/Azure/AKS/issues/2903</a></p>
<p>The solution was posted in this post: <a href="https://github.com/Azure/AKS/issues/2903#issuecomment-1109758644" rel="nofollow no... |
<p>I am having a small shell script . it has the following snippet of code</p>
<pre><code>kubectl scale deployment sample1 --replicas=0 -n sb1
kubectl scale deployment sample1 --replicas-3 -n sb1
</code></pre>
<p>The first command is scale down my deployment and the second command is to scale up .
is there any flags ... | <p>There is no wait for completion flag in <code>kubectl scale --help.</code> You
may run the following to check if the replica rollout is completed:</p>
<pre><code>kubectl scale deployment sample1 --replicas 5 && kubectl rollout status deployment/sample1
</code></pre>
<p>Example:</p>
<pre><code>kubectl scale d... |
<p>Lets say I create a service account and retrieve the token associated to it:</p>
<pre class="lang-sh prettyprint-override"><code>kubectl -n myexample describe sa myexample-sa
kubectl describe secret myexample-sa-token-xxxxx
</code></pre>
<p>Value of the token:</p>
<pre><code>token: eyJhbGciOiJSUzI1NiIsImtpZCI... | <p>No, they should not be the same when the type is <strong>Service account token volume projection</strong> which is the case above.</p>
<blockquote>
<p>Service account token volume projection: Mounts a short-lived, automatically rotating Kubernetes service account token into the Pod. This token is a OpenID Connect To... |
<p>I'm trying to develop a custom resource on kubernetes with kubebuilder.
In this CR, I have a field of type <code>url.URL</code></p>
<p>I get this error :</p>
<pre><code>(*in).DeepCopyInto undefined (type *url.URL has no field or method DeepCopyInto)
</code></pre>
<p>Is there a way to work with type <code>url.URL</co... | <p>So I found a solution<br />
I don't know if it's the best but I've created a custom type URL with the part which is missing to use <code>net/url</code> with <code>controller-gen</code>.</p>
<p>It works fine
<a href="https://gist.github.com/quentinalbertone/ec00085b57992d836c08d4586295ace7" rel="nofollow noreferrer">... |
<p>I'm trying to port-forward my kubernetes service (through minikube) using the following command:</p>
<pre><code>kubectl port-forward svc/hapi-fhir-server 8080:8080 --address=0.0.0.0
</code></pre>
<p>But after trying to reach <code>localhost:8080</code> I get the following error: <code>"....... an error occurred... | <p>Apparently there was no issue with the Kubernetes or server configuration but rather the Dockerfile that didn't expose port 8080, now it does through the following:</p>
<pre><code># Dockerfile
......
EXPOSE 8080
......
</code></pre>
<p>Thanks to IvanAracki that pointed this out to me through the comments.</p>
|
<p>Running Spring Boot 2.6.6 and Spring Cloud 2021.0.1</p>
<p>I'm attempting to migrate an existing service to Kubernetes so I added a dependency on <code>spring-cloud-starter-kubernetes-client-all</code>. By default, I have <code>spring.cloud.kubernetes.enable=false</code> and use the <code>kubernetes</code> profile t... | <p>Spring Cloud checks whether the application is running in a K8s environment before loading the active spring profile configuration and adds <code>kubernetes</code> to the active profiles. Previously, in Hoxton SR10, the profile was identified and <code>bootstrap-<profile>.yml</code> loaded before checking for ... |
<p>I am creating an Helm Chart and I am having problems when it comes to importing files:</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
name: vcl-template
namespace: {{.Release.Namespace}}
data:
{{- (.Files.Glob "config/varnish/default.vcl.tmpl").AsConfig | nindent 2 }}
{{- (.Files.Glob ... | <p>They're actually equivalent from YAML's PoV, just not as pretty, but most important for your specific case it's because yaml cannot represent <strong>trailing</strong> whitespace without quoting it, which is what it did due to line 164 of your .tmpl file, as seen by the <code>\n \n</code> in:</p>
<pre class="lang... |
<p>I am trying to create an operator using operator-sdk.</p>
<p>I have installed opeator-sdk on my mac OS.</p>
<p>My Environment Details :</p>
<p>go version <strong>go1.15.12 darwin/amd64</strong></p>
<p>operator-sdk version: <strong>"v1.7.2", commit: "6db9787d4e9ff63f344e23bfa387133112bda56b", kube... | <p>The bellow commands show how you can run and scaffold an operator with the <code>operator-sdk</code> CLI tool. As of writing the latest version is v1.20.0. It covers some of the pitfalls such as setting the correct GO environment variables and installing the gcc for some OS. I tried it with <code>Ubuntu 18.04.3 LTS ... |
<p>Starting MongoDB with this connection string <code>mongodb://mongo-service:27017</code> is giving me this error.</p>
<p>The issue only happens for me when running on Kubernetes. Localhost is working fine.</p>
<pre><code>ERROR:src.app:Exception on /api/polls [GET]
Traceback (most recent call last):
File "/.ve... | <p>As it is required by the Kubernetes manifest schema, Secret values must be encoded in Base 64, which I was doing like this:</p>
<pre class="lang-sh prettyprint-override"><code>$ echo 'mongodb://mongo-service:27017' | base64
bW9uZ29kYjovL21vbmdvLXNlcnZpY2U6MjcwMTcK
</code></pre>
<p>This was adding a line-break at the... |
<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>You have to disable http ssl, for this you have to modify the config/elasticsearch.yml file and change the associated variable to false:</p>
<pre><code>xpack.security.http.ssl:
enabled: false
keystore.path: certs/http.p12
</code></pre>
|
<p>I am trying to update a complex object via a path value which it appear ReJson can do.
I have used it as a Cache just fine, I want to use it as a json collection store for real time data (similar to mongodb).</p>
<p>for example:
{
"name": "Michael \u0027Mike D\u0027 Diamond",
"employeeID&quo... | <p>You can do this with the <code>JSON.GET</code> command and JSON path syntax (<a href="https://redis.io/docs/stack/json/path/" rel="nofollow noreferrer">docs here</a>)</p>
<p>First, save the document in Redis at key "jsondoc":</p>
<pre><code>127.0.0.1:6379> json.set jsondoc $ '{ "name": "M... |
<p>I am trying to create a module in Terraform to create the basic resources in a Kubernetes cluster, this means a <code>cert-manager</code>, <code>ingress-nginx</code> (as the ingress controller) and a <code>ClusterIssuer</code> for the certificates. In this exact order.</p>
<p>The first two I am installing with a <co... | <p><a href="https://cert-manager.io/docs/installation/helm/#option-1-installing-crds-with-kubectl" rel="nofollow noreferrer">Official documentation</a> says to use <code>kubectl apply</code> before installing this with a helm chart, making it a two step process. Using Terraform, this would make it a 3 step process in ... |
<p>Just study the core of K8S on local machine (Linux Mint 20.2).</p>
<p>Created one node cluster locally with:</p>
<blockquote>
<p>k3d cluster create mycluster</p>
</blockquote>
<p>And now I want to run spring boot application in a container.<br />
I build local image:</p>
<blockquote>
<p>library:0.1.0</p>
</blockquot... | <p>If you don't want to use a docker registry, you have to import the locally built image into the k3d cluster:</p>
<pre><code>k3d image import [IMAGE | ARCHIVE [IMAGE | ARCHIVE...]] [flags]
</code></pre>
<p>But don't forget to configure in your deployment:</p>
<pre><code>imagePullPolicy: Never
</code></pre>
|
<p>I am configuring an EKS cluster using terraform in a private subnet and trying to access it using a VPN in a public subnet. When I configured it, it works fine but now when I run kubectl get pods or kubectl get svc, it is throwing an error:</p>
<p><code>error: exec plugin: invalid apiVersion "client.authenticat... | <p>It's broken with <code>kubectl</code> version <code>1.24</code>. Downgrade to <code>1.23.6</code> will fix the issue for now</p>
<pre><code>sudo apt install kubectl=1.23.6-00
</code></pre>
|
<p>I have CircleCI setup and running fine normally, it will helps with creating deployment for me. Today I have suddenly had an issue with the step in creating the deployment due to an error related to kubernetes.</p>
<p>I have the config.yml followed the doc from <a href="https://circleci.com/developer/orbs/orb/circle... | <p>I was facing the exact issue since yesterday morning (16 hours ago). Then taking @Gavy's advice, I simply added this in my <code>config.yml</code>:</p>
<pre class="lang-yaml prettyprint-override"><code>steps:
- checkout
# !!! HERE !!!
- kubernetes/install-kubectl:
kubectl-version: v1.23.5
- run:
</code... |
<p>While using this command for RBAC <code>"kubectl config set-cluster test --server=https://127.0.0.1:52807"</code> the IP here is from the kind-cluster that I am running after which I use <code>"kubectl config set-context test --cluster=test"</code> followed by required credentials & switch t... | <p><code>kubectl config set-cluster</code> sets a cluster entry in your <code>kubeconfig</code> file (usually found in <code>$HOME/.kube/config</code>). The <code>kubeconfig</code> file defines how your <code>kubectl</code> is configured.</p>
<p>The cluster entry defines where <code>kubectl</code> can find the kubernet... |
<p>I have created a GKE cluster on GCP.</p>
<p>Kubernetes logs from kubectl logs command is different to /var/log/containers</p>
<p>kubectl</p>
<pre><code>{"method":"GET","path":"/healthz","format":"*/*","controller":"Public::PublicPagesControll... | <p>This problem is related to Container Runtime Interface (CRI). You can read about CRI <a href="https://kubernetes.io/blog/2016/12/container-runtime-interface-cri-in-kubernetes/" rel="nofollow noreferrer">here</a>.</p>
<p>For now, I'm still can not change the log format as I want, I just adapt to this new format. This... |
<p>I created EKS cluster and now i need to add http_proxy/http_proxies and no_proxy as environment variable to all 300 deployments. I created a config map with the variables. Is there a way to update all pods simultaneously without doing it one by one? And if yes how can i do it? My config map name is proxy-environment... | <p>You can use the <code>set env</code> to update the environment variable into the deployment:</p>
<pre><code>kubectl set env deployment --all --from=configmap/my-env-config
</code></pre>
<p>Example: The following example is demonstrating if there are multiple deployments, how to add env variables to their pods.</p>
... |
<p>I have a GKE cluster, external domain name, and letsencrypt certs.
When I am using a Load balancer and instruct pods to use certs that I generate using certbot then performance is quite good. But I have to renew certs manually which takes a lot of effort.</p>
<p>When using an ingress controller and letting cert-mana... | <p>There is no extra hop if you are using the cert-manager with ingress.</p>
<p>You can use the cert-manager it will save the <strong>cert</strong> into <strong>secret</strong> and attach to ingress. However, it's up to you where you are doing TLS termination.</p>
<p>You can also bypass the HTTPS traffic till POD for e... |
<p>i am trying to make a cicd pipeline github->travisci->aws eks
everything works fine images are posted to dockerhub and all.but when travis is executing kubectl apply -f "the files" it is throwing a error.. error: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1alpha1"</p>
<p... | <p>We were installing the latest version of kubectl in CI and hit this error today. After pinning to a previous version (1.18) the error was resolved.</p>
<p>the last working version was 1.23.6 and we saw errors with 1.24</p>
|
<p>I am trying to track all API requests to my kubernetes cluster running on some ec2 instances. How do I go about doing this?</p>
<p>I am basically trying to check which IP the request is sent from, any data sent and any other discerning information.</p>
<p>I tried using prometheus but have not had any luck so far.</p... | <p>You can enable <a href="https://kubernetes.io/docs/tasks/debug/debug-cluster/audit/" rel="nofollow noreferrer">Auditing</a> on your cluster. For specific resource, use <code>resourceNames</code> in the audit policy to specify the resource name.</p>
|
<p>The following code will throw an <code>ApiException 410 resource too old</code> on the second <code>watch.stream()</code>:</p>
<pre><code># python3 -m venv venv
# source venv/bin/activate
# pip install 'kubernetes==23.3.0'
from kubernetes import client,config,watch
config.load_kube_config(context='my-eks-context')... | <p>It seems that in the initial response to the watch (from an EKS cluster 1.21) the events can be returned in any order.</p>
<p>I did two subsequent watches two seconds apart and they contain the same 30 events in completely different ordering.</p>
<p>So it's not guaranteed that the last resource version that you see ... |
<p>I am trying to track all API requests to my kubernetes cluster running on some ec2 instances. How do I go about doing this?</p>
<p>I am basically trying to check which IP the request is sent from, any data sent and any other discerning information.</p>
<p>I tried using prometheus but have not had any luck so far.</p... | <p>You can setup auditing in your Kubernetes Cluster.
Refer to this link <a href="https://kubernetes.io/docs/tasks/debug/debug-cluster/audit/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/debug/debug-cluster/audit/</a></p>
|
<p>I am trying to deploy the aws-load-balancer-controller on my Kubernetes cluster on AWS = by following the steps given in <a href="https://docs.aws.amazon.com/eks/latest/userguide/aws-load-balancer-controller.html" rel="noreferrer">https://docs.aws.amazon.com/eks/latest/userguide/aws-load-balancer-controller.html</a>... | <p>I am not sure if this helps, but for me the issue was that the version of the aws-load-balancer-controller was not compatible with the version of Kubernetes.</p>
<ul>
<li>aws-load-balancer-controller = v2.3.1</li>
<li>Kubernetes/EKS = 1.22</li>
</ul>
<p>Github issue for more information:
<a href="https://github.com/... |
<p>I am reading the tekton <a href="https://tekton.dev/vault/pipelines-v0.14.3/auth/" rel="noreferrer">docs</a> on authentication it explains that two things are needed to do authentication</p>
<p>Create a secret docs give example below</p>
<pre><code>apiVersion: v1
kind: Secret
metadata:
name: basic-user-pass
annota... | <p>hope you are enjoying your kubernetes journey !</p>
<p><em><strong>1) what does it mean for a service account to have secrets added to it? / Why is it useful to add a secret to a service account?</strong></em></p>
<p>Fist of all, a little remider:</p>
<p>As you may know, you have to see the serviceAccount as a user ... |
<p>I have a k8s dev cluster (in aks). I previously used the bitnami chart for deployment of a single MongoDB pod and I never had the following problem.</p>
<p>As I'm now using a feature that only works with replicaSets, I recently moved to using the MongoDBCommunity Operator to create a single instance MongoDB replicaS... | <p>So, based on writing up the question and therefore organising my thoughts, I have found the reason this is happening and the answer.</p>
<p>I had suggested in my question that this might be a redirect problem, and now I have proof that this is the issue. I've added the following entry to my hosts file:</p>
<pre><cod... |
<p>I am trying to create a replicaset with kubernetes. This time, I don't have a yml file and this is why I am trying to create the replicaset using a command line.
Why <code>kubectl create replicaset somename --image=nginx</code> raise an error, and how to fix this?</p>
| <p>You cannot create <code>replicaset</code> using the command line. Only the following resource creation is possible using <code>kubectl create</code>:</p>
<pre><code>kubectl create --help |awk '/Available Commands:/,/^$/'
Available Commands:
clusterrole Create a cluster role
clusterrolebinding Create a ... |
<p><strong>What I am trying to do?</strong></p>
<p>I want to create a <a href="https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/service" rel="nofollow noreferrer">kubernetes service</a> object using terraform, but make it re-usable. So everytime there's a new service, I could just appe... | <p>You do the same as with other properties:</p>
<pre><code>resource "kubernetes_service" "service" {
for_each = var.apps
metadata {
name = each.value.svc_name
namespace = each.value.namespace
annotations = each.value.annotations
}
spec {
selector = each.value.selector ... |
<p>I am trying to update a custom resource:</p>
<pre class="lang-sh prettyprint-override"><code>kubectl edit ticketservice r134-4979a2f6-f46d-405d-97bc-ab1ba -n 2b9aea53dbfc47a
</code></pre>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: ticketservice.ias.alpha.com/v1alpha1
kind: TicketService
metadata:
... | <p><code>creationtimestamp</code> can only be set by Kubernetes as it turns out. From a trusted source but sadly don't have the specific k8s docs ref.</p>
|
<p>So after updating to Docker Desktop 4.7.1, local kubernetes (v1.22.5) now is stuck at starting.</p>
<p><a href="https://i.stack.imgur.com/LAkxm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LAkxm.png" alt="enter image description here" /></a></p>
<p>Uninstalled and re-installed latest Docker Des... | <p>Ok after couple of hours of trouble shooting I was able to resolved the issue.</p>
<h3><strong>Step 1: Reset Docker Desktop To Factory Defaults</strong></h3>
<p>Right click docker icon on system tray, then choose <strong>troubleshoot</strong>, then click the <strong>Reset to factory defaults</strong> button.</p>
<p>... |
<p>From <a href="https://kubernetes.io/docs/reference/using-api/api-concepts/#efficient-detection-of-changes" rel="nofollow noreferrer">Kubernetes API Concepts > Efficient detection of changes</a>:</p>
<blockquote>
<p>When retrieving a collection of resources (either namespace or cluster scoped), the response from t... | <p>From <a href="https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions" rel="nofollow noreferrer">Resource Version Semantics</a></p>
<blockquote>
<p>You must <strong>not assume resource versions are numeric</strong> or collatable. API clients may only compare two resource versions for equality ... |
<p>When a pod is in crashLoopBackOff state (for example), are the <strong>requested</strong> resources (CPU and MEMORY) still allocated to this pod ?</p>
<p>If you have the answer, please explain how did you do to make sure that it is or not still allocated to the pod <3</p>
| <p>I got the answer, here is the test:</p>
<p>However the number of nodes I got or the amount of resources they have, I will create a resourceQuota for the namespace where I will perform the test:</p>
<p><code>resourceQuota.yaml</code>:</p>
<pre><code>apiVersion: v1
kind: ResourceQuota
metadata:
name: test-so
spec:
har... |
<p>I'm currently getting errors when trying to exec or get logs for my pods on my GKE cluster.</p>
<pre class="lang-sh prettyprint-override"><code>$ kubectl logs <POD-NAME>
Error from server: Get "https://<NODE-PRIVATE-IP>:10250/containerLogs/default/<POD-NAME>/<DEPLOYMENT-NAME>": remo... | <p>Assume this answer may help ,</p>
<p>*This issue is due to <strong>pending</strong> Certificate Sigining Requests for nodes made by kubelet running in each node *</p>
<p>to check the csr pending for nodes</p>
<pre><code>kubectl get csr --sort-by=.metadata.creationTimestamp
</code></pre>
<p>then approve the csr fo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.