Struggling with Helm, running these commands ```he...
# ask-community
e
Struggling with Helm, running these commands
Copy code
helm install --values k8s-agent.yaml prefect-agent prefect/prefect-agent && \
helm install --values k8s-orion.yaml prefect-orion prefect/prefect-orion
1
The full response response is longer but I run the command prefect-orion tells me to and I get this results and error:
Copy code
export POD_NAME=$(kubectl get pods --namespace default -l "<http://app.kubernetes.io/name=prefect-orion,app.kubernetes.io/instance=prefect-orion|app.kubernetes.io/name=prefect-orion,app.kubernetes.io/instance=prefect-orion>" -o jsonpath="{.items[0].metadata.name}")
  export CONTAINER_PORT=$(kubectl get pod --namespace default $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
  echo "Visit <http://127.0.0.1:8080> to use your application"
  kubectl --namespace default port-forward $POD_NAME 8080:$CONTAINER_PORT
Visit <http://127.0.0.1:8080> to use your application
Unable to listen on port 8080: Listeners failed to create with the following errors: [unable to create listener: Error listen tcp4 127.0.0.1:8080: bind: address already in use unable to create listener: Error listen tcp6 [::1]:8080: bind: address already in use]
error: unable to listen on any of the requested ports: [{8080 4200}]
The yaml files are default expect these two changes: k8s-agent.yaml
Copy code
## connection settings
  # -- one of 'cloud' or 'orion'
  apiConfig: "orion"
k8s-orion.yaml
Copy code
# -- array with environment variables to add to orion nodes
#  env: []
    env:
     - name: PREFECT_API_URL
       value: <http://prefect-orion:4200/api>
Any ideas?
j
this is what fails
Copy code
kubectl --namespace default port-forward $POD_NAME 8080:$CONTAINER_PORT
it is trying to port forward the server running in a pod on k8s to your local machine, so then you could open it in
Copy code
Visit <http://127.0.0.1:8080> to use your application
It fails to do so, because your local system’s 8080 port is already in use.
👀 1
e
Hmmm so I tried with a few different ports but it sits at this stage... until I try to access and then i get this error
Copy code
Handling connection for 8083
E0928 15:57:32.386853    5341 portforward.go:406] an error occurred forwarding 8083 -> 4200: error forwarding port 4200 to pod ba8d96a71da86b9a1605b48f1b85315e8a9908f5471a123d34c536dbf743f9cd, uid : exit status 1: 2022/09/28 14:57:32 socat[22297] E connect(5, AF=2 127.0.0.1:4200, 16): Connection refused
E0928 15:57:32.387535    5341 portforward.go:234] lost connection to pod
My pod is going into a crash loop immediately, does the default values.yaml not work and if so what do I need to change in a custom one?
j
check the logs on what it is crashing
Copy code
E0928 15:57:32.386853    5341 portforward.go:406] an error occurred forwarding 8083 -> 4200: error forwarding port 4200 to pod
happens because of the pod crash 🤷
e
Was complaining over lack of password, so I added one into the values yaml but now I get this error
Copy code
with self.open(mode='w', encoding=encoding, errors=errors, newline=newline) as f:
  File "/usr/local/lib/python3.10/pathlib.py", line 1119, in open
    return self._accessor.open(self, mode, buffering, encoding, errors,
OSError: [Errno 30] Read-only file system: '/opt/prefect/memo_store.toml'

ERROR:    Application startup failed. Exiting.
Orion stopped!
j
ah, that is listed as an issue here & an open PR here. In the meantime, you should be able to follow the steps documented under the issue to get your install working. Basically setting
readOnlyRootFilesystem
to false
e
great, thanks, i'll keep my eye on that pull request
Seems that this has been fixed and merged but I am still having the same issue
j
A fix has not been merged for this yet - you can pass this in your values file to override the default behavior:
Copy code
containerSecurityContext:
  runAsUser: 0
  runAsNonRoot: false
  readOnlyRootFilesystem: false
an open PR for this is here
The above PR has been merged and is planned to be released after the prefect release tomorrow.
this has been released ^