Skip to content

Instantly share code, notes, and snippets.

@adamhancock
Last active January 10, 2024 18:49
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save adamhancock/a8447dcf479679bfb467ca9d5fbb64ad to your computer and use it in GitHub Desktop.
Save adamhancock/a8447dcf479679bfb467ca9d5fbb64ad to your computer and use it in GitHub Desktop.
Node-RED on Kubernetes
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: node-red
name: node-red
namespace: node-red
spec:
replicas: 1
selector:
matchLabels:
app: node-red
strategy:
type: Recreate
template:
metadata:
labels:
app: node-red
spec:
containers:
- image: adamhancock/node-red
imagePullPolicy: Always
name: node-red
ports:
- containerPort: 1880
protocol: TCP
resources: {}
env:
- name: TZ
value: Europe/London
- name: PGID
value: "1000"
- name: PUID
value: "1000"
volumeMounts:
- mountPath: /data
name: node-red-claim0
volumes:
- name: node-red-claim0
persistentVolumeClaim:
claimName: node-red-claim0
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
traefik.ingress.kubernetes.io/redirect-entry-point: https
generation: 3
name: node-red
namespace: node-red
spec:
rules:
- host: node-red.yourdomain.tld
http:
paths:
- path: /
backend:
serviceName: node-red
servicePort: 1880
tls:
- hosts:
- node-red.yourdomain.tld
secretName: node-red-cert
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
app: node-red
name: node-red-claim0
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
status: {}
apiVersion: v1
kind: Service
metadata:
labels:
app: node-red
name: node-red
namespace: node-red
spec:
ports:
- name: "1880"
port: 1880
protocol: TCP
targetPort: 1880
selector:
app: node-red
sessionAffinity: None
type: ClusterIP
@bodagrave
Copy link

bodagrave commented Jun 19, 2022

Thanks for these deploy files. But please be aware: v1beta1 is outdated. This deployment will not work in >= 1.22
You might use kubectl-convert before deployment, but it seems not to work on k3s, at least for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment