Compare commits

..

2 Commits

Author SHA1 Message Date
e01e72641d Added NodeRed 2020-06-05 19:54:07 +01:00
f64125d0b2 Ignore changes to size as we have autoscaling enabled 2020-06-05 18:29:05 +01:00
2 changed files with 118 additions and 0 deletions

114
manifests/nodered.yaml Normal file
View File

@ -0,0 +1,114 @@
apiVersion: v1
kind: Namespace
metadata:
name: node-red
---
apiVersion: v1
kind: Secret
metadata:
name: node-red
namespace: node-red
annotations:
kube-1password: to62npgx5vvlknphuytg7qgrny
kube-1password/vault: Kubernetes
kube-1password/secret-text-key: settings.js
type: Opaque
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: node-red
namespace: node-red
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
---
apiVersion: v1
kind: Service
metadata:
name: node-red
namespace: node-red
spec:
type: ClusterIP
ports:
- port: 80
targetPort: web
name: web
selector:
app: node-red
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: node-red
namespace: node-red
spec:
replicas: 1
selector:
matchLabels:
app: node-red
template:
metadata:
labels:
app: node-red
spec:
securityContext:
fsGroup: 1000
initContainers:
- name: config-copy
image: bash:latest
imagePullPolicy: IfNotPresent
args:
- -c
- |
cp /config/settings.js /data/
volumeMounts:
- name: config
mountPath: /config/settings.js
subPath: settings.js
- name: data
mountPath: /data
containers:
- name: web
image: nodered/node-red:latest-12
imagePullPolicy: Always
ports:
- containerPort: 1880
name: web
volumeMounts:
- name: data
mountPath: /data
volumes:
- name: config
secret:
secretName: node-red
- name: data
persistentVolumeClaim:
claimName: node-red
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: node-red
namespace: node-red
annotations:
cert-manager.io/cluster-issuer: letsencrypt
traefik.ingress.kubernetes.io/frontend-entry-points: http,https
traefik.ingress.kubernetes.io/redirect-entry-point: https
traefik.ingress.kubernetes.io/redirect-permanent: "true"
spec:
tls:
- hosts:
- nodered.cluster.fun
secretName: node-red-ingress
rules:
- host: nodered.cluster.fun
http:
paths:
- path: /
backend:
serviceName: node-red
servicePort: 80

View File

@ -22,6 +22,10 @@ resource "scaleway_k8s_pool_beta" "k8s-cluster-pool-1" {
max_size = 2
autoscaling = true
autohealing = true
lifecycle {
ignore_changes = [size]
}
}
output "api_server" {