Question stringlengths 65 39.6k | QuestionAuthor stringlengths 3 30 ⌀ | Answer stringlengths 38 29.1k | AnswerAuthor stringlengths 3 30 ⌀ |
|---|---|---|---|
<p>I am trying to use the kubectl run command to create a Pod that uses a custom serviceaccount "svcacct1" instead of default serviceaccout. There seems to be no switch for providing a specific serviceaccount within the run command so leveraging --overrides switch to provide JSON as shown below. </p>
<pre><code>kubec... | Razi | <p>The <code>--serviceaccount</code> flag isn't present in current versions (1.21) and got deprecated as mentioned in the <a href="https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.21.md" rel="noreferrer">changelog</a>.</p>
<p>But with a slight modification to the command mentioned in the quest... | Christian |
<p>I have REST API Web service on Internal GKE cluster which I would like to expose with internal HTTP load balancing.</p>
<p>Let's call this service "blue" service:
I would like to expose it in following mapping:</p>
<pre><code>http://api.xxx.yyy.internal/blue/isalive -> http://blue-service/isalive
http:/... | danny.lesnik | <p>I solved the problem and writing it here to memo it and hopefully someone will find it as useful.</p>
<ul>
<li><p>First problem is that I have mixed annotations types. one of GKE ingress controller and second for Nginx Server controller. Currently GKE ingress controller doesn't support URL rewrite feature, so I need... | danny.lesnik |
<p>Why does using Ansible variable make the following Ansible simple task to fail?</p>
<pre><code>- name: Create secret
kubernetes.core.k8s:
state: present
definition:
apiVersion: v1
kind: Secret
metadata:
name: somename
namespace: default
type: Opaque
stringData:... | Mohammed Noureldin | <p>I'd guess you're getting bitten by the ansible+jinja2 auto-coercion behavior due to the leading <code>{</code> in that field. The usual work-around for that is one of two ways, depending on whether the upstream system tolerates any leading whitespace or not</p>
<h3><code>|string</code> filter</h3>
<pre class="lang-y... | mdaniel |
<p>I want to change timezone with command.
I know applying <code>hostpath</code>.</p>
<p>Could you know how to apply command ?</p>
<pre><code>ln -snf /user/share/zoneinfor/$TZ /etc/localtime
</code></pre>
<p>it works well within container. But I don't know applying with command and arguments in yaml file.</p>
| canerbis | <p>Setting TZ environment variable as below works fine for me on GCP Kubernetes.</p>
<pre><code>---
apiVersion: apps/v1
kind: Deployment
metadata:
name: demo
spec:
replicas: 1
selector:
matchLabels:
app: myapp
template:
metadata:
labels:
app: myapp
spec:
containers:
... | rantoniuk |
<p>I am playing around with kubernetes config map and wanted to understand how the volume mounts work</p>
<p>I have a json config file called <code>client_config.json</code> that is</p>
<pre><code>{
"name": "place",
"animal": "thing",
"age": 10
}
</code></pre>
<p>... | Anand Sunderraman | <p>Thanks to <a href="https://stackoverflow.com/users/10008173/david-maze">David</a>'s comment I was able to resolve the issue.</p>
<p>Issue was I was including the <code>client_config.json</code> file along with the image, because of which my code was able to reference it via the path <code>./client_config.json</code>... | Anand Sunderraman |
<p>Why does docker kubernetes duplicate pods? I see on the dashboard some pods with k8s and with k8s_POD even my deployments.yaml has replica=1</p>
<p>Does anyone have any ideas on this?</p>
| Rafael Souza | <p>All <code>containers:</code> in a kubernetes <code>Pod</code> share the same cluster's Pod IP address, and for each one of them <code>127.0.0.1</code> is <em>the same as the others</em>. The way that magic happens is via that <code>k8s_POD_</code> container, which is the one running the <a href="https://groups.googl... | mdaniel |
<p>When managing entities semantically connected with Kubernetes, it makes sense to let Kubernetes manage them. Kubernetes manages <code>ServiceAccount</code> as a resource kind, but does not have similar kinds for human users or groups.</p>
<p>I'm wondering what is the design decision behind this. I know that <code>Se... | J. Tarasov | <p>There actually are <a href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/#rolebinding-example" rel="nofollow noreferrer"><code>User</code></a> entities in RBAC, but kubernetes delegates the instantiation of those to either <a href="https://kubernetes.io/docs/reference/access-authn-authz/authenticatio... | mdaniel |
<p>While looking for a kubernetes equivalent of the docker-compose watchtower container, I stumbled upon renovate. It seems to be a universal tool to update docker tags, dependencies and more.</p>
<p>They also have an <a href="https://docs.renovatebot.com/examples/self-hosting/#kubernetes" rel="nofollow noreferrer">exa... | yspreen | <p>I found one <strong><a href="https://keel.sh/" rel="nofollow noreferrer">keel</a></strong> which looks like watchtower:</p>
<blockquote>
<p>Kubernetes Operator to automate Helm, DaemonSet, StatefulSet & Deployment updates</p>
</blockquote>
<p>Alternatively, there is <strong><a href="https://crazymax.dev/diun/pro... | papanito |
<p>I have used the following configuration to setup the Istio</p>
<pre><code>cat << EOF | kubectl apply -f -
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
namespace: istio-system
name: istio-control-plane
spec:
# Use the default profile as the base
# More details at: https://istio.io... | One Developer | <p>I got it working as mentioned below</p>
<pre><code>cat << EOF | kubectl apply -f -
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
namespace: istio-system
name: istio-control-plane
spec:
# Use the default profile as the base
# More details at: https://istio.io/docs/setup/additional-... | One Developer |
<p>I have Docker Desktop (Windows) installed, and have turned on Kubernetes.</p>
<p>I've installed the Nginx ingress controller by running the following command:</p>
<pre><code>kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.0.4/deploy/static/provider/cloud/deploy.yaml
</code><... | Dan | <p>I worked it out, after a hint from @clarj about checking the Nginx Controller pod logs.</p>
<p>Turned out I was missing the following annotation from my ingress...</p>
<pre><code> annotations:
kubernetes.io/ingress.class: "nginx"
</code></pre>
<p>(see my 'Update' in my initial post)</p>
<p>After that ... | Dan |
<p>I define a Secret:</p>
<pre><code>apiVersion: v1
kind: Secret
metadata:
name: mysecret
type: Opaque
stringData:
config.yaml: |-
apiUrl: "https://my.api.com/api/v1"
username: Administrator
password: NewPasswdTest11
</code></pre>
<p>And then creating volume mount in Deployment:</p>
<pre><code>apiVer... | eddyuk | <p>As you can see <a href="https://github.com/kubernetes/kubernetes/issues/62099" rel="noreferrer">here</a> it is not possible by intention:</p>
<blockquote>
<p>Secret, configMap, downwardAPI and projected volumes will be mounted as read-only volumes. Applications that attempt to write to these volumes will receive ... | papanito |
<p>I need to make the installation of this resource file to be conditionally applied based on the flag istioEnables from the values.yaml</p>
<p><strong>virtualService.yaml</strong></p>
<pre><code>{{ if .Values.istioEnabled }}
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: {{ .V... | Shima Mahmoud | <p>It's caused by the leading two spaces in your file:</p>
<pre class="lang-yaml prettyprint-override"><code>{{ if eq 1 1 }}
apiVersion: v1
kind: Kaboom
{{ end }}
</code></pre>
<p>produces the same error:</p>
<blockquote>
<p>Error: YAML parse error on helm0/templates/debug.yaml: error converting YAML to JSON: yaml:... | mdaniel |
<p>I have a custom resource in my OpenShift cluster (kubernetes cluster) that looks something like below. I want my Ansible operator, made using Operator-SDK, to consume the value of spec.storage.size and spec.storage.type. How do I do that?</p>
<pre><code>apiVersion: my.domain.com/v1alpha1 ... | Josiah | <p>The storage yaml block is passed as a hash to Ansible. You can use either bracket or dot notation to find the value. In the lines below, I'm using dot notation to get the size and bracket notation to determine if the type of storage is persistent.</p>
<pre><code>- debug:
msg: "Requested size is {{ storage.size ... | Josiah |
<p>Running the following commands as in the docs on my clean Ubuntu 16.04 server:</p>
<pre><code>minikube start --memory=7168 --cpus=3 --kubernetes-version=v1.10.0 --vm-driver=kvm2
kubectl apply -f istio-1.0.4/install/kubernetes/helm/helm-service-account.yaml
helm init --service-account tiller --wait
helm install isti... | Jjang | <p>Okay, you're not going to like this. It seems to be an issue with helm v2.12.0.</p>
<p>You'll need to downgrade to v2.11.0 for it to work successfully. I've included some of the necessary changes to your helm install to make it work below.</p>
<pre><code># download the right client version
curl https://raw.githubu... | jonbcampos |
<p>I'm getting a strange <code>400</code> error when I try to connect to an <code>Istio Gateway</code> when behind an <code>AWS</code> load balancer. </p>
<p>I don't see any activity in the <code>istio-ingresgateway</code> logs (even with debug settings on), but when I run <code>sysdig</code> on the <code>ingressgatew... | Joe J | <p>So I found the answer to this question. The garbage in the request was a read herring. </p>
<p>A little more info about the setup:</p>
<p>The AWS load balancer was terminating TLS, so all the traffic behind it was going over the http port 31380. I was already passing the <code>X-Forwarded-Proto: https</code> heade... | Joe J |
<p>i'm executing a sql query in my changeset as follow:</p>
<pre><code><changeSet author="xxxxx" id="1682329977552-1" context="unittest">
<preConditions onFail="CONTINUE">
<sqlCheck expectedResult="1"> SELECT COUNT(*) FROM pg_roles WHERE rolname='myus... | Abolfazl | <p>As written in <a href="https://docs.liquibase.com/concepts/changelogs/property-substitution.html" rel="nofollow noreferrer">property-substitution</a> you can pass properties to the liquibase command CLI with <code>-D</code> prefix (or you can use other method), so something like <code>-Dproperty-name=somevalue</code... | bilak |
<p>I use EKS Cluster and node groups to set up my Flink Cluster. When a node group scales down, some nodes are removed and taskmanager pods(actually k8s deployment) are re-deployed in another node.</p>
<p>Although flink restarts whole job based on its latest checkpoint, some data is duplicated as the checkpoint does no... | holly | <p>When your job restarts, Flink will replay data from the source Kafka topic, beginning with the saved offset(s) from the last checkpoint. To avoid having downstream consumers see duplicate data in the output Kafka topic, you need to do the following in your Flink job:</p>
<ul>
<li>Enable Flink checkpointing with mode... | kkrugler |
<p>Currently I try to use <code>KubeVirt</code> with <code>GKE</code> cluster.</p>
<p>What I have done (follow the official document):</p>
<ol>
<li>Create a <code>GKE</code> cluster with 3 nodes via GCP console</li>
<li>Install <code>kubectl</code> locally and connect to this cluster</li>
<li>Install <code>kubevirt</... | chen lin | <p>You can start vm without <code>virtctl</code> by updating VM's manifest using <code>kubectl</code></p>
<pre><code>kubectl patch virtualmachine testvm --type merge -p '{"spec":{"running":true}}'
</code></pre>
| Denis Palnitsky |
<p>I tried with the <code>kubectl get sa default</code> command, but only see some very basic values. What's the command to view the permissions/roles associated with a specific service account in k8s?</p>
| injoy | <p>The following command could help. It basically gets the RoleBindings and ClusterRoleBindings which .subjects[0] is the name of the ServiceAccount.</p>
<pre><code>$ kubectl get rolebinding,clusterrolebinding --all-namespaces -o jsonpath='{range .items[?(@.subjects[0].name=="SERVICE_ACCOUNT_NAME")]}[{.roleRef.kind},{... | Luc |
<p>I am trying to work through the Istio quickstart guide here and am having trouble with the step <a href="https://preliminary.istio.io/docs/examples/bookinfo/#confirm-the-app-is-accessible-from-outside-the-cluster" rel="nofollow noreferrer">confirm the app is accessible from outside the cluster</a>. </p>
<p>I'm on a... | RockyMountainHigh | <p>I found the confusion thanks to <a href="https://discuss.istio.io/t/istio-on-docker-edge-cant-access-service-externally/2408" rel="nofollow noreferrer">this post</a> in the istio community. In that post they mention that to find the ingress port they are running the following command:</p>
<pre><code>export INGRESS_... | RockyMountainHigh |
<p>I'm setting up Apache Airflow in Kubernetes using a Helm Chart in a local Kubernetes cluster, provided as part of Docker Desktop.</p>
<p>In the Helm chart, I have:</p>
<ul>
<li>Requirements.yaml -> PostgreSql (Bitnami Helm Chart)</li>
<li>Deployments-Web.yaml -> Airflow Webserver</li>
<li>Deployments-Scheduler... | born to hula | <p>Well, for those who come by this question - I ended up giving up on my initial approach (Kubernetes Batch Job for initializing Airflow DB and users) and instead I cloned the official <a href="https://github.com/helm/charts/tree/master/stable/airflow" rel="nofollow noreferrer">Airflow Helm chart</a> and made some cha... | born to hula |
<p><strong>ENVIRONMENT:</strong></p>
<pre><code>Kubernetes version: v1.16.3
OS: CentOS 7
Kernel: Linux k8s02-master01 3.10.0-1062.4.3.el7.x86_64 #1 SMP Wed Nov 13 23:58:53 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
</code></pre>
<p><strong>WHAT HAPPENED:</strong></p>
<p>I have a Wordpress Deployment running a conta... | iamcryptoki | <p>Just to give another way - wordpress will try to redirect because you are missing the X-Forwarded http headers that you should have if you are connecting to wordpress via a proxy.</p>
<p>Something like this works without the need for custom php:</p>
<pre><code> livenessProbe:
initialDelaySeconds: 10
h... | Luke |
<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... | user14459580 | <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... | shinkou |
<p>I am wondering if it is possible to store a key-value pair in Secret.yml.
I want to be able to store an encryption key as a value and an id as its key which I can use to retrieve the encryption key stored in Secret.yml. </p>
<p>Is such functionality available with Kubernetes?</p>
<p><strong>EDIT</strong>
I should... | boringDeveloper | <p>Yes, <a href="https://kubernetes.io/docs/concepts/configuration/secret/" rel="nofollow noreferrer">secrets</a> are key value pairs. You can create them using kubectl:</p>
<pre><code>kubectl create secret the-secret-name --from-literal=KEY=VALUE
</code></pre>
<p>Then, you can look at / edit the yaml specification v... | tback |
<p>I'am very new to linkerd in Kubernetes, and I don't feel very comfortable with dtab and routing.</p>
<p>I followed this quite easy "getting started guide" step by step : <a href="https://blog.buoyant.io/2016/10/04/a-service-mesh-for-kubernetes-part-i-top-line-service-metrics/" rel="nofollow noreferrer">https://blog... | Fred Mériot | <p><a href="https://linkerd.io/1/advanced/routing/" rel="nofollow noreferrer">Here</a> you can find documentation about how <code>http://hello</code> becomes <code>/svc/hello</code></p>
<p>Regarding accessing a service in a different namespace you can use something like <code>http://service.namespace</code> then have ... | yeforriak |
<p>I am using the nodejs kubernetes client <a href="https://www.npmjs.com/package/@kubernetes/client-node" rel="nofollow noreferrer">@kubernetes/client-node</a> in a current project and I want to collect metrics (memory, network, cpu) from pods</p>
<p>now with the cli I'd just use</p>
<pre class="lang-sh prettyprint-ov... | relief.melone | <p>The <a href="https://github.com/kubernetes-client/javascript" rel="nofollow noreferrer">GitHub repository</a> contains the following two examples:</p>
<ul>
<li><a href="https://github.com/kubernetes-client/javascript/blob/32c11630a323b8a98bb936af3163fe28818c1e85/examples/top.js" rel="nofollow noreferrer">top.js</a><... | Martti Laine |
<p>I have been running an application stack successfully on a server using the <em>k3s</em> Kubernetes implementation. I am now attempting to deploy it on my Windows PC in Docker Desktop. I get a <strong>404 not found</strong> when accessing the application on the localhost.</p>
<ul>
<li>I tried using 'localhost', '127... | Cornel Masson | <p>I couldn't get this working on Docker Desktop. I switched to <a href="https://rancherdesktop.io/" rel="nofollow noreferrer">Rancher Desktop</a> and it worked.</p>
| Cornel Masson |
<p>Does k3s supports the ServiceTopology feature, and if so, how to enable it?</p>
| Stephane Simard | <p>Yes, but it's a feature-gate:
Using CLI:</p>
<pre><code>--kube-apiserver-arg feature-gates=ServiceTopology=true,...
</code></pre>
<p>I have no firsthand experience with running it on k3s.</p>
| DarthHTTP |
<p>I have a kubernetes deployment which uses secrets for environment variables. So the pod has env variables which are using the secret. </p>
<p>Now I updated my deployment manifest json and the secret json to remove some of the variables, but when I apply these files, I get <strong>CreateContainerConfigError</strong>... | Ufder | <p>I would do a <code>replace</code> on the deployment json. If the original deployment had the usual update settings, a new pod will be created with the new deployment config. If it starts ok, the old one will be deleted.</p>
<p>To be safer, you could create a new secret with some version indicator in the name, refer... | Steve Huston |
<p>I have JupyterHub running on a kubernetes cluster in AWS EKS (managed kubernetes on AWS).</p>
<p>I need to know if there is any way for me to store or configure a sensitive secret that can be accessed during a notebook server instance startup, but only by the server processes. It should never be accessible by any n... | James Wierzba | <p>Kubernetes has the concept of <a href="https://kubernetes.io/docs/concepts/configuration/secret/" rel="nofollow noreferrer"><code>Secrets</code></a> and allows to configure <a href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/" rel="nofollow noreferrer">role-based access control</a> (RBAC) for these... | webwurst |
<p>I have a kubernetes cluster in Azure (AKS) with the log analytics enabled. I can see that a lot of pods are being killed by OOMKilled message but I want to troubleshoot this with the log analytics from Azure. My question is how can I track or query, from the log analytics, all the pods that are killed by the <code>O... | Cesar Flores | <p>The reason is somewhat hidden in the <code>ContainerLastStatus</code> field (JSON) of the <code>KubePodInventory</code> table. A query to get all pods killed with reason <code>OOMKilled</code> could be:</p>
<pre><code>KubePodInventory
| where PodStatus != "running"
| extend ContainerLastStatusJSON = parse... | grindcrank |
<p>I want to have a service account that can create a deployment. So I am creating a service account, then a role and then a rolebinding. The yaml files are below: </p>
<p>ServiceAccount:</p>
<pre><code>apiVersion: v1
kind: ServiceAccount
metadata:
name: testsa
namespace: default
</code></pre>
<p>Role:</p>
<pre... | Satyajit Das | <p>Since you're using a 1.12 cluster, you should include the <code>extensions</code> API group in the <code>Role</code> for the <code>deployments</code> resource.</p>
<p>This was deprecated in Kubernetes 1.16 in favor of the <code>apps</code> group: <a href="https://kubernetes.io/blog/2019/07/18/api-deprecations-in-1-... | snormore |
<p>I am recording and monitoring SLOs (server-side request duration) of Kubernetes Pods via Prometheus using a <a href="https://godoc.org/github.com/prometheus/client_golang/prometheus#HistogramVec" rel="nofollow noreferrer">HistogramVec</a> within a Golang HTTP server. Every request’s duration is timed and persisted a... | heldic | <p>The solution is to use <a href="https://docs.victoriametrics.com/MetricsQL.html#last_over_time" rel="nofollow noreferrer">last_over_time()</a> function. For example, the following query returns the last values seen during the last hour per each histogram bucket:</p>
<pre><code>last_over_time(http_request_duration_mi... | valyala |
<p>I have containerized my ASP.NET Core 2.2 application into Docker image and then deployed it to Google Kubernetes Engine. Application regularly starts, but every now and then it just randomly shuts down. Log gives no special hints on what is going on, all I get is:</p>
<pre><code>I 2019-07-11T19:36:07.692416088Z App... | nikib3ro | <p>The problem was that by default my ASP.NET Core Web Api project did not handle root path. So <code>/</code> was hit by health check and when it didn't get <code>200 OK</code> back GKE would should down Kubernetes pod.</p>
| nikib3ro |
<p>We have a rancher cluster composed by 8 machines : </p>
<ul>
<li>1 rancher server</li>
<li>2 controlplanes</li>
<li>3 etcd</li>
<li>2 workers</li>
</ul>
<p>Recently, we lost our rancher server. In the <code>.kube/config</code> generated by rancher, the server referenced is the rancher server :</p>
<pre><code>apiV... | Nicolas Pepinster | <p>There currently is not a way to do this, but we are working on it and you can track its progress here:
<a href="https://github.com/rancher/rancher/issues/13698" rel="nofollow noreferrer">https://github.com/rancher/rancher/issues/13698</a></p>
<p>If the cluster is provided by GKE, AKS, or EKS, you have the direct ac... | GuerillaNerd |
<p>is there a set of commands to change the docker image name/tag in an existing deployment in a project in an OpenShift cluster?</p>
| DlekaShelHaHaim | <p>You can use the <code>oc set image</code> command to change the image for a container in an existing Deployment / DeploymentConfig:</p>
<pre><code>oc set image dc/myapp mycontainer=nginx:1.9.1
</code></pre>
<p>Try <code>oc set image --help</code> for some examples.</p>
| Simon |
<p>I have been trying to run traefik v2.x in minikube to check it and how it routes request to needed service. I am failing to get access to my services at all. would be good to understand what I am doing wrong.</p>
<ul>
<li>minikube is running in VirtualBox VM</li>
<li>VM box has lab IP address to which I want to sen... | vencrena | <p>Your ClusterRole definition is a bit too thin:</p>
<p><a href="https://github.com/vencrena-LT/traefik/blob/main/2_roles.yml" rel="nofollow noreferrer">https://github.com/vencrena-LT/traefik/blob/main/2_roles.yml</a></p>
<p>You could try to follow the example here:</p>
<p><a href="https://github.com/sleighzy/k3s-trae... | DarthHTTP |
<p>I currently have a GKE Kubernetes 1.15 cluster and I'm planning to upgrade to 1.16. Since 1.16 doesn't support certain APIs I have to change my deployments from extensions/v1beta1 to apps/v1.</p>
<p>Using this simple deployment.yml:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deploy... | codependent | <p>The apiVersion returned from <code>kubectl get</code> won't necessarily match up with the actual apiVersion of your current configuration.</p>
<p>See here: <a href="https://github.com/kubernetes/kubernetes/issues/62283#issuecomment-380968868" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues... | Mikuso |
<p>This is a pretty basic question so I figure I must be missing something obvious, Does openshift service uses round-robin to load balance between pods? Or does it forward requests to the pod with the greatest amount of available resources? Or is it totally random?</p>
<p>My service configuration looks like that:</p>
... | Naama L Ackerman | <p>In Kubernetes (OpenShift is just a Kubernetes distribution), Services result in iptables rules. That means for a Service with more than one Pods, traffic is distributed / redirected via iptables to the different Pods selected by the Service.</p>
<p>So for example if we have three Pods selected by a Service, we can s... | Simon |
<p>I have a working openresty with lua-resty-openidc as ingress controller.
Now, the nginx.conf is hardcoded in my image, with something like this :</p>
<pre><code> server {
server_name _;
listen 80;
location /OAuth2Client {
access_by_lua_block {
local opt... | Aramsham | <p>You would need to render the <code>nginx.conf</code> from a templated version at runtime (as Juliano's comment mentions). To do this, your <code>Dockerfile</code> could look something like this:</p>
<pre><code>FROM nginx
COPY nginx.conf.template /etc/nginx/
CMD ["/bin/bash", "-c", "envsubst < /etc/nginx/nginx.co... | snormore |
<p>I have an aws s3 bucket at <code>bucket.com.s3-website.us-east-2.amazonaws.com/subfolder/static-site-folder/</code></p>
<p>I want to route a domain directly to the sub-folder /subfolder/static-site-folder/</p>
<p>This is because I want to have multiple static sites on a single bucket.</p>
<p>So I want something like... | Keith Becker | <p>Domain Name System (DNS) web service providers, such as Route53, do not "see" your folders. They only operate at the domain level, but url paths.</p>
<p>Probably the easiest way to achieve what you want would be by setting up <a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Downl... | Marcin |
<p>We have requirement to setup on prem kubernetes that can continue to serve applications even when there is disconnection from internet.</p>
<p>We are considering Redhat openshift. My question is does redhat openshift continue to service existing workloads during network outage?</p>
<p>I understand that during outage... | Imran Arshad | <p>As with all Kubernetes distributions, applications running on the cluster will continue to run even without an internet connection (obviously as long as the application itself does not rely on internet access).</p>
<p>As you correctly note, new applications can typically not be started without access to the registry... | Simon |
<p>I'm trying to create a k3s cluster at home using 3 raspberry pi 4.
I've sweat a lot setting up the nginx-ingress + letsencrypt pods.
Actually, it seems to work but I can't check it now.</p>
<p>Now my problem is the following:</p>
<p>I'm connected to internet using an ISP router (Livebox Orange).</p>
<p>My 3 RPI are ... | T00rk | <h2>For your current case:</h2>
<p>You need to introduce a new k3s independent component in your network and that can be a reverse proxy like HAProxy, which can be set up to balance requests between 3 IPs.</p>
<h2>Or:</h2>
<p>#1 Rebuild your k3s cluster without Traefik and Service LoadBalancer:</p>
<pre><code>curl -sfL... | DarthHTTP |
<p>I am new to Terraform and learning.
I have to provide two roles in a resource block(builtin and custom), is this supported in terraform?</p>
<pre><code>variable "role_definition_id" {
type = list(string)
description = "Role definition id"
default = ["READER", "Custom_role&quo... | pk_dhruv | <p><code>role_definition_name</code> should be <strong>string</strong>,not a list. You can try the following:</p>
<pre><code>resource "azurerm_role_assignment" "example" {
for_each = {for idx, value in toset(local.principal_ids): idx=>value}
scope = data.azurerm_subscription.primary.id
role... | Marcin |
<p><strong>How to bind multiple ports of a pod to make them visible on the pod IP?</strong></p>
<p>Something analogous to Docker's <code>docker run -p 1234:5555 -p 6789:9999 my_image</code></p>
<p>The only example of YAML definition I've found in documentation and tutorials uses single port without binding:</p>
<pre... | diziaq | <p><code>spec.containers.ports</code> is an array, which means you can specify multiple ports like so in your Pod definition:</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
name: pod-multiple-ports
labels:
app: pod-multiple-ports
spec:
containers:
- name: my-container
image: myexample:latest
port... | Simon |
<h2>Context</h2>
<p>I have a <strong>k3s</strong> (v1.19.3+k3s3) cluster and I am using the '<em>out of the box</em>' <a href="https://rancher.com/docs/k3s/latest/en/networking/" rel="nofollow noreferrer">traefik ingress controler</a></p>
<pre class="lang-sh prettyprint-override"><code>kubectl get svc -n kube-system
... | zar3bski | <p>You were correct in your thinking, e.g. in a Helm chart you should be able to define by annotations the ingress correctly.</p>
<p>For example <a href="https://github.com/stefanprodan/podinfo/blob/master/charts/podinfo/templates/ingress.yaml" rel="nofollow noreferrer">https://github.com/stefanprodan/podinfo/blob/mast... | DarthHTTP |
<p>I have a resource task to create nodes in EKS. My problem begin when I'm trying to define some tags according to the value of a specific variable and if not, don't declare the tag. Something like that:</p>
<pre><code>resource "aws_eks_node_group" "managed_workers" {
for_each = var.nodegroups[te... | hache cheche | <p>Yes, you can do this. For example:</p>
<pre><code>resource "aws_eks_node_group" "managed_workers" {
for_each = var.nodegroups[terraform.workspace]
cluster_name = aws_eks_cluster.cluster.name
node_group_name = each.value.Name
node_role_arn = aws_iam_role.managed_workers.arn
subnet_... | Marcin |
<p>In our company's internal network we have self-signed certificates used for applications that runs on DEV or staging environments. For our local machines it's already trusted because Active Directory provides that using Group Policy Objects. But in the Kubernetes(Openshift) world, we have to do some additional opera... | happy-integer | <p>Typically that should be configured cluster-wide by your OpenShift administrators using the following documentation so that your containers trust your internal root CA by default (<code>additionalTrustBundle</code>):</p>
<p><a href="https://docs.openshift.com/container-platform/4.6/networking/configuring-a-custom-pk... | Simon |
<p>I want to override the value of root_volume_type to gp2 in <a href="https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/local.tf" rel="nofollow noreferrer">https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/local.tf</a></p>
<p>This is the only file I created called main.tf in m... | Sharjeel | <p>The error is correct because you are <strong>sourcing an example</strong>, which does not support such variables as <code> workers_group_defaults</code>. You can't overwrite it, unless you fork the example and modify it yourself.</p>
<p><code>workers_group_defaults</code> is supported in the <strong>core module</str... | Marcin |
<p>I created an <code>CRD</code> like this:</p>
<pre><code>import v1 "k8s.io/api/core/v1"
type ApplicationSpec struct {
Name string `json:"name"`
PodSpec v1.PodSpec `json:"podSpec"`
...
}
</code></pre>
<p>notice that I reused <code>PodSpec</code> from core apigroup in my CRD </p>
<p>To avoid user appl... | DiveInto | <p>You can reuse the <a href="https://github.com/kubernetes/kubernetes/blob/master/pkg/apis/core/validation/validation.go#L3189-L3264" rel="nofollow noreferrer">upstream <code>ValidatePodSpec</code> directly</a>.</p>
<p>You would need to import a couple packages first:</p>
<pre class="lang-golang prettyprint-override... | snormore |
<p>I'm new to kubernetes and openshift (came from docker swarm world) and I'm having trouble with some of kubernetes and openshift documentation especially related to <strong>route</strong> and <strong>services</strong>. I was looking for how to expose a replica set of containers externally and I've found <a href="http... | tkyass | <p>There are only minor differences in tools being used. OpenShift is a Kubernetes distribution, this means it is a collection of opinionated pre-selected components. So for Ingress, OpenShift uses HAProxy to get (HTTP) traffic into the cluster. Other Kubernetes distributions maybe use the NGINX Ingress Controller or s... | Simon |
<p>I have successfully deployed AKS Using Terragrunt through Atlantis, Now I want to set credentials to communicate with the Kubernetes API Server.</p>
<p>For that, I am setting up the <strong>KUBECONFIG</strong> Environment variable to authenticate with Kubernetes.</p>
<p>Below is the code that will run in Atlantis Co... | Ajinkya Bhabal | <p>Each <code>local-exec</code> will execute in its own shell environment, so there is no persistence between the second and third executions of your <code>local-exec</code>.</p>
<p>To set environment variables for your <code>local-exec</code>, you should use <a href="https://www.terraform.io/docs/provisioners/local-ex... | Marcin |
<p>I am trying to configure Kubernetes with webhook, I created file, and put it at <code>/etc/kubernetes/webhook.yaml</code>.</p>
<p>I modify <code>/etc/kubernetes/manifests/kube-apiserver.yaml</code> and add the flag <code>- --authentication-token-webhook-config-file=/etc/kubernetes/webhook.yaml</code>.</p>
<p>When ku... | Nilesh | <p>I forget to mount the host directory to the Kube-api server.</p>
<p>If we add section for mount, it will work.</p>
<p><strong>/etc/kubernetes/manifests/kube-apiserver.yaml</strong></p>
<pre><code>spec:
containers:
...
...
volumeMounts:
...
...
- mountPath: /etc/kubernetes
name: ... | Nilesh |
<p>I have a server I wrote that allows us to "Kick off" processing and or manage CRON jobs to do the processing on different schedules.</p>
<p>If I'm running my container in a horizontally scalable way how to I recover from crashed containers or inform new containers that a CRON job is being handled by another contain... | Jon Vogel | <p>If you want your application code to be stateless, then yes, you will need to store it in a database to be resilient to containers crashing.</p>
<p>However, I think you're asking how other containers will pick up and retry the failed cron jobs if a container crashes. You're now looking at designing a distributed jo... | bcoughlan |
<p>I'm trying to create a EKS cluster in a private subnet. I'm having issues getting it working. I get the error <code>unhealthy nodes in the kubernetes cluster</code>. Wonder if its due to security group or some other issues like VPC endpoints?</p>
<p>When I use NAT gateway setup then it works fine. But I don't want t... | user630702 | <p>Since you don't have NAT gateway/instance, your nodes <strong>can't connect to the internet</strong> and fail as they can't "communicate with the control plane and other AWS services" (from <a href="https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html#vpc-cidr" rel="nofollow noreferrer">here... | Marcin |
<p>I have a terraform code as given below</p>
<pre><code> locals {
file_path = format("%s-%s", var.test1, var.test2)
test_decode = yamldecode((data.github_repository_file.test.content))
}
data "github_repository_file" "test" {
repository = "test-repo"
... | mystack | <p>You can use <a href="https://developer.hashicorp.com/terraform/language/functions/try" rel="nofollow noreferrer">try</a>:</p>
<pre><code> test_encode = yamlencode(try(local.test_decode.spec.names, "some_default_value"))
</code></pre>
| Marcin |
<p>My module <code>abc</code> contains an instance of <code>redis-ha</code> deployed to Kubernetes via helm compliments of <a href="https://github.com/helm/charts/tree/master/stable/redis-ha" rel="nofollow noreferrer">https://github.com/helm/charts/tree/master/stable/redis-ha</a>. I want to <code>taint</code> this reso... | Frank | <p>In Terraform v0.11 and earlier, the <code>taint</code> command can work with that resource instance like this:</p>
<pre><code>terraform taint -module=abc.redis helm_release.redis-ha.3
</code></pre>
<p>From Terraform v0.12.0 onwards, that uses the standard resource address syntax:</p>
<pre><code>terraform taint mo... | Martin Atkins |
<p>I'm trying to create a tpl file. So i can give my role, access to multiple k8s cluster. But i'm getting a tuple error.</p>
<p>How should we pass vars to tpl file when it has some interpolation?
Please also let me know what does this error mean and where i'm wrong.</p>
<p>Terraform version: 0.12.28</p>
<p>locals.tf<... | user6826691 | <p>Often, a pattern used to overcome this issue is through <a href="https://www.terraform.io/docs/configuration/functions/jsonencode.html" rel="nofollow noreferrer">jsonencode</a>. In this case the template file would be:</p>
<pre><code>{
"Version": "2012-10-17",
"Statement": [
{
... | Marcin |
<p>I need to create a RabbitMQ queue from command line.</p>
<ol>
<li>I have a RabbitMQ setup in kubernetes.</li>
<li>I login into a RabbitMQ pod and fetch the rabbitmqadmin for my version 3.8.14</li>
<li>I run this:</li>
</ol>
<p><code>./rabbitmqadmin -u user1 -p password1 -N rabbit@rabbitmq-0.rabbitmq.default.svc.clus... | Vladimir | <p>I got it. I think at some point the API endpoint got updated so all calls must go to http://localhost:15672/rabbitmq/api. Here's the configuration line that was added that caused the issues:</p>
<pre><code>management.path_prefix = /rabbitmq
</code></pre>
<p>Here are the working examples:</p>
<p><code>./rabbitmqadmin... | Vladimir |
<p>I have created a microservice based architecture using Spring Boot and deployed the application on Kubernetes/Istio platform.</p>
<p>The different microservices communicate with each other using either JMS (ActiveMQ) or REST API.</p>
<p><strong>I am getting the tracing of REST communication on Istio's Jaeger but t... | Safvan Kothawala | <p>While this isn't exactly what you asked, it sounds like what you're trying to achieve is seeing tracing for your JMS calls in Jaegar. If that is the case, you could use an OpenTracing tracing solution for JMS or ActiveMQ to report tracing data directly to Jaegar. Here's one potential solution I found with a quick go... | Graham Lea |
<p>I am using EKS and I want to enhance the security by keeping one out of the total two nodegroups into a private subnet. However, I have read few documents from AWS where it is a need that if a nodegroup has to be launched in private subnet then there has to be a NAT gateway connection so that the nodegroup can conne... | Kaustubh | <p>AWS provides an explanation and an <strong>VPC template</strong> (<code>amazon-eks-fully-private-vpc.yaml</code>) for EKS without NAT in a post titled:</p>
<ul>
<li><a href="https://aws.amazon.com/premiumsupport/knowledge-center/eks-cluster-node-group-private-network/" rel="nofollow noreferrer">How do I create an Am... | Marcin |
<p>I have a lightweight Kubernetes cluster deployed with Rancher's K3s.</p>
<p>Most of the time pods runs fine in it, however I noticed that from time to time it runs into <strong>NodeDiskPressure</strong>, which causes existing Pods to be evicted.</p>
<p>Looking into the available disk in the host, I found out that hi... | born to hula | <p>After some research, found couple of things that helped me solve this issue:</p>
<ul>
<li><p><strong>K3s</strong> uses <strong>containerd</strong> for container runtime. It comes with crictl - which provides some containerd functionality. Following command cleans unused images that are stored in the cache (inside /v... | born to hula |
<p>Does pod running on a Kubernetes node gets rescheduled if the Kubernetes nodes gets killed due to power failure. And if gets rescheduled and if that nodes comes up what happens to the pod running on that node?</p>
| Manish Khandelwal | <p>Warning: this answer is based on the assumption you don't create an ad-hoc Pod, but instead manage your pods via a Deployment, StatefulSet, DaemonSet or any other controller. If it's an ad-hoc pod you created manually - it won't be rescheduled.</p>
<blockquote>
<p>Does pod running on a Kubernetes node gets reschedul... | zerkms |
<p>I have a k3s cluster and I'm trying to configure it to get a SSL certificate from let's encrypt. I have followed many guides, and I think I'm really near to manage it, but the problem is that the Challenge object in Kubernetes reports this error:</p>
<pre><code>Waiting for HTTP-01 challenge propagation: failed to pe... | Sebastiano Gazzola | <p>It is probable that the DNS record for the domain you want the certificate does not exist.
If if does, and you are using a split horizon DNS config (hijacking the .com domain in your local network) make sure it points out to your public ip (e.g. your home gateway)</p>
<p>[Edit]</p>
<p>Also, you have to figure out LE... | DarthHTTP |
<p>How do you trigger rerunning a job once one of its dependent secrets get updated?</p>
<p>For example, say I have this simple job:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: batch/v1
kind: Job
metadata:
name: job-test
spec:
template:
metadata:
labels:
app: databricks
s... | Daniel | <p>I think it's maybe better to use a <code>ConfigMap</code> instead of a <code>Secret</code>, because <code>ConfigMaps</code> are designed to be more easily updated and can be monitored for changes using Kubernetes' built-in watch functionality!</p>
<p>let me update your code again :</p>
<pre><code>apiVersion: batch/v... | Freeman |
<p>I cannot access a secret I created. I inserted a secret in K8s secret store and am simply trying to test access to it with this yaml...</p>
<pre><code>apiVersion: v1
kind: Namespace
metadata:
name: space1
---
apiVersion: v1
kind: Pod
metadata:
name: space1
namespace: space1
spec:
containers:
- name: space1... | HC LW | <p><code>kubectl get secrets</code> shows secrets from a default namespace, add <code>-n space1</code> to see secrets from the namespace your pod runs in.</p>
| zerkms |
<p>I have set up a simple two-node Kubernetes cluster using K3S. I have deployed a very simple web app, but when I try to access the web app, I just get a "Gateway Timeout". I've tried to keep the set up as simple as possible, but I can't see where I'm going wrong. I've outlined my entire setup below, from st... | simbro | <p>The annotation on the Ingress is missing description of the entrypoint and the host:</p>
<pre><code>apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: web-test
annotations:
kubernetes.io/ingress.class: "traefik"
traefik.ingress.kubernetes.io/router.entrypoints: http... | DarthHTTP |
<p>New guy here. I was wondering if anyone could help me with the differentiating characteristics that I could use to identify ingress controllers vs ingresses via yamls and services. I have a preexisting cluster and I think the Ingress controller may have been installed via helm but I am not sure. Is there a way to ge... | GYama | <p><strong>Answer1</strong></p>
<p>If you want to see the YAML a chart might generate you can use the template command</p>
<pre><code>helm template rel1 repo1/chart1 -f values.yaml
</code></pre>
<p><strong>Answer2</strong></p>
<p>If you want to see the manifest that helm used in the past?</p>
<pre><code>helm history my... | Mark O'Connor |
<p>I am testing an kubernetes minikube/influxdb/grafana stack under macos 10.15.3. I am working on the command line.</p>
<p>System environment:</p>
<ul>
<li>MacOS 10.15.3 /bin/bash (darwin19)</li>
<li><p>Minikube 1.7.2, downloaded via</p>
<p><code>curl -Lo minikube https://storage.googleapis.com/minikube/releases/la... | WolfiG | <p>I was hitting this as well on mac. The key was running <code>minikube delete</code> and then running <code>minikube start --extra-config=apiserver.service-node-port-range=3000-61616</code> again.</p>
<p>This was with the Docker driver, not hyperkit FWIW.</p>
| Nick Aberle |
<p>I am having issues with request to my NodeJS app running in my kubernetes cluster in digital ocean. Every request returns a <code>502 Bad Gateway Error</code>. I am not sure what I am missing.</p>
<p>This is what the service config looks like</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind:... | Emmanuel Amodu | <p>Could it be the annotation that configures SSL passthru?</p>
<p>If SSL passthru has been configured on your ingress controller then your service needs to expose port 443 in addition to port 80. You're basically saying the pod is terminating the secure connection not nginx.</p>
<p>If this is the issue would explain 5... | Mark O'Connor |
<p>I'm using an AWS NLB to expose my Kubernetes pods to the internet. The NLB is currently using <code>instance</code> target types but I noticed there are also <code>IP</code> target types. What are the differences between an <code>instance</code> target type vs an <code>IP</code> target type from a practical point of... | n00b | <p>The three key use-cases for using <strong>IP target type</strong>:</p>
<ul>
<li>your target does not have to be an instance - anything with private IP address will work, including internal load balance, VPC private service, Fargate containers, databases, on-premise servers through VPN.</li>
<li>your target can be in... | Marcin |
<p>I've started an instance of a Jenkins Master using the official <a href="https://github.com/helm/charts/tree/master/stable/jenkins" rel="nofollow noreferrer">Helm chart</a>. The document does provide values to be set for an agent. But how can I add agents manually through this chart?</p>
<p>The documentation within... | user6123723 | <p>Took me a bit to figure this out. </p>
<p>It appears that when you specify an agent configuration, in the helm chart, then <a href="https://github.com/helm/charts/blob/master/stable/jenkins/templates/config.yaml#L44-L152" rel="nofollow noreferrer">a "cloud" configuration is enabled</a> which uses the Kubernetes plu... | Mark O'Connor |
<p>I'm trying to deploy a grafana instance inside Kubernetes (server 1.6.4) in GCE. I'm using the following manifests:</p>
<p><strong>Deployment</strong> (<a href="https://pastebin.com/HL5KqXtT" rel="nofollow noreferrer">full version</a>):</p>
<pre><code>apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: gra... | mmoya | <p>Quoting from <a href="https://groups.google.com/g/kubernetes-users/c/lhVfyfCwEyo/m/b187gC84CwAJ" rel="nofollow noreferrer">here</a>:</p>
<blockquote>
<p>The GLBC requires that you define the port (in your case 3000) within the Pod specification.</p>
</blockquote>
<p>The solution is to declare the port used for t... | mmoya |
<p>I have the following variable that I try to parse :</p>
<p><strong>variable.tf</strong></p>
<pre class="lang-hcl prettyprint-override"><code>variable "rbac_roles" {
type = object(
{
view = list(object({
group_name = string,
group_id = string,
namespaces = list(string)
... | Will | <p>First this is wrong <code>["default, namespace1, namespace2"]</code>. It should be <code>["default", "namespace1", "namespace2"]</code>. Once you fix that, you can flatten your data structure as follows:</p>
<pre><code>locals {
flat_rbac_roles = merge([
for role, g... | Marcin |
<p>I am using Terraform with Kubernetes Provider.
Now when creating <em>ConfigMap</em>s, I want their names to have a content suffix.
Usually it is a hash of the content.</p>
<p>This way, it should enforce a Deployment, where used.</p>
<p>So I would like it to work similar to:</p>
<pre><code>resource "kubernetes_co... | abergmeier | <p>There is no way to implement a <em>custom</em> hash function in Terraform, but Terraform has a number of built-in functions that implement different standard hash functions.</p>
<p>For example, to use a base64-encoded SHA256 hash you could write something like the following using the function <a href="https://www.t... | Martin Atkins |
<p>I think my focus is on how to use this configuration parameter- "controlPlaneEndpoint".
It is currently buggy to use "controlPlaneEndpoint".
<a href="https://kubernetes.io/docs/setup/independent/high-availability/" rel="nofollow noreferrer">https://kubernetes.io/docs/setup/independent/high-availability/</a></p>
<p>... | fu rocky | <p>We are suffering the exact same problem, but with the Azure Load Balancer (Level 4).</p>
<p>1) It fails on the first master node where "kubeadm init" is executed because it tries to communicate with itself through the load balancer.</p>
<p>2) On all the other master nodes where "kubeadm join" is executed, there's ... | Victor M. |
<p>Reading the <a href="http://kubernetes.io/docs/user-guide/labels/#selecting-sets-of-nodes" rel="noreferrer">Kubernets documentation</a> it looks to be possible to select a certain range of pods based on labels. I want to select all the pods on one node but I don't want to label each pod on their corresponding node.<... | Fran | <p>As mentioned in the accepted answer the PR is now merged and you can get pods by node as follows:</p>
<pre><code>kubectl get pods --all-namespaces -o wide --field-selector spec.nodeName=<node>
</code></pre>
| Kristofer |
<p>I made some experiments with <code>terraform</code>, <code>kubernetes</code>, <code>cassandra</code> and <code>elassandra</code>, I separated all by modules, but now I can't delete a specific module.</p>
<p>I'm using <code>gitlab-ci</code>, and I store the terraform states on a AWS backend.
This mean that, every ti... | Rui Martins | <p>The meaning of this error message is that Terraform was relying on a <code>provider "kubernetes"</code> block inside the <code>k8s-cassandra</code> module in order to configure the AWS provider. By removing the module from source code, you've implicitly removed that configuration and so the existing objects already ... | Martin Atkins |
<p>We are in the process of migrating our Service Fabric services to Kubernetes. Most of them were "stateless" services and were easy to migrate. However, we have one "stateful" service that uses SF's Reliable Collections pretty heavily.</p>
<p>K8s has Statefulsets, but that's not really comparable ... | Nathan A | <p>AFAIK this cannot be done by using a .Net library.
K8 is all about orchestration. SF on the other hand is both an orchestrator + rich programming /application model + state management.
If you want to do something like reliable collection in K8 then you have to either</p>
<p>A) built your own replication solution wit... | Frank Q. |
<p>I am planning to install Istion on my AKS Cluster using the following configuration, what are all the components this would install? would it install both the Ingress & Egress Gateways?</p>
<pre><code>istioctl operator init
kubectl create ns istio-system
cat << EOF | kubectl apply -f -
apiVersion: instal... | One Developer | <p>I have used the following configuration to setup both the Ingress & Egress Gateways.</p>
<pre><code>cat << EOF | kubectl apply -f -
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
namespace: istio-system
name: istio-control-plane
spec:
# Use the default profile as the base
# Mor... | One Developer |
<p>We have configured two Kubernetes clouds in our jenkins</p>
<ul>
<li>kubernetes: this one runs all the build jobs related to setting up infra, building spring boot apps and their docker images etc; it's our devops automation apps cluster</li>
<li>apps-dev: this is where all our apps are deployed so it's our runtime ... | Anadi Misra | <p>There's an error in my yaml, it should have been</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
labels:
jenkins/label: jenkins-apps-dev-agent
namespace: jenkins-jobs
spec:
containers:
- name: mavenjdk11
image: maven:3.8.2-adoptopenjdk-11
resources:
limits:
memory... | Anadi Misra |
<p>Let's say I and the partner company I'm dealing with live in a country that employs <a href="https://en.wikipedia.org/wiki/Daylight_saving_time" rel="noreferrer">Daylight Saving Time</a>.</p>
<p>I have a CronJob in a kubernetes cluster that uploads files to the partner company daily at, say, 4:00, 10:00, 16:00, and ... | Andrew Savinykh | <p>Time Zones was added to CronJob in Kubernetes 1.22. To cite <a href="https://github.com/kubernetes/kubernetes/issues/47202#issuecomment-950887675" rel="nofollow noreferrer">github thread</a></p>
<blockquote>
<p>Just to clarify, it's available in 1.22.</p>
</blockquote>
<blockquote>
<p>It was implemented in a very st... | Andrew Savinykh |
<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... | Nish | <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 ... | Marcin |
<p>I would like to install Kubernetes on my debian machine:</p>
<pre><code>Distributor ID: Debian
Description: Debian GNU/Linux 9.5 (stretch)
Release: 9.5
Codename: stretch
</code></pre>
<p>Looking into google deb package archive I only find the package for "kubectl", nothing else:</p>
<p><a href="ht... | Literadix | <blockquote>
<p>Is it possible to install kubeadm and kubelet on debian stretch too ?</p>
</blockquote>
<p>Yes it is! Please refer to the helpful guide that you linked at the end of your question: <a href="https://kubernetes.io/docs/setup/independent/install-kubeadm/#installing-kubeadm-kubelet-and-kubectl" rel="nofo... | Andrew Savinykh |
<p>My AWS lambda functions have input from AWS SNS (Topic subscription) and output will go to CRUD in NoSQL Database (likewise MongoDB).</p>
<p>So currently I have the SNS & Lambda function setup in AWS Cloud and they are working fine. However, I would like to containerize the lambda function as well as the MongoDB... | Sivvie Lim | <p>The docker environment for AWS lambda function already exist and it is <a href="https://hub.docker.com/r/lambci/lambda/" rel="nofollow noreferrer">lambci/lambda</a>. So if you want to run/test your functions locally, this is the tool normally used for that:</p>
<blockquote>
<p>A sandboxed local environment that <str... | Marcin |
<p>We are using Docker 18.9.8-dind. <a href="https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#use-docker-in-docker" rel="nofollow noreferrer">DinD — Docker-in-Docker — is running Docker in a separate container</a>. This way, we send requests to this container to build our images, instead of executing Docker... | brandizzi | <p>We checked the logs in the Docker pod, and found this message at the end:</p>
<pre><code>API listen on [::]:2376
</code></pre>
<p>Well, our message in the question states we tried to connect to port 2375, which used to work. Why has the port changed?</p>
<p><a href="https://hub.docker.com/_/docker/#TLS" rel="nofollo... | brandizzi |
<p>Im trying to configure api-gateway for my micro service study.
I created a pod as a auth-depl and auth-src service for this pod.
Also I have another pod&service as links-depl and links-serv.
And I want to make a api-gateway for. these services.</p>
<p>The output for "<strong>kubeectl get pods"</strong>... | akasaa | <p>In Express Gateway, you need to have a pipeline defined for each of your ApiEndpoints. You have a pipeline which maps the (outside-facing) "api" endpoint to the service endpoint "httpbin", but you are missing one to map the "user" endpoint to your signup endpoint.</p>
<p>You need to add... | James McLeod |
<p>In my current job we are running multiple k8s cluster and allowing multiple teams to run services in the cluster.</p>
<p>Each service/git repo will have kustomize file, which has list of all patches. During the CD phase, we are converting this kustomize to a k8s manifests (service,configmap,deployment) for a given e... | cloudbud | <p>Helm can do multiple things for you:</p>
<ul>
<li>template k8s manifests - similar to what Kustomize is currently doing in your setup</li>
<li>take care about upgrading installations - that includes removing deletes resources</li>
<li>keep track of revisions of your installations - so you can rollback easily</li>
<l... | Ilia Kondrashov |
<p>In my k8s cluster I have two deployments: one for generating JWTs using a given key-pair and another one for validating JWTs using the same key-pair.<br>
Both deployments using the same k8s secret which contains the key/pair.<br>
When I want to revoke/update that key pair, how do I create consistency between the dep... | yoka791 | <p>It is impossible to have a generic solution for this problem: you must coordinate all the parties yourself.</p>
<p>The common solution is to issue a new secret and let all the participants to accept both.</p>
<p>Then after some time to stop issuing the old version and remove it from everywhere.</p>
| zerkms |
<p>I want to change (edit/add) labels on pods with specific labels. I have the following code:</p>
<pre><code>public void changeLabelsForPodFilterByLabels(String namespace, Map<String, String> filterByLabels, Map<String, String> newLabels) {
try {
V1PodList podList = coreV1Api.listNamespacedPod... | florin | <p>You could use <strong>JsonObject</strong> instead of String for <em>body</em> argument.<br />
For example:</p>
<pre><code>JsonObject item = new JsonObject();
item.add("op", new JsonPrimitive("add"));
item.add("path", new JsonPrimitive("/metadata/labels"));
JsonObject label = ... | 卢声远 Shengyuan Lu |
<p>We've deployed a service to Kubernetes (EKS) with an NLB service and 2 pods running behind it. When I run a load test (simple GET request) from my local machine all requests go to the one pod while the other one sits idle.</p>
<p>When I test this out manually using 3 different clients (Safari, FF and curl), the requ... | n00b | <p>This seemed to have been an issue with the load testing tool I was using and somewhat related to this issue - <a href="https://github.com/loadimpact/k6/issues/1752" rel="nofollow noreferrer">https://github.com/loadimpact/k6/issues/1752</a>.</p>
<p>I bumped up the version of the k6 Docker image I was using and it cor... | n00b |
<p>Trying to use the python kubernetes API to stream the output of kubernetes pod logs. (eventual goal is to stream the logs out via websocket)</p>
<p>Based off this <a href="https://github.com/kubernetes-client/python-base/pull/93" rel="noreferrer">PR</a> that was merged into python kubernetes module, i thought watch... | BLang | <p>You should just do:</p>
<pre><code>v1 = client.CoreV1Api()
w = Watch()
for e in w.stream(v1.read_namespaced_pod_log, name=pod, namespace=namespace):
print(e)
</code></pre>
| Mitar |
<p>I wonder if there is a way to have a deployment stop recreating new pods, when those failed multiple times. In other, given that we can't for instance have a restartPolicy never in a pod template of a Deployment, i am wondering, how can i consider a service failed and have in a stopped state. </p>
<p>We have a use ... | MaatDeamon | <p>In my case I had a deployment that was in a fail and restart loop where the pod and its logs didn't stay around long enough for me to work out what had gone wrong.</p>
<p>As a workaround I temporarily changed the start up command so that even if the intended start up command failed the pod would be kept alive. This... | Mark McLaren |
<p>We have recently set up a AKS cluster with a NGINX controller.</p>
<p>Access <em>seemed</em> ok, but then we found that occasional requests are unable to connect.</p>
<p>To demonstrate the problem we use a short powershell script which makes repeated requests to the URL, writes out the response's status code, waits ... | awj | <p>I can't explain <em>why</em> but we found out that if we changed the VMs in our node pool from burstable VMs to non-burstable (from 'B' class to 'D' class) then the problem went away.</p>
| awj |
<p>I'm following the tutorial in <a href="https://github.com/kubernetes/kops/blob/master/docs/aws.md" rel="nofollow noreferrer">https://github.com/kubernetes/kops/blob/master/docs/aws.md</a>
with a bootstrap EC2 instance with Amazon Linux installed.</p>
<p>And everything seems to be working fine until I need to start ... | Thadeu Melo | <p>The error is stating you haven't specified an instance type for the EC2 nodes that will act as master and worker nodes.</p>
<p>The following is an example command: </p>
<pre><code> kops create cluster --name=my-cluster.k8s.local \
--state=s3://kops-state-1234 --zones=eu-west-1a \
--node-count=2 --node-size=t2... | Mark O'Connor |
<p>I have used the following configuration to setup the Istio</p>
<pre><code>cat << EOF | kubectl apply -f -
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
namespace: istio-system
name: istio-control-plane
spec:
# Use the default profile as the base
# More details at: https://istio.io... | One Developer | <p>I got it working as mentioned below</p>
<pre><code>kubectl expose service prometheus --type=LoadBalancer --name=prometheus --namespace istio-system
export PROMETHEUS_URL=$(kubectl get svc prometheus-svc -n istio-system -o jsonpath="{.status.loadBalancer.ingress[0]['hostname','ip']}"):$(kubectl get sv... | One Developer |
<p>Hi I have question about golang micro service via kubernetes container. Example I have 2 deploy of code name A and B.</p>
<ol>
<li>A have 1 pod do a sent request to create document in B service.</li>
<li>B have autoscaling config between 1 - 5 pod waiting for request from A and process to create a document in many c... | Rawit_S | <p>Make sure your service B can do a graceful shutdown.</p>
<p>On scale down, or delete, the pod will first receive a TERM signal. Then, after a grace period, it will send a KILL if needed.</p>
<p>Your service should respect TERM and stop all internal processes (goroutines in your case) and then terminate. If you manag... | Andreas Wederbrand |
<p>I have about 10 ConfigMap and few secrets which stores my configuration in key and value. I am looking for any kubectl command which i can use to find my key in any available configMap or secrets ?
I know I can open each file and find my key but is there any <code>kubectl</code> command which lookup all configMap or... | user1591156 | <p>Create the following kubectl plugin</p>
<pre><code>#!/bin/bash
kubectl get secrets -o go-template='{{range $s:=.items}}{{range $k,$v:=$s.data}}{{printf "Secret %s: %s\n" $s.metadata.name $k}}{{end}}{{end}}' | grep -i $1
kubectl get configmap -o go-template='{{range $s:=.items}}{{range $k,$v:=$s.data}}{{pr... | Mark O'Connor |
<p>These are the best practises for a helm deployment which I figured out so far:</p>
<ol>
<li>Use versioned images, because deploying via latest tag is not sufficient, as this may not trigger a pod recreate (see <a href="https://stackoverflow.com/questions/64290972/when-does-kubernetes-helm-trigger-a-pod-recreate/6429... | Matthias M | <p>Indeed, using <code>:latest</code> will mean that your deployments will be mutable.</p>
<p>AWS ECR allows you to keep limited number of latest images according to certain regex. So you can use <code>dev-</code> prefix for your non-production deployments (for example triggered outside of <code>master</code> branch) a... | Ilia Kondrashov |
<p>I want to start a minikube cluster with a data base and a java backend. </p>
<p>I have a persistent volume and the service for the mariadb database with the following persistent, claim and delpoyment </p>
<ul>
<li><a href="https://ptpb.pw/9iY3" rel="nofollow noreferrer">MariaDBpasteBin</a></li>
</ul>
<p>and the j... | A.Dumas | <p>From your yaml it seems you have named the mariaDB service "maria" so the dns name for it should be just <code>maria</code> (if you are in the same namespace) or <code>maria.<namespace></code> (from all other namespaces) or <code>maria.<namespace>.svc.cluster.local</code> as a FQDN.</p>
| Andreas Wederbrand |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.