Browse Source

Añado enphase y nodered

main
Celestino Rey 2 years ago
parent
commit
e53f807caa
19 changed files with 705 additions and 1 deletions
  1. +56
    -0
      Enphase/creaprueba.sql
  2. +1
    -1
      HelmCharts/enphase-chart/templates/nodered-deployment.yaml
  3. +23
    -0
      HelmCharts/homeassistant-chart/.helmignore
  4. +24
    -0
      HelmCharts/homeassistant-chart/Chart.yaml
  5. +67
    -0
      HelmCharts/homeassistant-chart/templates/homeassistant-deployment.yaml
  6. +12
    -0
      HelmCharts/homeassistant-chart/templates/pv-local-homeassistant.yaml
  7. +82
    -0
      HelmCharts/homeassistant-chart/values.yaml
  8. BIN
      HelmCharts/nodered-chart-1.0.tgz
  9. +23
    -0
      HelmCharts/nodered-chart/.helmignore
  10. +6
    -0
      HelmCharts/nodered-chart/Chart.yaml
  11. +87
    -0
      HelmCharts/nodered-chart/templates/grafana-deployment.yaml
  12. +73
    -0
      HelmCharts/nodered-chart/templates/mysql-deployment.yaml
  13. +67
    -0
      HelmCharts/nodered-chart/templates/nodered-deployment.yaml
  14. +10
    -0
      HelmCharts/nodered-chart/templates/nodered-secrets.yaml
  15. +57
    -0
      HelmCharts/nodered-chart/templates/php-myadmin-deployment.yaml
  16. +12
    -0
      HelmCharts/nodered-chart/templates/pv-local-grafana.yaml
  17. +11
    -0
      HelmCharts/nodered-chart/templates/pv-local-mysql.yaml
  18. +12
    -0
      HelmCharts/nodered-chart/templates/pv-local-nodered.yaml
  19. +82
    -0
      HelmCharts/nodered-chart/values.yaml

+ 56
- 0
Enphase/creaprueba.sql View File

