<p>I'm trying to deploy Geth(ethereum/client-go) pod on k8s.
But I can't deploy the pod with error &quot;<code>Fatal: Error starting protocol stack: listen tcp: lookup &quot;192.168.1.10&quot;: no such host</code>&quot;.</p>
<p>My <code>deploy.yaml</code> is here.</p>
<pre><code>---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: chaindatastorage
spec:
  capacity:
    storage: 1000Gi
  volumeMode: Filesystem
  accessModes:
  - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  storageClassName: local-ssd-storage
  local:
    path: /k8sNodeData/ethDataDir
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: disktype
          operator: In
          values:
          - ssd
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: chaindatavolumeclaim
spec:
  accessModes:
    - ReadWriteOnce
  volumeMode: Filesystem
  resources:
    requests:
      storage: 1000Gi
  storageClassName: local-ssd-storage
---
apiVersion: v1
kind: Service
metadata:
  name: geth-port
spec:
  type: NodePort
  ports:
    - name: geth-sync-port
      port: 30303
      targetPort: 30303
      nodePort: 30303
    - name: geth-rpc-port
      port: 8545
      targetPort: 8545
      nodePort: 8545
  selector:
    name: gethnode
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: gethnodedeployment
spec:
  replicas: 1
  selector:
    matchLabels:
      name: gethnode
  template:
    metadata:
      labels:
        name: gethnode
    spec:
      containers:
      - name: gethnode
        image: ethereum/client-go
        args:
        - &quot;--syncmode=full&quot;
        - &quot;--maxpeers=80&quot;
        - &quot;--cache=8192&quot;
        - &quot;--http&quot;
        - &quot;--http.addr=\&quot;192.168.1.10\&quot;&quot;
        - &quot;--http.port=8545&quot;
        volumeMounts:
          - name: gethchaindata
            mountPath: /root/.ethereum
        resources:
          limits:
            memory: 20480Mi
            cpu: 4000m
      volumes:
        - name: gethchaindata
          persistentVolumeClaim:
            claimName: chaindatavolumeclaim
