Install Nodered on OpenShift v49

From Bitbull Wiki
Jump to navigation Jump to search

oc new-project $PROJECT

oc create sa anyuid
oc adm policy add-scc-to-user anyuid -z anyuid

oc create secret docker-registry docker --docker-username=xxx --docker-password="xxx"
oc secrets link default docker --for=pull

oc new-app --name nodered --source-secret=docker
oc patch deployment/nodered --patch '{"spec":{"template":{"spec":{"serviceAccountName": "anyuid"}}}}'

oc set volumes deployment --all
oc set volume deployment/nodered --add --name=nodered-data -t pvc --claim-name=nodered-data-claim --mount-path=/data --claim-size=5G --overwrite
oc set volumes deployment --all

oc create route edge --hostname=$URL --port=1880 --service=nodered

# set admin password
oc rsh deployment/nodered
  node-red admin hash-pw # copy hash
  vi /data/settings.js
    # adminAuth: -> enable section to set password
# restart pod
oc delete pod nodered-xxx

Voila :-)