apiVersion: v1
kind: ConfigMap
metadata:
name: eth-geth
namespace: the-project
labels:
app: eth-geth
data:
networkid: "818945"
genesis.json: |- { "config": { "chainId": 818945, "homesteadBlock": 0, "eip150Block": 0, "eip155Block": 0, "eip158Block": 0 }, "difficulty": "0x400", "gasLimit": "2000000", "nonce" : "0x0000000000000000", "alloc": { "0x58917D55dA991da576F148FD7E3E05a34666988b": { "balance": "100000000000000000000" }, "0x29bb385cF8ae4Cc49dBd10CcdA5e3d591D831527": { "balance": "200000000000000000000" }, "0xf1c9C9a1Ba591588147c2A729c470D8AFA91a04d": { "balance": "300000000000000000000" } } }
the above code throws the following error while kubectl apply. error converting yaml to JSON yaml: line 10:did not find expected comment or line break
Checked the indentation but i am missing something here.Tried different versions of line10 , doesn't seem to work.Can someone suggest with a solution?
CodePudding user response:
Try this
apiVersion: v1
kind: ConfigMap
metadata:
name: eth-geth
namespace: the-project
labels:
app: eth-geth
data:
networkid: "818945"
genesis.json: |
{ "config": { "chainId": 818945, "homesteadBlock": 0, "eip150Block": 0, "eip155Block": 0, "eip158Block": 0 }, "difficulty": "0x400", "gasLimit": "2000000", "nonce" : "0x0000000000000000", "alloc": { "0x58917D55dA991da576F148FD7E3E05a34666988b": { "balance": "100000000000000000000" }, "0x29bb385cF8ae4Cc49dBd10CcdA5e3d591D831527": { "balance": "200000000000000000000" }, "0xf1c9C9a1Ba591588147c2A729c470D8AFA91a04d": { "balance": "300000000000000000000" } } }