From e53f807caa4fcab5cdd5e9b39474a7ab2c3ef3cd Mon Sep 17 00:00:00 2001 From: Celestino Rey Date: Thu, 6 Jul 2023 15:29:18 +0200 Subject: [PATCH] =?UTF-8?q?A=C3=B1ado=20enphase=20y=20nodered?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Enphase/creaprueba.sql | 56 +++++++++++ .../templates/nodered-deployment.yaml | 2 +- HelmCharts/homeassistant-chart/.helmignore | 23 +++++ HelmCharts/homeassistant-chart/Chart.yaml | 24 +++++ .../templates/homeassistant-deployment.yaml | 67 ++++++++++++++ .../templates/pv-local-homeassistant.yaml | 12 +++ HelmCharts/homeassistant-chart/values.yaml | 82 +++++++++++++++++ HelmCharts/nodered-chart-1.0.tgz | Bin 0 -> 2778 bytes HelmCharts/nodered-chart/.helmignore | 23 +++++ HelmCharts/nodered-chart/Chart.yaml | 6 ++ .../templates/grafana-deployment.yaml | 87 ++++++++++++++++++ .../templates/mysql-deployment.yaml | 73 +++++++++++++++ .../templates/nodered-deployment.yaml | 67 ++++++++++++++ .../templates/nodered-secrets.yaml | 10 ++ .../templates/php-myadmin-deployment.yaml | 57 ++++++++++++ .../templates/pv-local-grafana.yaml | 12 +++ .../templates/pv-local-mysql.yaml | 11 +++ .../templates/pv-local-nodered.yaml | 12 +++ HelmCharts/nodered-chart/values.yaml | 82 +++++++++++++++++ 19 files changed, 705 insertions(+), 1 deletion(-) create mode 100644 Enphase/creaprueba.sql create mode 100644 HelmCharts/homeassistant-chart/.helmignore create mode 100644 HelmCharts/homeassistant-chart/Chart.yaml create mode 100644 HelmCharts/homeassistant-chart/templates/homeassistant-deployment.yaml create mode 100644 HelmCharts/homeassistant-chart/templates/pv-local-homeassistant.yaml create mode 100644 HelmCharts/homeassistant-chart/values.yaml create mode 100644 HelmCharts/nodered-chart-1.0.tgz create mode 100644 HelmCharts/nodered-chart/.helmignore create mode 100644 HelmCharts/nodered-chart/Chart.yaml create mode 100644 HelmCharts/nodered-chart/templates/grafana-deployment.yaml create mode 100644 HelmCharts/nodered-chart/templates/mysql-deployment.yaml create mode 100644 HelmCharts/nodered-chart/templates/nodered-deployment.yaml create mode 100644 HelmCharts/nodered-chart/templates/nodered-secrets.yaml create mode 100644 HelmCharts/nodered-chart/templates/php-myadmin-deployment.yaml create mode 100644 HelmCharts/nodered-chart/templates/pv-local-grafana.yaml create mode 100644 HelmCharts/nodered-chart/templates/pv-local-mysql.yaml create mode 100644 HelmCharts/nodered-chart/templates/pv-local-nodered.yaml create mode 100644 HelmCharts/nodered-chart/values.yaml diff --git a/Enphase/creaprueba.sql b/Enphase/creaprueba.sql new file mode 100644 index 00000000..40059c0e --- /dev/null +++ b/Enphase/creaprueba.sql @@ -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; + diff --git a/HelmCharts/enphase-chart/templates/nodered-deployment.yaml b/HelmCharts/enphase-chart/templates/nodered-deployment.yaml index fdd57228..3131fb09 100644 --- a/HelmCharts/enphase-chart/templates/nodered-deployment.yaml +++ b/HelmCharts/enphase-chart/templates/nodered-deployment.yaml @@ -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 diff --git a/HelmCharts/homeassistant-chart/.helmignore b/HelmCharts/homeassistant-chart/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/HelmCharts/homeassistant-chart/.helmignore @@ -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/ diff --git a/HelmCharts/homeassistant-chart/Chart.yaml b/HelmCharts/homeassistant-chart/Chart.yaml new file mode 100644 index 00000000..7b42e0cd --- /dev/null +++ b/HelmCharts/homeassistant-chart/Chart.yaml @@ -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" diff --git a/HelmCharts/homeassistant-chart/templates/homeassistant-deployment.yaml b/HelmCharts/homeassistant-chart/templates/homeassistant-deployment.yaml new file mode 100644 index 00000000..686cddaf --- /dev/null +++ b/HelmCharts/homeassistant-chart/templates/homeassistant-deployment.yaml @@ -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 diff --git a/HelmCharts/homeassistant-chart/templates/pv-local-homeassistant.yaml b/HelmCharts/homeassistant-chart/templates/pv-local-homeassistant.yaml new file mode 100644 index 00000000..1cff546d --- /dev/null +++ b/HelmCharts/homeassistant-chart/templates/pv-local-homeassistant.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: homeassistant-folder +spec: + capacity: + storage: 1Gi + accessModes: + - ReadWriteOnce + hostPath: + path: "/mnt/Externo/homeassistant" + diff --git a/HelmCharts/homeassistant-chart/values.yaml b/HelmCharts/homeassistant-chart/values.yaml new file mode 100644 index 00000000..280a17b2 --- /dev/null +++ b/HelmCharts/homeassistant-chart/values.yaml @@ -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: {} diff --git a/HelmCharts/nodered-chart-1.0.tgz b/HelmCharts/nodered-chart-1.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..352e9f8322e3282a29c266abe4b18b4ac7a613ad GIT binary patch literal 2778 zcmV<03MKU)iwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PI^?bK^GhpJ#rG{@V}v@6?DQCHV;7Ty~DBjK^BbnN%v3nu5rd zh!_MI0F(e-R=n z{e)6c!2_7}9FnHxU*GkQUC)V7g_5S)ww=NE$P%#L0uv$Ohir_JqekU$l3)NehjR2h z#Q;c}G8z&i!kHD~4}8}IqC&16fJ3;Np_DW-dSe7D2Q-<&T`Uwrw3s5zyYuX|Om(gUhB<(PgM|&l zjIj}h61588mtSpaD^ysvNygYpqoYvHXozQFXs2W?8>JZ12}K2WG3pp45Loa5$r(Y# zB4d$RuTUb<7&)-`6@Zo*T0v)=3vF|#U0f1H=F7~dA~_zP3)`WX#*l{;sd(kR~#jk5}= z132{@hw`aJWsO2^LL&-bLYOjALq?SPSS(H3wi(U0Wr=mE=q}{BcI+}bRv9%@9THmE zW)enzER?pEm<2I^f;<*Fcu$g)q02-_nC%BhiH;Y{`2f=pK(}nkS#Ipy-<#nH^4$7` z&xdAdSRO%k8#|{m}WLAlEwc76PvpI-svS>O!4;&)wUxXl4+qr!YH4%22Mix zbzVG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