Hot answers tagged

3

YAML anchors are supported, but only for the same YAML file. You can't create the anchor (&) on a deployment file and reference (*) the value on another one. If you want to share ENVs values across multiple Deployments, you can create a ConfigMap with the ENVs and use the envFrom spec. Example: apiVersion: v1 kind: ConfigMap metadata: name: my-...


2

You can use kubectl get -o json and parse the output using jq to iterate over the deployments, matching any desired configMapKeyRef.name and returning a uniq list of deployments. This should work: kubectl get deployments --all-namespaces -o json | jq -r '.items | map(select(.spec.template.spec.containers[]?.env[]?.valueFrom.configMapKeyRef.name == "...


1

I figured it out, and SELinux is the difference. That is, SELinux on the HAProxy host (not a cluster node): "SELinux only allows the web server to make outbound connections to a limited set of ports" That is, you can't make an outbound http request to any port in the NodePort range (30000-32768) without opening that port on the "client",...


1

LimitRange for the rescue: by setting both Max limits and LimitRequestRatio for pods users must set limits that are lower than Max or request*ratio or apiserver would return 403 Forbidden.


1

So the answer was so simple I just have to add -o jsonpath='{.data}' at the end of the command kubectl get secrets/<secrets-name> -n <namespace> -o jsonpath='{.data}'


1

I have come to the (preliminary) conclusion that this cannot be done. First, I had set the wrong idp-issuer-url. I had selected the IDP that normally serves during OIDC authentication to the Kubernetes cluster. But $token (or $CI_JOB_JWT in GitLab CI/CD parlance) was not generated there but by GitLab instead. Inspection e.g. at jwt.io indicates "iss&...


1

According the documentation you're giving, you need to remove run-build from the command : $ oc run NAME --image=<image> \ [--generator=<resource>] \ [--port=<port>] \ [--replicas=<replicas>] \ [--dry-run=<bool>] \ [--overrides=<inline_json>] \ [options]


1

I solved this temporarily with not the safest solution, but is working When creating secret with kops named admin, can use that to generate user field in exported kops config by adding also --admin in the export command


1

When I navigate to the URL, there do not appear to be any packages in the repo. Consider trying a mirror like: mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64


1

Do your instance groups have labels identifying the groups they belong to? If so, you can filter to them using the -l/--selector option, like so: kubectl top nodes --selector instance-group=group-1 This assumes that the label name is instance-group and the label value for the group you want to query is group-1.


1

As there is no wildcard support, a workaround is to do a 2-step process to achieve the same: kubectl exec ... to do make a new tmp directory and wildcard copy/move your desired transfer files into that dir on the container use the cmd from @cookiedough above to copy all files from that dir on the container to your local Example: export TARGET_POD="...


Only top voted, non community-wiki answers of a minimum length are eligible