---
</code></pre>
<p>The results of <code>kubectl get service</code> is here.</p>
<pre><code>NAME                      TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)                         AGE
geth-port                 NodePort    10.110.121.244   &lt;none&gt;        30303:30303/TCP,8545:8545/TCP   78s
kubernetes                ClusterIP   10.96.0.1        &lt;none&gt;        443/TCP                         29d
</code></pre>
<p>The results of <code>kubectl get logs</code> of the pod is here.</p>
<pre><code>INFO [10-03|09:40:33.482] Starting Geth on Ethereum mainnet... 
INFO [10-03|09:40:33.483] Maximum peer count                       ETH=80 LES=0 total=80
INFO [10-03|09:40:33.483] Smartcard socket not found, disabling    err=&quot;stat /run/pcscd/pcscd.comm: no such file or directory&quot;
ERROR[10-03|09:40:33.483] Failed to enumerate USB devices          hub=ledger vendor=11415 failcount=1 err=&quot;failed to initialize libusb: libusb: unknown error [code -99]&quot;
ERROR[10-03|09:40:33.483] Failed to enumerate USB devices          hub=trezor vendor=21324 failcount=1 err=&quot;failed to initialize libusb: libusb: unknown error [code -99]&quot;
ERROR[10-03|09:40:33.483] Failed to enumerate USB devices          hub=trezor vendor=4617  failcount=1 err=&quot;failed to initialize libusb: libusb: unknown error [code -99]&quot;
ERROR[10-03|09:40:33.483] Failed to enumerate USB devices          hub=ledger vendor=11415 failcount=2 err=&quot;failed to initialize libusb: libusb: unknown error [code -99]&quot;
ERROR[10-03|09:40:33.483] Failed to enumerate USB devices          hub=trezor vendor=21324 failcount=2 err=&quot;failed to initialize libusb: libusb: unknown error [code -99]&quot;
ERROR[10-03|09:40:33.483] Failed to enumerate USB devices          hub=trezor vendor=4617  failcount=2 err=&quot;failed to initialize libusb: libusb: unknown error [code -99]&quot;
INFO [10-03|09:40:33.483] Set global gas cap                       cap=25000000
INFO [10-03|09:40:33.483] Allocated trie memory caches             clean=2.00GiB dirty=2.00GiB
INFO [10-03|09:40:33.483] Allocated cache and file handles         database=/root/.ethereum/geth/chaindata cache=4.00GiB handles=524288
ERROR[10-03|09:40:34.483] Failed to enumerate USB devices          hub=trezor vendor=4617  failcount=3 err=&quot;failed to initialize libusb: libusb: unknown error [code -99]&quot;
ERROR[10-03|09:40:34.483] Failed to enumerate USB devices          hub=trezor vendor=21324 failcount=3 err=&quot;failed to initialize libusb: libusb: unknown error [code -99]&quot;
ERROR[10-03|09:40:34.483] Failed to enumerate USB devices          hub=ledger vendor=11415 failcount=3 err=&quot;failed to initialize libusb: libusb: unknown error [code -99]&quot;
INFO [10-03|09:40:34.769] Opened ancient database                  database=/root/.ethereum/geth/chaindata/ancient
INFO [10-03|09:40:34.825] Initialised chain configuration          config=&quot;{ChainID: 1 Homestead: 1150000 DAO: 1920000 DAOSupport: true EIP150: 2463000 EIP155: 2675000 EIP158: 2675000 Byzantium: 4370000 Constantinople: 7280000 Petersburg: 7280000 Istanbul: 9069000, Muir Glacier: 9200000, YOLO v1: &lt;nil&gt;, Engine: ethash}&quot;
INFO [10-03|09:40:34.825] Disk storage enabled for ethash caches   dir=/root/.ethereum/geth/ethash count=3
INFO [10-03|09:40:34.825] Disk storage enabled for ethash DAGs     dir=/root/.ethash               count=2
INFO [10-03|09:40:34.826] Initialising Ethereum protocol           versions=&quot;[65 64 63]&quot; network=1 dbversion=8
INFO [10-03|09:40:37.518] Loaded most recent local header          number=10974617 hash=&quot;d28c04…5fe44a&quot; td=17763879313328271327648 age=1d4h43m
INFO [10-03|09:40:37.519] Loaded most recent local full block      number=10973423 hash=&quot;92578b…ae09c1&quot; td=17759925126330650308055 age=1d9h14m
INFO [10-03|09:40:37.519] Loaded most recent local fast block      number=10974617 hash=&quot;d28c04…5fe44a&quot; td=17763879313328271327648 age=1d4h43m
INFO [10-03|09:40:37.521] Loaded local transaction journal         transactions=0 dropped=0
INFO [10-03|09:40:37.521] Regenerated local transaction journal    transactions=0 accounts=0
INFO [10-03|09:40:37.522] Starting peer-to-peer node               instance=Geth/v1.9.23-unstable-9d1e2027-20200930/linux-amd64/go1.15.2
INFO [10-03|09:40:37.576] New local node record                    seq=52227 id=78ab8e1d111e4ab5 ip=127.0.0.1 udp=30303 tcp=30303
INFO [10-03|09:40:37.577] Started P2P networking                   self=enode://0b9ee2182b4382638cd77fc8b4369d00b4c14cc6c46d4c71d84a9a9fc191cab75c6566b78a42ddcf4a4d00ba9057747588750f518133bf821cd09e69d769ba0b@127.0.0.1:30303
INFO [10-03|09:40:37.580] IPC endpoint opened                      url=/root/.ethereum/geth.ipc
INFO [10-03|09:40:37.581] IPC endpoint closed                      url=/root/.ethereum/geth.ipc
Fatal: Error starting protocol stack: listen tcp: lookup &quot;192.168.1.10&quot;: no such host
Fatal: Error starting protocol stack: listen tcp: lookup &quot;192.168.1.10&quot;: no such host
</code></pre>
<p>When I turned off the <code>- &quot;--http&quot;</code> <code>- &quot;--http.addr=\&quot;192.168.1.10\&quot;&quot;</code> <code>- &quot;--http.port=8545&quot;</code> settings, the pod works without any problems. The pod begins syncing. <code>nping</code> to <code>192.168.1.10:30303</code> works without any problems. So I think the format of NodePort setting is correct. I wonder why the pod can't be started only when I add the series of <code>--http</code> settings.</p>
<p>I have already changed the range of port of k8s. So I think the port 30303 and 8545 are not wrong.</p>
<p>I'd like to know where to fix it or the cause of the error.</p>
<p>10/05<br>
The result of <code>kubectl get pod -A</code></p>
<pre><code>NAMESPACE     NAME                                       READY   STATUS    RESTARTS   AGE
default       gethnodedeployment-6f5cd5cf4b-wnqst        1/1     Running   1          20s
default       intelnuc-mysql-deployment-9685c849-q6c9j   1/1     Running   0          6d20h
kube-system   coredns-66bff467f8-gbf9r                   1/1     Running   0          30d
kube-system   coredns-66bff467f8-xg72w                   1/1     Running   0          30d
kube-system   etcd-k8smaster                             1/1     Running   0          30d
kube-system   kube-apiserver-k8smaster                   1/1     Running   1          40h
kube-system   kube-controller-manager-k8smaster          1/1     Running   3          30d
kube-system   kube-flannel-ds-amd64-gcg5c                1/1     Running   0          30d
kube-system   kube-flannel-ds-amd64-mn7zq                1/1     Running   0          17d
kube-system   kube-flannel-ds-amd64-p6lkz                1/1     Running   0          30d
kube-system   kube-proxy-ckfkm                           1/1     Running   0          30d
kube-system   kube-proxy-qhnbn                           1/1     Running   0          17d
kube-system   kube-proxy-rr6b8                           1/1     Running   0          30d
kube-system   kube-scheduler-k8smaster                   1/1     Running   3          30d
</code></pre>

Pierogi
<p>Your deployment is missing a label:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: gethnodedeployment
</code></pre>
<p>needs to become</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: gethnodedeployment
  labels:
    name: gethnode

</code></pre>
<p>The label is what the service selector uses to find matching pods.</p>
