yq Questions
4
Solved
What I want to do
I want to install yq to edit some yaml files on a Docker container.
Dockerfile
FROM python:3
RUN apt-get update
RUN apt-key adv --keyserver keyserver.ubuntu.com --keyserver-optio...
8
I have a yaml array like below,
identitymappings:
- arn: "arn:aws:iam::12345567:role/AdmRole"
group: "system:masters"
user: "user1"
- arn: "arn:aws:iam::1234556...
2
Solved
In yq 4.11.2, If I do this:
echo '---\nfoo: foo\n---\nfoo: foo\n' | yq eval '.foo' -
I get this:
foo
---
foo
Using yq only (not grep, awk, etc.), how can I remove the --- to get this?
foo
foo
Ratcliffe asked 6/10, 2021 at 21:50
3
Solved
Here Edit yaml objects in array with yq. Speed up Terminalizer's terminal cast (record) I asked about how to edit yaml with yq. I received the best answer. But by default yq removes comments an...
3
Solved
echo "apiVersion: v1
kind: Node
metadata:
name: host-cluster-control-plane-64j47
labels:
beta.kubernetes.io/arch: amd64
" | yq -o p
Result:
apiVersion = v1
kind = Node
metadata.name =...
Childbed asked 24/3, 2023 at 21:57
4
Solved
I have a certificate file that looks similar to:
-------BEGIN CERTIFICATE-------
asdoqijepoqjwe1i49i120941p2j4omslasdajsdqweqwe
qwelqjwkasdlajsölkjasldkjakljsdlkjasdasdpiqwe
-------END CERTIFICATE-...
2
Solved
Given a yaml file (helmfile) like the following
releases:
- chart: ../charts/foo
name: foo
namespace: '{{ .Values.stack }}'
values:
- ../config/templates/foo-values.yaml.gotmpl
set:
- name:...
Mortarboard asked 29/5, 2020 at 13:44
2
Solved
I have a k8s manifest file for loadbalancer below and cannot for the life of me get the $ipaddress be replaced with value, I have got to to overwrite whole file or part of or even just leave blank....
Irresolute asked 14/1, 2022 at 16:12
1
Using https://github.com/mikefarah/yq v4
Given a sample.yaml file like this:
spec:
chart:
name: my-chart
version: 0.0.1
---
spec:
chart:
name: something-else
version: 0.0.2
I want to update ...
Equiangular asked 21/9, 2021 at 17:16
2
Solved
I have some tricky thing that I need to do for a yaml file, this is how it looks before
Before
apiVersion: v1
items:
- apiVersion: core.k8s.com/v1alpha1
kind: Test
metadata:
creationTimestamp: ...
2
Solved
I am trying to read a yaml file in gitlab CI. I installed jq==1.0.2 and yq==2.10.1 using pip in my CI job and I use python:3.7 image. When I tried to read the yaml file, it has the error
yq: Error ...
1
Solved
I'm trying to determine the correct syntax for using yq to print all key/value pairs from a given yaml input using yq v4 - with the desired output having the full key "path". This was pos...
1
I'm trying to install yq@3 on my Mac running brew install yq@3 and I get the error:
Error: yq@3 has been disabled because it is not maintained upstream!
I see that it's there on their website at h...
Perlie asked 12/8, 2021 at 16:20
1
I'm having a big problem with the edit in place flag for yq version 2.12.0.
We are trying to update a value for a variable in one of our .yaml scripts. The before looks like this...
authentication:...
Aestivation asked 26/4, 2021 at 19:20
1
Solved
I have a yaml file that looks like this:
apiVersion: v1
entries:
blue-green-toggle:
- description: Used to toggle an application between blue and green
name: blue-green-toggle
version: 1.0.17
...
2
Solved
Because of a recent change in the ubuntu-latest image that introduced a buggy version of docker-compose, I had to lock down the version of docker-compose on my pipelines.
However, there was a task ...
Allieallied asked 11/9, 2020 at 22:8
1
Solved
I want to merge two yaml documents with the result containing
all mapped values (with the last one taking precedence)
concatenated arrays
e.g. given this file
# file1.yml
animals:
- elephant
do...
2
Solved
Having YAML document something like:
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-scraping
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: allow-webhook...
Nestle asked 2/3, 2021 at 20:16
1
Solved
I am having issues reading values from a YAML file when there's a dot in the key name.
i.e.
a:
b.c: 2
Reading the a key works fine with cat mytext.yaml | yq r - a. However, when I tried reading a...
1
Solved
Currently I am trying to exchange a string but WITH double quotes in a YAML file with the mikefarah/yq processor (version 3.1.2 on an Ubuntu machine) similar to the following:
config:
app:
name: ...
2
Solved
I have a simple values.yaml file which has below data:
images:
tags:
one: abc:v0.3-16-07
two: xyz:ng-0.23.0
pq: qaa:0df1e21e752b3d3.2020-04-27_1
Using
yq -r --yaml-output ".images.tags" va...
3
Solved
I have a k8s yaml file with below block
spec:
replicas: 1
strategy:
type: Recreate
and I want to add below block after "spec:"
selector:
matchLabels:
app: test-app
The file is huge and h...
Edh asked 8/4, 2020 at 20:31
3
Solved
I want to change yaml file value based on name:
Example:
spec:
containers:
- name: app1
image: imageurl.com
command: []
env:
- name: MONGO_HOST
value: localhost
Here you can see we have ...
1
Solved
The goal: Speed up Terminalizer's terminal cast (record)
I have a record of terminal created with Terminalizer. cast.yaml:
# The configurations that used for the recording, feel free to edit them...
2
Solved
I have a YAML file (docker-compose file in my case) that looks like this:
networks:
foo:
some_opts: "covfefe"
bar:
some_opts: "such wow"
services:
apache:
image: 'apache:1.0.0'
restart: alw...
1 Next >
© 2022 - 2024 — McMap. All rights reserved.