@@ -35,30 +35,21 @@ spec:
3535 {{- if .Values.initContainers }}
3636 {{- tpl (toYaml .Values.initContainers | nindent 4) $ }}
3737 {{- end }}
38- {{- if or .Values.service.p2p.nodePortEnabled .Values.hostNetwork }}
38+ {{- if .Values.service.p2p.nodePortEnabled }}
3939 - name : init-nodeport
40- image : rancher/ kubectl:v1.34.1
40+ image : registry.suse.com/suse/ kubectl:1.33
4141 securityContext :
4242 runAsNonRoot : false
4343 runAsUser : 0
4444 command :
45- - sh
45+ - /bin/bash
4646 - -c
4747 - |
4848 export POD_INDEX=$(echo ${POD_NAME} | awk -F'-' '{print $NF}');
49-
50- # If running host network, we don't need to get the node port from the service
51- {{- if not .Values.hostNetwork }}
5249 export EXTERNAL_PORT=$(kubectl get services -l "pod-index in (${POD_INDEX}), type in (p2p)" -o jsonpath='{.items[0].spec.ports[0].nodePort}');
53- echo "export EXTERNAL_PORT=$EXTERNAL_PORT" > /shared/init-nodeport;
54- echo "export P2P_PORT=$EXTERNAL_PORT" >> /shared/init-nodeport;
55- {{- end }}
5650
57- # Get the external IP of the node
58- export EXTERNAL_IP=$(kubectl get nodes "${NODE_NAME}" -o jsonpath='{.status.addresses[?(@.type=="ExternalIP")].address}');
51+ echo "export P2P_BROADCAST_PORT=$EXTERNAL_PORT" >> /shared/init-nodeport;
5952
60- echo "export EXTERNAL_IP=$EXTERNAL_IP" >> /shared/init-nodeport;
61- echo "export P2P_IP=$EXTERNAL_IP" >> /shared/init-nodeport;
6253 cat /shared/init-nodeport;
6354 env :
6455 - name : POD_NAME
8273 - -c
8374 - |
8475 {{- if or .Values.service.p2p.nodePortEnabled .Values.hostNetwork }}
85- source /shared/init-nodeport;
76+ if [ -f /shared/init-nodeport ]; then
77+ source /shared/init-nodeport;
78+ fi
79+ export P2P_QUERY_FOR_IP=true
8680 {{- else }}
8781 export P2P_IP=$(hostname -i)
8882 {{- end }}
0 commit comments