@ -0,0 +1,56 @@
-- MariaDB dump 10.19 Distrib 10.10.2-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: enphase
-- ------------------------------------------------------
-- Server version 10.10.2-MariaDB-1:10.10.2+maria~ubu2204
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `production_eim`
--
DROP TABLE IF EXISTS `production_eim_test`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `production_eim_test` (
`type` text NOT NULL,
`activeCount` int(11) NOT NULL,
`measurementType` text NOT NULL,
`readingTime` datetime NOT NULL,
`wNow` float NOT NULL,
`whLifetime` float NOT NULL,
`varhLeadLifetime` float NOT NULL,
`varhLagLifetime` float NOT NULL,
`vahLifetime` float NOT NULL,
`rmsCurrent` float NOT NULL,
`rmsVoltage` float NOT NULL,
`reactPwr` float NOT NULL,
`apprntPwr` float NOT NULL,
`pwrFactor` float NOT NULL,
`whToday` float NOT NULL,
`whLastSevenDays` float NOT NULL,
`vahToday` float NOT NULL,
`varhLeadToday` float NOT NULL,
`varhLagToday` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `production_eim`
--
LOCK TABLES `production_eim_test` WRITE;
/*!40000 ALTER TABLE `production_eim` DISABLE KEYS */;
/*!40000 ALTER TABLE `production_eim` ENABLE KEYS */;
UNLOCK TABLES;

+ 1
- 1
HelmCharts/enphase-chart/templates/nodered-deployment.yaml View File

@ -51,7 +51,7 @@ spec:
tier: frontend
spec:
containers:
- image: nodered/node-red-docker:v8
- image: nodered/node-red:latest
name: nodered
ports:
- containerPort: 1880


+ 23
- 0
HelmCharts/homeassistant-chart/.helmignore View File

@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

+ 24
- 0
HelmCharts/homeassistant-chart/Chart.yaml View File

@ -0,0 +1,24 @@
apiVersion: v2
name: homeassistant-chart
description: A Helm chart for Kubernetes
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.16.0"

+ 67
- 0
HelmCharts/homeassistant-chart/templates/homeassistant-deployment.yaml View File

@ -0,0 +1,67 @@
apiVersion: v1
kind: Service
metadata:
name: homeassistant
namespace: homeassistant
labels:
app: homeassistant
spec:
type: NodePort
ports:
- port: 8123
nodePort: 30097
targetPort: homeassistant
selector:
app: homeassistant
tier: frontend
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: ha-pv-claim
namespace: homeassistant
labels:
app: homeassistant
spec:
accessModes:
- ReadWriteOnce
storageClassName: ""
resources:
requests:
storage: 1Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: homeassistant
namespace: homeassistant
labels:
app: homeassistant
spec:
selector:
matchLabels:
app: homeassistant
tier: frontend
strategy:
type: Recreate
template:
metadata:
labels:
app: homeassistant
tier: frontend
spec:
containers:
- image: ghcr.io/home-assistant/home-assistant:stable
name: homeassistant
ports:
- containerPort: 8123
name: homeassistant
volumeMounts:
- name: homeassistant-persistent-storage
mountPath: /data
imagePullSecrets:
- name: reg-cred-secret
volumes:
- name: homeassistant-persistent-storage
persistentVolumeClaim:
claimName: ha-pv-claim

+ 12
- 0
HelmCharts/homeassistant-chart/templates/pv-local-homeassistant.yaml View File

@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: homeassistant-folder
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/Externo/homeassistant"

+ 82
- 0
HelmCharts/homeassistant-chart/values.yaml View File

@ -0,0 +1,82 @@
# Default values for homeassistant-chart.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image:
repository: nginx
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
serviceAccount:
# Specifies whether a service account should be created
create: true
# Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""
podAnnotations: {}
podSecurityContext: {}
# fsGroup: 2000
securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
service:
type: ClusterIP
port: 80
ingress:
enabled: false
className: ""
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths:
- path: /
pathType: ImplementationSpecific
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80
nodeSelector: {}
tolerations: []
affinity: {}

BIN
HelmCharts/nodered-chart-1.0.tgz View File


+ 23
- 0
HelmCharts/nodered-chart/.helmignore View File

@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

+ 6
- 0
HelmCharts/nodered-chart/Chart.yaml View File

@ -0,0 +1,6 @@
apiVersion: v2
appVersion: 1.16.0
description: A Helm chart for Kubernetes
name: nodered-chart
type: application
version: "1.0"

+ 87
- 0
HelmCharts/nodered-chart/templates/grafana-deployment.yaml View File

@ -0,0 +1,87 @@
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: grafana-pvc
namespace: nodered
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: grafana
name: grafana
namespace: nodered
spec:
selector:
matchLabels:
app: grafana
template:
metadata:
labels:
app: grafana
spec:
securityContext:
fsGroup: 472
supplementalGroups:
- 0
containers:
- name: grafana
image: grafana/grafana:9.1.0
imagePullPolicy: IfNotPresent
ports:
- containerPort: 3000
name: http-grafana
protocol: TCP
readinessProbe:
failureThreshold: 3
httpGet:
path: /robots.txt
port: 3000
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 30
successThreshold: 1
timeoutSeconds: 2
livenessProbe:
failureThreshold: 3
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 1
tcpSocket:
port: 3000
timeoutSeconds: 1
resources:
requests:
cpu: 250m
memory: 750Mi
volumeMounts:
- mountPath: /var/lib/grafana
name: grafana-pv
volumes:
- name: grafana-pv
persistentVolumeClaim:
claimName: grafana-pvc
---
apiVersion: v1
kind: Service
metadata:
name: grafana
namespace: nodered
spec:
type: NodePort
ports:
- port: 3000
protocol: TCP
nodePort: 30002
targetPort: http-grafana
selector:
app: grafana
sessionAffinity: None
type: NodePort

+ 73
- 0
HelmCharts/nodered-chart/templates/mysql-deployment.yaml View File

@ -0,0 +1,73 @@
apiVersion: v1
kind: Service
metadata:
name: nodered-mysql
namespace: nodered
labels:
app: nodered
spec:
type: NodePort
ports:
- name: mysql
port: 3306
nodePort: 30385
targetPort: mysql
selector:
app: nodered
tier: mysql
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mysql-pv-claim
namespace: nodered
labels:
app: nodered
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nodered-mysql
namespace: nodered
labels:
app: nodered
spec:
selector:
matchLabels:
app: nodered
tier: mysql
strategy:
type: Recreate
template:
metadata:
labels:
app: nodered
tier: mysql
spec:
containers:
- image: mariadb:latest
name: mysql
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mysql-pass
key: password
ports:
- containerPort: 3306
name: mysql
volumeMounts:
- name: mysql-persistent-storage
mountPath: /var/lib/mysql
imagePullSecrets:
- name: reg-cred-secret
volumes:
- name: mysql-persistent-storage
persistentVolumeClaim:
claimName: mysql-pv-claim

+ 67
- 0
HelmCharts/nodered-chart/templates/nodered-deployment.yaml View File

@ -0,0 +1,67 @@
apiVersion: v1
kind: Service
metadata:
name: nodered
namespace: nodered
labels:
app: nodered
spec:
type: NodePort
ports:
- port: 1880
nodePort: 30096
targetPort: nodered
selector:
app: nodered
tier: frontend
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nr-pv-claim
namespace: nodered
labels:
app: nodered
spec:
accessModes:
- ReadWriteOnce
storageClassName: ""
resources:
requests:
storage: 2Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nodered
namespace: nodered
labels:
app: nodered
spec:
selector:
matchLabels:
app: nodered
tier: frontend
strategy:
type: Recreate
template:
metadata:
labels:
app: nodered
tier: frontend
spec:
containers:
- image: nodered/node-red:latest
name: nodered
ports:
- containerPort: 1880
name: nodered
volumeMounts:
- name: nodered-persistent-storage
mountPath: /data
imagePullSecrets:
- name: reg-cred-secret
volumes:
- name: nodered-persistent-storage
persistentVolumeClaim:
claimName: nr-pv-claim

+ 10
- 0
HelmCharts/nodered-chart/templates/nodered-secrets.yaml View File

@ -0,0 +1,10 @@
apiVersion: v1
kind: Secret
metadata:
name: mysql-pass
namespace: nodered
type: Opaque
stringData:
db_password: Dsa-0213
password: Dsa-0213
db_user: root

+ 57
- 0
HelmCharts/nodered-chart/templates/php-myadmin-deployment.yaml View File

@ -0,0 +1,57 @@
apiVersion: v1
kind: Service
metadata:
name: phpmyadmin-nodered
namespace: nodered
labels:
app: nodered
spec:
selector:
app: nodered
tier: phpmyadmin
type: NodePort
ports:
- name: phpadmin
port: 80
nodePort: 30386
targetPort: phpmyadm
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: phpmyadmin-nodered
namespace: nodered
labels:
app: nodered
spec:
selector:
matchLabels:
app: nodered
tier: phpmyadmin
strategy:
type: Recreate
template:
metadata:
labels:
app: nodered
tier: phpmyadmin
spec:
containers:
- name: phpmyadmin
image: phpmyadmin
ports:
- containerPort: 80
name: phpmyadm
env:
- name: PMA_HOST
value: nodered-mysql
- name: PMA_PORT
value: "3306"
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mysql-pass
key: password
imagePullSecrets:
- name: reg-cred-secret

+ 12
- 0
HelmCharts/nodered-chart/templates/pv-local-grafana.yaml View File

@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: nodered-grafana-folder
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/Externo/nodered/grafana"

+ 11
- 0
HelmCharts/nodered-chart/templates/pv-local-mysql.yaml View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: nodered-data
spec:
capacity:
storage: 20Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/Externo/nodered/nodered-db"

+ 12
- 0
HelmCharts/nodered-chart/templates/pv-local-nodered.yaml View File

@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: nodered-app-folder
spec:
capacity:
storage: 2Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/Externo/nodered/nodered-app"

+ 82
- 0
HelmCharts/nodered-chart/values.yaml View File

@ -0,0 +1,82 @@
# Default values for nodered-chart.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image:
repository: nginx
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
serviceAccount:
# Specifies whether a service account should be created
create: true
# Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""
podAnnotations: {}
podSecurityContext: {}
# fsGroup: 2000
securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
service:
type: ClusterIP
port: 80
ingress:
enabled: false
className: ""
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths:
- path: /
pathType: ImplementationSpecific
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80
nodeSelector: {}
tolerations: []
affinity: {}

Loading…
Cancel
Save