From be12478e42ab3dfba1ecd084f3f310747ed1329b Mon Sep 17 00:00:00 2001 From: Celestino Rey Date: Wed, 8 Feb 2023 08:56:14 +0100 Subject: [PATCH] =?UTF-8?q?Quito=20HTTPS=20y=20a=C3=B1ado=20SpagoBI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Comunes/creaImagenSpagoBI.sh | 3 + .../certbot-claim0-persistentvolumeclaim.yaml | 14 ---- .../certbot-claim1-persistentvolumeclaim.yaml | 14 ---- HTTPS/certbot-deployment.yaml | 44 ---------- .../meta.json | 1 - .../private_key.json | 1 - .../regr.json | 1 - HTTPS/certbot/conf/csr/0000_csr-certbot.pem | 8 -- HTTPS/certbot/conf/csr/0001_csr-certbot.pem | 7 -- HTTPS/certbot/conf/keys/0000_key-certbot.pem | 5 -- HTTPS/certbot/conf/keys/0001_key-certbot.pem | 5 -- HTTPS/docker-compose.yml | 17 ---- HTTPS/docker-compose.yml.copia | 17 ---- HTTPS/kustomization.yaml | 8 ++ HTTPS/miweb-configmap.yaml | 23 +++++ HTTPS/miweb-deployment.yaml | 29 +++++++ HTTPS/miweb-ingress.yaml | 21 +++++ HTTPS/miweb-letsencrypt-certs.yaml | 6 ++ HTTPS/miweb-letsencrypt-job.yaml | 30 +++++++ HTTPS/miweb-letsencrypt-service.yaml | 10 +++ HTTPS/miweb-service.yaml | 12 +++ HTTPS/nginx/conf/nginx.conf | 15 ---- ...ebserver-claim0-persistentvolumeclaim.yaml | 14 ---- ...ebserver-claim1-persistentvolumeclaim.yaml | 14 ---- HTTPS/webserver-deployment.yaml | 51 ----------- HTTPS/webserver-service.yaml | 22 ----- HelmCharts/helmSpagoBI.sh | 14 ++++ HelmCharts/preparaSpagoBI/bi-namespace.yaml | 4 + HelmCharts/preparaSpagoBI/pv-local-mysql.yaml | 11 +++ .../preparaSpagoBI/pv-local-spagobi.yaml | 12 +++ HelmCharts/spagobi-chart/.helmignore | 23 +++++ HelmCharts/spagobi-chart/Chart.yaml | 24 ++++++ .../templates/mysql-deployment.yaml | 82 ++++++++++++++++++ .../templates/php-deployment.yaml | 56 +++++++++++++ .../templates/registry-secrets.yaml | 11 +++ .../templates/spagobi-deployment.yaml | 84 +++++++++++++++++++ .../templates/spagobi-secrets.yaml | 10 +++ HelmCharts/spagobi-chart/values.yaml | 82 ++++++++++++++++++ 38 files changed, 555 insertions(+), 250 deletions(-) create mode 100644 Comunes/creaImagenSpagoBI.sh delete mode 100644 HTTPS/certbot-claim0-persistentvolumeclaim.yaml delete mode 100644 HTTPS/certbot-claim1-persistentvolumeclaim.yaml delete mode 100644 HTTPS/certbot-deployment.yaml delete mode 100644 HTTPS/certbot/conf/accounts/acme-v02.api.letsencrypt.org/directory/c969070eddffc3f18a9faeeb772e0d49/meta.json delete mode 100644 HTTPS/certbot/conf/accounts/acme-v02.api.letsencrypt.org/directory/c969070eddffc3f18a9faeeb772e0d49/private_key.json delete mode 100644 HTTPS/certbot/conf/accounts/acme-v02.api.letsencrypt.org/directory/c969070eddffc3f18a9faeeb772e0d49/regr.json delete mode 100644 HTTPS/certbot/conf/csr/0000_csr-certbot.pem delete mode 100644 HTTPS/certbot/conf/csr/0001_csr-certbot.pem delete mode 100644 HTTPS/certbot/conf/keys/0000_key-certbot.pem delete mode 100644 HTTPS/certbot/conf/keys/0001_key-certbot.pem delete mode 100644 HTTPS/docker-compose.yml delete mode 100644 HTTPS/docker-compose.yml.copia create mode 100644 HTTPS/kustomization.yaml create mode 100644 HTTPS/miweb-configmap.yaml create mode 100644 HTTPS/miweb-deployment.yaml create mode 100644 HTTPS/miweb-ingress.yaml create mode 100644 HTTPS/miweb-letsencrypt-certs.yaml create mode 100644 HTTPS/miweb-letsencrypt-job.yaml create mode 100644 HTTPS/miweb-letsencrypt-service.yaml create mode 100644 HTTPS/miweb-service.yaml delete mode 100644 HTTPS/nginx/conf/nginx.conf delete mode 100644 HTTPS/webserver-claim0-persistentvolumeclaim.yaml delete mode 100644 HTTPS/webserver-claim1-persistentvolumeclaim.yaml delete mode 100644 HTTPS/webserver-deployment.yaml delete mode 100644 HTTPS/webserver-service.yaml create mode 100644 HelmCharts/helmSpagoBI.sh create mode 100644 HelmCharts/preparaSpagoBI/bi-namespace.yaml create mode 100644 HelmCharts/preparaSpagoBI/pv-local-mysql.yaml create mode 100644 HelmCharts/preparaSpagoBI/pv-local-spagobi.yaml create mode 100644 HelmCharts/spagobi-chart/.helmignore create mode 100644 HelmCharts/spagobi-chart/Chart.yaml create mode 100644 HelmCharts/spagobi-chart/templates/mysql-deployment.yaml create mode 100644 HelmCharts/spagobi-chart/templates/php-deployment.yaml create mode 100644 HelmCharts/spagobi-chart/templates/registry-secrets.yaml create mode 100644 HelmCharts/spagobi-chart/templates/spagobi-deployment.yaml create mode 100644 HelmCharts/spagobi-chart/templates/spagobi-secrets.yaml create mode 100644 HelmCharts/spagobi-chart/values.yaml diff --git a/Comunes/creaImagenSpagoBI.sh b/Comunes/creaImagenSpagoBI.sh new file mode 100644 index 00000000..14c6d634 --- /dev/null +++ b/Comunes/creaImagenSpagoBI.sh @@ -0,0 +1,3 @@ +docker pull spagobilabs/spagobi:all-in-one +docker tag spagobilabs/spagobi:all-in-one docker-registry:32000/spagobi:1.0 +docker push docker-registry:32000/spagobi:1.0 diff --git a/HTTPS/certbot-claim0-persistentvolumeclaim.yaml b/HTTPS/certbot-claim0-persistentvolumeclaim.yaml deleted file mode 100644 index 15fe9c83..00000000 --- a/HTTPS/certbot-claim0-persistentvolumeclaim.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - creationTimestamp: null - labels: - io.kompose.service: certbot-claim0 - name: certbot-claim0 -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 100Mi -status: {} diff --git a/HTTPS/certbot-claim1-persistentvolumeclaim.yaml b/HTTPS/certbot-claim1-persistentvolumeclaim.yaml deleted file mode 100644 index 8165bd05..00000000 --- a/HTTPS/certbot-claim1-persistentvolumeclaim.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - creationTimestamp: null - labels: - io.kompose.service: certbot-claim1 - name: certbot-claim1 -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 100Mi -status: {} diff --git a/HTTPS/certbot-deployment.yaml b/HTTPS/certbot-deployment.yaml deleted file mode 100644 index bc64b513..00000000 --- a/HTTPS/certbot-deployment.yaml +++ /dev/null @@ -1,44 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - annotations: - kompose.cmd: kompose convert - kompose.version: 1.26.0 (40646f47) - creationTimestamp: null - labels: - io.kompose.service: certbot - name: certbot -spec: - replicas: 1 - selector: - matchLabels: - io.kompose.service: certbot - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert - kompose.version: 1.26.0 (40646f47) - creationTimestamp: null - labels: - io.kompose.service: certbot - spec: - containers: - - image: certbot/certbot:latest - name: certbot - resources: {} - volumeMounts: - - mountPath: /var/www/certbot/ - name: certbot-claim0 - - mountPath: /etc/letsencrypt/ - name: certbot-claim1 - restartPolicy: Always - volumes: - - name: certbot-claim0 - persistentVolumeClaim: - claimName: certbot-claim0 - - name: certbot-claim1 - persistentVolumeClaim: - claimName: certbot-claim1 -status: {} diff --git a/HTTPS/certbot/conf/accounts/acme-v02.api.letsencrypt.org/directory/c969070eddffc3f18a9faeeb772e0d49/meta.json b/HTTPS/certbot/conf/accounts/acme-v02.api.letsencrypt.org/directory/c969070eddffc3f18a9faeeb772e0d49/meta.json deleted file mode 100644 index 95954825..00000000 --- a/HTTPS/certbot/conf/accounts/acme-v02.api.letsencrypt.org/directory/c969070eddffc3f18a9faeeb772e0d49/meta.json +++ /dev/null @@ -1 +0,0 @@ -{"creation_dt": "2023-02-01T09:26:45Z", "creation_host": "f4594feda273"} \ No newline at end of file diff --git a/HTTPS/certbot/conf/accounts/acme-v02.api.letsencrypt.org/directory/c969070eddffc3f18a9faeeb772e0d49/private_key.json b/HTTPS/certbot/conf/accounts/acme-v02.api.letsencrypt.org/directory/c969070eddffc3f18a9faeeb772e0d49/private_key.json deleted file mode 100644 index ae99cf27..00000000 --- a/HTTPS/certbot/conf/accounts/acme-v02.api.letsencrypt.org/directory/c969070eddffc3f18a9faeeb772e0d49/private_key.json +++ /dev/null @@ -1 +0,0 @@ -{"n": "16P-IALymGf5NQxYwovtP6MbSReUJtQrfIFVYZVV5tWy3y3Qf7gjwwjq4Fa9sHrn_KmUvUkBWtikAohOw8SCv-IUakxjTWIHAEIyjU9oK57olnCmdGnYQWza0ffCU69H3piMagG7es2kl4s24E1dHO37cBm8GQ-UH-0xDZ3CsWoGQLY8u9bGocdQbujozGCsaMxRso4SdkBqB3S-sJEwiKZr4iBlXCnvv0YW6t0WlfqVKzpQvU5u4UW7BBWCoxBTY0Ehj20BYsHC31mXh5d4e4Rn_THzBg9IZsKdEjNbMXETMauaW3JisMgONT8htdQUlQz1lHgWPVKi-iW0dFYJfQ", "e": "AQAB", "d": "LzFf-JQEkTeyCbrPwxX6AHMbEdpD7WKCON-aNr7Gu7vZh2_goU8Enpa5RosdPP4M_tYDLBDJ596hOD-qEzySy9k31BKvKdySASu7ogL2npNKvj_dof0XG6xt0EVrhUKHVU8n7bw-0k-mnZbVVe4AeogXvs8XBBoNdhZEJcF4vjg5pvQcK-HIOi9Fs7yUHaTqo-qQgDRBH7TjY8Uq72X--SOWV05iofQ3--riT0GWWgyld3pDgAHsM8zhyOq8XlItbS3tUTYsc4Lw8vrvx2R7aDWtzCP0LC5E1sO0WhnfHHMdaKWSJ2JDhmiJs3zF__iu95yGYIbe8Z0RX2qnVV32uQ", "p": "-hTTf6UEUOkSN4SxHcluGl0kKk7f9plyUpX5gmtZYg6MSXOAj2DkPWOim5ep_-QJdI-rTnAFbEeXVtxfCkVxmmHIPdaC7pjBA23qcdHWMu8JkrHSEM6nzIl0vI2QgXWZCDuZG6-7jjef8MKpfd1urLMkecDwuK34OhZcT1WNnNU", "q": "3L5_3iZNYLEbusaqy4ndlrPcFhSJ6QMc2PBKi3yCmXootVaL_TmQAtOaMkNdd_NO-KaqVNM9ydnJtQt0EVnG-eEqBmL1nl4L92nnbytlU9VPYDbiWQ9STArqd2Wf2kSYz80mYJ1CF4hJbqVAyrO8aj8h2q2SzpnMhqBF-9EYbgk", "dp": "NfXacPdtR_wSdzJFeVTmUf_49rwQLUiM128O6Go7XiIfeRXYDpfsh6aBBquh_dn5hFIft4wKT4PfDtn8E95KFfK1X0py9AK32wKTjL2nR1Q2r5V46zF8GXErZCfzn0t9mr4pWkT_5j7wXuXR5pup7s-0tiTAjEjVf8slXeTq6oU", "dq": "0Sdu4H5KMqOdMouqqNAoNPKWRhWP1kgsvSBwgVmoJOOqTqeCXJx95y-3mohZt53B5beFDHpawTap9_CyOP5nmbvOpd59-2AA1pxxvNPRXm1umCtorBnoUETHg_m2TIlSgRJQmppmVQW9DilmCqnijIjk-t4bi8YOFEEoDkFAdIE", "qi": "ATb2ooVw9dyrJpGbKedTz-NiGYX7n9oypPUKccy7B-UM8OD2ulmRrs2n8IQsY3JYeYfuAF-FXiRQJWIujpBR-Ao3w4eKU1kf-ucyWLyfLAaCM5F7U6cAaGN3jVblefCrLzbEKpbjc6XJtu6nKYEz1af4yQYcTWFTC4hjZwAvgCw", "kty": "RSA"} \ No newline at end of file diff --git a/HTTPS/certbot/conf/accounts/acme-v02.api.letsencrypt.org/directory/c969070eddffc3f18a9faeeb772e0d49/regr.json b/HTTPS/certbot/conf/accounts/acme-v02.api.letsencrypt.org/directory/c969070eddffc3f18a9faeeb772e0d49/regr.json deleted file mode 100644 index 14a94db4..00000000 --- a/HTTPS/certbot/conf/accounts/acme-v02.api.letsencrypt.org/directory/c969070eddffc3f18a9faeeb772e0d49/regr.json +++ /dev/null @@ -1 +0,0 @@ -{"body": {}, "uri": "https://acme-v02.api.letsencrypt.org/acme/acct/943534587"} \ No newline at end of file diff --git a/HTTPS/certbot/conf/csr/0000_csr-certbot.pem b/HTTPS/certbot/conf/csr/0000_csr-certbot.pem deleted file mode 100644 index 0c5c85c1..00000000 --- a/HTTPS/certbot/conf/csr/0000_csr-certbot.pem +++ /dev/null @@ -1,8 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIHvMIGWAgEAMAAwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAATars0S63nlblI4 -2A31mqLGhFOqrLzHl/PjalG02zLr1KsBzA/6gPdtXXZw91TSjmG9tyHaI7naVTla -jHR6VQghoDQwMgYJKoZIhvcNAQkOMSUwIzAhBgNVHREEGjAYghZyZXltb3RhLmRk -bnMubmV0OjMyMDgwMAoGCCqGSM49BAMCA0gAMEUCIQCDczOIb2HG0Ha/iow9h5zo -bPpPRytdP3GgBHlOlyPujgIgB6E44CIy/6FLACPLJGyRSQ6kxRpsLGiCEHtZJSt9 -Vs8= ------END CERTIFICATE REQUEST----- diff --git a/HTTPS/certbot/conf/csr/0001_csr-certbot.pem b/HTTPS/certbot/conf/csr/0001_csr-certbot.pem deleted file mode 100644 index 0393dd8c..00000000 --- a/HTTPS/certbot/conf/csr/0001_csr-certbot.pem +++ /dev/null @@ -1,7 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIHpMIGQAgEAMAAwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAT05+0vm9vlNnsf -wiFQLToVJfmAkmbTpLZNKinXw00EtFAJTGff2gZ638zqcu3hXLknbLVj2n8WqHYA -I9F+SEVLoC4wLAYJKoZIhvcNAQkOMR8wHTAbBgNVHREEFDASghByZXltb3RhLmRk -bnMubmV0MAoGCCqGSM49BAMCA0gAMEUCIHkFY6vSjYUB7lLI4uQPVJiwvTohT7Po -D4AjbG7dx+FhAiEA+msGjSQGcyZBL6RVPFaZw0GHaMgAKWCPcNUt0sUFZdI= ------END CERTIFICATE REQUEST----- diff --git a/HTTPS/certbot/conf/keys/0000_key-certbot.pem b/HTTPS/certbot/conf/keys/0000_key-certbot.pem deleted file mode 100644 index dac3fcba..00000000 --- a/HTTPS/certbot/conf/keys/0000_key-certbot.pem +++ /dev/null @@ -1,5 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgX47hYo5mX70vHNCh -pqXiiET3RBxF7/xnVhzE5TKou0mhRANCAATars0S63nlblI42A31mqLGhFOqrLzH -l/PjalG02zLr1KsBzA/6gPdtXXZw91TSjmG9tyHaI7naVTlajHR6VQgh ------END PRIVATE KEY----- diff --git a/HTTPS/certbot/conf/keys/0001_key-certbot.pem b/HTTPS/certbot/conf/keys/0001_key-certbot.pem deleted file mode 100644 index cdc41cdd..00000000 --- a/HTTPS/certbot/conf/keys/0001_key-certbot.pem +++ /dev/null @@ -1,5 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgU+yxM3TUNGNAUtEF -s1euxemWrCasGvLlDns6/zaZIMChRANCAAT05+0vm9vlNnsfwiFQLToVJfmAkmbT -pLZNKinXw00EtFAJTGff2gZ638zqcu3hXLknbLVj2n8WqHYAI9F+SEVL ------END PRIVATE KEY----- diff --git a/HTTPS/docker-compose.yml b/HTTPS/docker-compose.yml deleted file mode 100644 index 70e6bbfc..00000000 --- a/HTTPS/docker-compose.yml +++ /dev/null @@ -1,17 +0,0 @@ -version: '3' - -services: - webserver: - image: nginx:latest - ports: - - 80:80 - - 443:443 - restart: always - volumes: - - /mnt/cluster/miweb/conf:/etc/nginx/conf.d/:ro - - /mnt/cluster/miweb/www:/var/www/certbot/:ro - certbot: - image: certbot/certbot:latest - volumes: - - /mnt/cluster/miweb/certbot/www/:/var/www/certbot/:rw - - /mnt/cluster/miweb/certbot/conf/:/etc/letsencrypt/:rw diff --git a/HTTPS/docker-compose.yml.copia b/HTTPS/docker-compose.yml.copia deleted file mode 100644 index 133cb426..00000000 --- a/HTTPS/docker-compose.yml.copia +++ /dev/null @@ -1,17 +0,0 @@ -version: '3' - -services: - webserver: - image: nginx:latest - ports: - - 80:80 - - 443:443 - restart: always - volumes: - - ./nginx/conf:/etc/nginx/conf.d/:ro - - ./certbot/www:/var/www/certbot/:ro - certbot: - image: certbot/certbot:latest - volumes: - - ./certbot/www/:/var/www/certbot/:rw - - ./certbot/conf/:/etc/letsencrypt/:rw diff --git a/HTTPS/kustomization.yaml b/HTTPS/kustomization.yaml new file mode 100644 index 00000000..8b53e970 --- /dev/null +++ b/HTTPS/kustomization.yaml @@ -0,0 +1,8 @@ +resources: + - miweb-configmap.yaml + - miweb-deployment.yaml + - miweb-service.yaml + - miweb-ingress.yaml + - miweb-letsencrypt-job.yaml + - miweb-letsencrypt-service.yaml + - miweb-letsencrypt-certs.yaml diff --git a/HTTPS/miweb-configmap.yaml b/HTTPS/miweb-configmap.yaml new file mode 100644 index 00000000..90cb2dca --- /dev/null +++ b/HTTPS/miweb-configmap.yaml @@ -0,0 +1,23 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: nginx-config +data: + default.conf: | + upstream letsencrypt { + server letsencrypt:80 max_fails=0 fail_timeout=1s; + } + + server { + listen 80; + listen [::]:80; + server_name _; + location / { + add_header Content-Type text/plain; # Prevents download + return 200 "¡Hola mundo! Demo de Kubernetes + Let's encrypt."; + } + # Redirect all traffic in /.well-known/ to letsencrypt + location ^~ /.well-known/acme-challenge/ { + proxy_pass http://letsencrypt; + } + } diff --git a/HTTPS/miweb-deployment.yaml b/HTTPS/miweb-deployment.yaml new file mode 100644 index 00000000..3d741c03 --- /dev/null +++ b/HTTPS/miweb-deployment.yaml @@ -0,0 +1,29 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: nginx + name: nginx +spec: + selector: + matchLabels: + app: nginx + replicas: 1 + template: + metadata: + labels: + app: nginx + spec: + containers: + - name: nginx + image: nginx + ports: + - containerPort: 80 + volumeMounts: + - name: nginx-configs + mountPath: /etc/nginx/conf.d + # Load the configuration files for nginx + volumes: + - name: nginx-configs + configMap: + name: nginx-config diff --git a/HTTPS/miweb-ingress.yaml b/HTTPS/miweb-ingress.yaml new file mode 100644 index 00000000..786a8352 --- /dev/null +++ b/HTTPS/miweb-ingress.yaml @@ -0,0 +1,21 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: "kubernetes-demo-app-ingress-service" +spec: + tls: + - hosts: + - reymota.ddns.net + secretName: letsencrypt-certs + rules: + - host: reymota.ddns.net # CHANGE ME! + http: + paths: + # The * is needed so that all traffic gets redirected to nginx + - path: /* + pathType: Prefix + backend: + service: + name: nginx + port: + number: 80 diff --git a/HTTPS/miweb-letsencrypt-certs.yaml b/HTTPS/miweb-letsencrypt-certs.yaml new file mode 100644 index 00000000..a57c3933 --- /dev/null +++ b/HTTPS/miweb-letsencrypt-certs.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: Secret +metadata: + name: letsencrypt-certs +type: Opaque +# Create an empty secret (with no data) in order for the update to work diff --git a/HTTPS/miweb-letsencrypt-job.yaml b/HTTPS/miweb-letsencrypt-job.yaml new file mode 100644 index 00000000..24c3eb23 --- /dev/null +++ b/HTTPS/miweb-letsencrypt-job.yaml @@ -0,0 +1,30 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: letsencrypt-job + labels: + app: letsencrypt +spec: + template: + metadata: + name: letsencrypt + labels: + app: letsencrypt + spec: + containers: + # Bash script that starts an http server and launches certbot + # Fork of github.com/sjenning/kube-nginx-letsencrypt + - image: quay.io/hiphipjorge/kube-nginx-letsencrypt:latest + name: letsencrypt + imagePullPolicy: Always + ports: + - name: letsencrypt + containerPort: 80 + env: + - name: DOMAINS + value: reymota.ddns.net # Domain you want to use. CHANGE ME! + - name: EMAIL + value: king.bernard.b@gmail.com # Your email. CHANGE ME! + - name: SECRET + value: letsencrypt-certs + restartPolicy: Never diff --git a/HTTPS/miweb-letsencrypt-service.yaml b/HTTPS/miweb-letsencrypt-service.yaml new file mode 100644 index 00000000..fc050223 --- /dev/null +++ b/HTTPS/miweb-letsencrypt-service.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Service +metadata: + name: letsencrypt +spec: + selector: + app: letsencrypt + ports: + - protocol: "TCP" + port: 80 diff --git a/HTTPS/miweb-service.yaml b/HTTPS/miweb-service.yaml new file mode 100644 index 00000000..aaa56f53 --- /dev/null +++ b/HTTPS/miweb-service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: nginx +spec: + selector: + app: nginx + type: NodePort + ports: + - protocol: "TCP" + nodePort: 30080 + port: 80 diff --git a/HTTPS/nginx/conf/nginx.conf b/HTTPS/nginx/conf/nginx.conf deleted file mode 100644 index 2db9e368..00000000 --- a/HTTPS/nginx/conf/nginx.conf +++ /dev/null @@ -1,15 +0,0 @@ -server { - listen 80; - listen [::]:80; - - server_name reymota.ddns.net; - server_tokens off; - - location /.well-known/acme-challenge/ { - root /var/www/certbot; - } - - location / { - return 301 https://reymota.ddns.net:30080$request_uri; - } -} diff --git a/HTTPS/webserver-claim0-persistentvolumeclaim.yaml b/HTTPS/webserver-claim0-persistentvolumeclaim.yaml deleted file mode 100644 index c89090c9..00000000 --- a/HTTPS/webserver-claim0-persistentvolumeclaim.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - creationTimestamp: null - labels: - io.kompose.service: webserver-claim0 - name: webserver-claim0 -spec: - accessModes: - - ReadOnlyMany - resources: - requests: - storage: 100Mi -status: {} diff --git a/HTTPS/webserver-claim1-persistentvolumeclaim.yaml b/HTTPS/webserver-claim1-persistentvolumeclaim.yaml deleted file mode 100644 index 1ed477b4..00000000 --- a/HTTPS/webserver-claim1-persistentvolumeclaim.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - creationTimestamp: null - labels: - io.kompose.service: webserver-claim1 - name: webserver-claim1 -spec: - accessModes: - - ReadOnlyMany - resources: - requests: - storage: 100Mi -status: {} diff --git a/HTTPS/webserver-deployment.yaml b/HTTPS/webserver-deployment.yaml deleted file mode 100644 index 6ab7ee3c..00000000 --- a/HTTPS/webserver-deployment.yaml +++ /dev/null @@ -1,51 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - annotations: - kompose.cmd: kompose convert - kompose.version: 1.26.0 (40646f47) - creationTimestamp: null - labels: - io.kompose.service: webserver - name: webserver -spec: - replicas: 1 - selector: - matchLabels: - io.kompose.service: webserver - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert - kompose.version: 1.26.0 (40646f47) - creationTimestamp: null - labels: - io.kompose.service: webserver - spec: - containers: - - image: nginx:latest - name: webserver - ports: - - containerPort: 80 - - containerPort: 443 - resources: {} - volumeMounts: - - mountPath: /etc/nginx/conf.d/ - name: webserver-claim0 - readOnly: true - - mountPath: /var/www/certbot/ - name: webserver-claim1 - readOnly: true - restartPolicy: Always - volumes: - - name: webserver-claim0 - persistentVolumeClaim: - claimName: webserver-claim0 - readOnly: true - - name: webserver-claim1 - persistentVolumeClaim: - claimName: webserver-claim1 - readOnly: true -status: {} diff --git a/HTTPS/webserver-service.yaml b/HTTPS/webserver-service.yaml deleted file mode 100644 index 13a71812..00000000 --- a/HTTPS/webserver-service.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - annotations: - kompose.cmd: kompose convert - kompose.version: 1.26.0 (40646f47) - creationTimestamp: null - labels: - io.kompose.service: webserver - name: webserver -spec: - ports: - - name: "80" - port: 80 - targetPort: 80 - - name: "443" - port: 443 - targetPort: 443 - selector: - io.kompose.service: webserver -status: - loadBalancer: {} diff --git a/HelmCharts/helmSpagoBI.sh b/HelmCharts/helmSpagoBI.sh new file mode 100644 index 00000000..864ea23c --- /dev/null +++ b/HelmCharts/helmSpagoBI.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +if [ "$1" = "i" ] +then + kubectl apply -f ./preparaSpagoBI/bi-namespace.yaml + kubectl apply -f ./preparaSpagoBI/pv-local-mysql.yaml + kubectl apply -f ./preparaSpagoBI/pv-local-spagobi.yaml + helm install spagobi spagobi-chart/ +else + helm uninstall spagobi + kubectl delete -f ./preparaSpagoBI/bi-namespace.yaml + kubectl delete -f ./preparaSpagoBI/pv-local-mysql.yaml + kubectl delete -f ./preparaSpagoBI/pv-local-spagobi.yaml +fi diff --git a/HelmCharts/preparaSpagoBI/bi-namespace.yaml b/HelmCharts/preparaSpagoBI/bi-namespace.yaml new file mode 100644 index 00000000..2719088a --- /dev/null +++ b/HelmCharts/preparaSpagoBI/bi-namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: spagobi diff --git a/HelmCharts/preparaSpagoBI/pv-local-mysql.yaml b/HelmCharts/preparaSpagoBI/pv-local-mysql.yaml new file mode 100644 index 00000000..ed3fbf31 --- /dev/null +++ b/HelmCharts/preparaSpagoBI/pv-local-mysql.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: bi-data +spec: + capacity: + storage: 20Gi + accessModes: + - ReadWriteOnce + hostPath: + path: "/mnt/Externo/spagobi/spagobi-db" diff --git a/HelmCharts/preparaSpagoBI/pv-local-spagobi.yaml b/HelmCharts/preparaSpagoBI/pv-local-spagobi.yaml new file mode 100644 index 00000000..63f6a5ef --- /dev/null +++ b/HelmCharts/preparaSpagoBI/pv-local-spagobi.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: bi-folder +spec: + capacity: + storage: 10Gi + accessModes: + - ReadWriteOnce + hostPath: + path: "/mnt/Externo/spagobi/spagobi-bi" + diff --git a/HelmCharts/spagobi-chart/.helmignore b/HelmCharts/spagobi-chart/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/HelmCharts/spagobi-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/spagobi-chart/Chart.yaml b/HelmCharts/spagobi-chart/Chart.yaml new file mode 100644 index 00000000..39f32ff9 --- /dev/null +++ b/HelmCharts/spagobi-chart/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: spagobi-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/spagobi-chart/templates/mysql-deployment.yaml b/HelmCharts/spagobi-chart/templates/mysql-deployment.yaml new file mode 100644 index 00000000..95b5c5ad --- /dev/null +++ b/HelmCharts/spagobi-chart/templates/mysql-deployment.yaml @@ -0,0 +1,82 @@ +apiVersion: v1 +kind: Service +metadata: + name: spagobi-mysql + namespace: spagobi + labels: + app: spagobi +spec: + ports: + - port: 3306 + selector: + app: spagobi + tier: mysql + clusterIP: None +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: mysql-bi-pv-claim + namespace: spagobi + labels: + app: spagobi +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 20Gi +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: spagobi-mysql + namespace: spagobi + labels: + app: spagobi +spec: + selector: + matchLabels: + app: spagobi + tier: mysql + strategy: + type: Recreate + template: + metadata: + labels: + app: spagobi + tier: mysql + spec: + containers: + - image: docker-registry:32000/mariadb:1.0 + name: mysql + env: + - name: MYSQL_USER + valueFrom: + secretKeyRef: + name: mysqlbi-pass + key: db_user + - name: MYSQL_PASSWORD + valueFrom: + secretKeyRef: + name: mysqlbi-pass + key: db_pass + - name: MYSQL_ROOT_PASSWORD + valueFrom: + secretKeyRef: + name: mysqlbi-pass + key: db_root_pass + - name: MYSQL_DATABASE + value: spagobi + 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-bi-pv-claim diff --git a/HelmCharts/spagobi-chart/templates/php-deployment.yaml b/HelmCharts/spagobi-chart/templates/php-deployment.yaml new file mode 100644 index 00000000..d456e9ea --- /dev/null +++ b/HelmCharts/spagobi-chart/templates/php-deployment.yaml @@ -0,0 +1,56 @@ +apiVersion: v1 +kind: Service +metadata: + name: phpmyadmin-spagobi + namespace: spagobi + labels: + app: spagobi +spec: + selector: + app: spagobi + tier: phpmyadmin + type: NodePort + ports: + - name: phpadmin + port: 80 + nodePort: 30680 + targetPort: phpmyadm +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: phpmyadmin-spagobi + namespace: spagobi + labels: + app: spagobi +spec: + selector: + matchLabels: + app: spagobi + tier: phpmyadmin + strategy: + type: Recreate + template: + metadata: + labels: + app: spagobi + tier: phpmyadmin + spec: + containers: + - name: phpmyadmin + image: docker-registry:32000/phpmyadmin:1.0 + ports: + - containerPort: 80 + name: phpmyadm + env: + - name: PMA_HOST + value: spagobi-mysql + - name: PMA_PORT + value: "3306" + - name: MYSQL_ROOT_PASSWORD + valueFrom: + secretKeyRef: + name: mysqlbi-pass + key: password + imagePullSecrets: + - name: reg-cred-secret diff --git a/HelmCharts/spagobi-chart/templates/registry-secrets.yaml b/HelmCharts/spagobi-chart/templates/registry-secrets.yaml new file mode 100644 index 00000000..a42bbeeb --- /dev/null +++ b/HelmCharts/spagobi-chart/templates/registry-secrets.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +data: + .dockerconfigjson: eyJhdXRocyI6eyJkb2NrZXItcmVnaXN0cnk6MzIwMDAiOnsidXNlcm5hbWUiOiJjcmV5bG9wZXoiLCJwYXNzd29yZCI6IlJleS0xMTc2IiwiYXV0aCI6IlkzSmxlV3h2Y0dWNk9sSmxlUzB4TVRjMiJ9fX0= +kind: Secret +metadata: + creationTimestamp: "2023-01-29T10:54:14Z" + name: reg-cred-secret + namespace: spagobi + resourceVersion: "19890385" + uid: 66b3b7c5-26c1-4e5a-af4e-dc973aaafe4b +type: kubernetes.io/dockerconfigjson diff --git a/HelmCharts/spagobi-chart/templates/spagobi-deployment.yaml b/HelmCharts/spagobi-chart/templates/spagobi-deployment.yaml new file mode 100644 index 00000000..29c64910 --- /dev/null +++ b/HelmCharts/spagobi-chart/templates/spagobi-deployment.yaml @@ -0,0 +1,84 @@ +apiVersion: v1 +kind: Service +metadata: + name: spagobi + namespace: spagobi + labels: + app: spagobi +spec: + type: NodePort + ports: + - port: 8080 + nodePort: 30188 + targetPort: spagobi + selector: + app: spagobi + tier: frontend +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: bi-pv-claim + namespace: spagobi + labels: + app: spagobi +spec: + accessModes: + - ReadWriteOnce + storageClassName: "" + resources: + requests: + storage: 10Gi +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: spagobi + namespace: spagobi + labels: + app: spagobi +spec: + selector: + matchLabels: + app: spagobi + tier: frontend + strategy: + type: Recreate + template: + metadata: + labels: + app: spagobi + tier: frontend + spec: + containers: + - image: docker-registry:32000/spagobi:1.0 + name: spagobi + env: + - name: DB_ENV_MYSQL_USER + valueFrom: + secretKeyRef: + name: mysqlbi-pass + key: db_user + - name: DB_ENV_MYSQL_PASSWORD + valueFrom: + secretKeyRef: + name: mysqlbi-pass + key: db_pass + - name: DB_ENV_MYSQL_DATABASE + value: spagobi + - name: DB_PORT_3306_TCP_ADDR + value: spagobi-mysql + - name: DB_PORT_3306_TCP_PORT + value: "3306" + ports: + - containerPort: 8080 + name: spagobi + #volumeMounts: + #- name: spagobi-persistent-storage + #mountPath: /var/www/html + imagePullSecrets: + - name: reg-cred-secret + volumes: + - name: spagobi-persistent-storage + persistentVolumeClaim: + claimName: bi-pv-claim diff --git a/HelmCharts/spagobi-chart/templates/spagobi-secrets.yaml b/HelmCharts/spagobi-chart/templates/spagobi-secrets.yaml new file mode 100644 index 00000000..589c3afb --- /dev/null +++ b/HelmCharts/spagobi-chart/templates/spagobi-secrets.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Secret +metadata: + name: mysqlbi-pass + namespace: spagobi +data: + password: RHNhLTAyMTM= + db_user: cm9vdA== + db_pass: RHNhLTAyMTM= + db_root_pass: RHNhLTAyMTM= diff --git a/HelmCharts/spagobi-chart/values.yaml b/HelmCharts/spagobi-chart/values.yaml new file mode 100644 index 00000000..06692eed --- /dev/null +++ b/HelmCharts/spagobi-chart/values.yaml @@ -0,0 +1,82 @@ +# Default values for wordpress-chart. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: docker-registry:32000 + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [reg-cred-secret] +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: NodePort + 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: {}