Skip to content

Commit

Permalink
Updated portalmodelo chart
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiorauber committed Oct 22, 2024
1 parent 192e829 commit 86362e7
Show file tree
Hide file tree
Showing 20 changed files with 1,165 additions and 281 deletions.
11 changes: 6 additions & 5 deletions charts/portalmodelo/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apiVersion: v1
appVersion: "3.0-21"
description: Portal Modelo para Casas Legislativas
apiVersion: v2
name: portalmodelo
icon: https://raw.githubusercontent.com/interlegis/il-charts/master/images/portalmodelo.png
version: 0.4.3
description: Portal Modelo para Casas Legislativas
type: application
version: 0.5.0
appVersion: 3.0-21
icon: https://git.interlegis.leg.br/SEIT/rancher-charts/raw/5a821368fe0244ae9017878dd2aae3173328816c/images/portalmodelo.png
28 changes: 0 additions & 28 deletions charts/portalmodelo/README.md

This file was deleted.

247 changes: 247 additions & 0 deletions charts/portalmodelo/questions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,247 @@
labels:
io.cattle.role: project
categories:
- CMS
questions:
# Informações Básicas
- variable: portal.title
default: "Câmara Municipal"
description: "Título na página inicial do Portal (imutável)"
label: Título
type: enum
options:
- "Câmara Municipal"
- "Assembleia Legislativa"
- "Tribunal de Contas"
- "Congresso Nacional"
group: Básico
required: true
- variable: portal.description
default: "Cidade - UF"
description: "Descrição na página incial do Portal (imutável)"
label: Descrição
type: string
group: Básico
required: true
- variable: portal.adminEmail
default: "[email protected]"
description: "E-mail do contato do Portal (imutável)"
label: Contato
type: string
group: Básico
required: true
- variable: portal.hostname
default: "teste.df.leg.br"
description: "URL de acesso do Portal"
label: Hostname
type: string
group: Básico
required: true
- variable: portal.hostprefix
default: "www"
description: "Prefixo da URL do Portal"
label: Prefixo do Host
type: string
group: Básico
required: false
- variable: portal.addprefix
default: ""
description: "Prefixo adicional para a URL do Portal (opcional)"
label: Prefixo adicional do Host
type: string
group: Básico
required: false
- variable: portal.rootPassword
default: "altereme"
description: "Senha de Admin do Zope (raiz, imutável)"
label: Senha Admin
type: password
group: Básico
required: true
- variable: portal.adminPassword
default: "altereme"
description: "Senha do usuário adm do Plone (imutável)"
label: Senha Adm
type: password
group: Básico
required: true

# Ingress
- variable: ingress.tls.enabled
default: true
type: boolean
description: "Habilitar criptografia do protocolo HTTP (HTTPS)?"
label: "Habilitar TLS?"
required: false
group: Ingress
show_subquestion_if: true
subquestions:
- variable: ingress.tls.provider
default: letsencrypt
type: enum
description: "Qual provedor de certificados utilizar?"
label: "Provedor de certificados"
required: false
group: Ingress
options:
- letsencrypt
- aws

- variable: ingress.class
default: nginx
type: enum
description: "Qual o Ingress Controller?"
label: "Classe Ingress"
required: false
group: Ingress
options:
- nginx
- alb

- variable: ingress.vhostmonster
default: true
type: boolean
description: "Habilitar reescrita de URL para o VirtualHostMonster no Ingress?"
label: "VHostMonster no Ingress"
required: true
group: Ingress

# Configurações de Armazenamento
- variable: persistence.accessMode
default: ReadWriteOnce
type: enum
label: "Modo de acesso do volume (imutável)"
description: "ReadWriteOnce para volumes de bloco, ReadWriteMany para volumes de arquivo (NFS)."
options:
- "ReadWriteOnce"
- "ReadWriteMany"
required: true
group: Armazenamento
- variable: persistence.size
default: 2Gi
type: string
required: false
label: "Tamanho do volume"
description: "Espaço em disco disponível para o portal."
group: Armazenamento
- variable: velero.backup.enabled
default: true
type: boolean
label: "Habilitar backup com Velero?"
description: "Criar ou não os objetos para backup com o Velero."
required: false
group: Armazenamento
- variable: repozo.enabled
default: false
type: boolean
label: "Habilitar backup com Repozo?"
description: "Habilitar ou não backup com repozo em volumes NFS."
required: false
group: Armazenamento
show_subquestion_if: true
subquestions:
- variable: repozo.storageClass
default: nfs-backup
type: string
description: "StorageClass na qual criar os volumes para backup."
label: "StorageClass do Backup"
required: false
- variable: repozo.keep
default: 1
type: int
label: "Backups a guardar"
description: "Número de backups full que o repozo deve guardar."
required: false
- variable: repozo.keepblobdays
default: 30
type: int
label: "Número de dias de backups de blobs a guardar."
description: "Recomendado utilizar a fórmula 'keep * days_between_zeopack = keep_blob_days'."
required: false
- variable: repozo.backupblobs
default: false
type: boolean
label: "Backup Blobs"
description: "Fazer ou não o backup dos blobs com o repozo."
required: false

# Configurações Avançadas
- variable: portal.timeZone
default: "America/Sao_Paulo"
description: "Fuso Horário do Portal"
type: enum
label: "Fuso"
options:
- "America/Sao_Paulo"
- "America/Fortaleza"
- "America/Belem"
- "America/Araguaina"
- "America/Bahia"
- "America/Boa_Vista"
- "America/Campo_Grande"
- "America/Cuiaba"
- "America/Maceio"
- "America/Manaus"
- "America/Porto_Velho"
- "America/Recife"
- "America/Rio_Branco"
- "America/Sao_Paulo"
required: true
group: Avançado

- variable: portal.createAndUpgrade
default: true
type: boolean
description: "Habilita o configurador/atualizador de Portais?"
label: "Criar e Atualizar"
required: false
group: Avançado

- variable: portal.zopefolder
default: "/"
type: string
description: "Diretório no Zope onde está armazenado o portal. Precisa terminar com barra '/'."
label: "Zope Folder"
required: false
group: Avançado

- variable: instance.zeoclient
default: true
type: boolean
description: "Separar ZEO Server e Cliente?"
label: "Cliente ZEO?"
required: false
group: Avançado

- variable: instance.zodbCacheSize
default: 1000
description: "Tamanho do Cache do ZODB (em número de objetos)"
type: int
label: "ZODB Cache"
required: false
group: Avançado

- variable: instance.zeopack.enabled
default: true
type: boolean
description: "Habilitar o Pack periódico do ZODB?"
label: "ZEO Pack?"
required: false
group: Avançado

- variable: instance.zeopack.schedule
default: "0 1 * * SUN"
type: string
description: "Agendamento do ZEO Pack (String do Cron)"
label: "ZEO Pack Cron"
required: false
group: Avançado

- variable: instance.zeopack.keepDays
default: 30
type: int
description: "Dias de operações a manter após o Pack do ZODB"
label: "ZEO Pack Keep Days"
required: false
group: Avançado

20 changes: 4 additions & 16 deletions charts/portalmodelo/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
1. Seu Portal Modelo pode ser acessado através da URL:
{{- if .Values.ingress.enabled }}
{{- range .Values.ingress.hosts }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "portalmodelo.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get svc -w {{ template "portalmodelo.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "portalmodelo.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "portalmodelo.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl port-forward $POD_NAME 8080:80
http{{ if .Values.ingress.tls.enabled }}s{{ end }}://{{ .Values.portal.hostprefix }}.{{ .Values.portal.hostname }}
{{- end }}
2. Utilize as seguintes credenciais para acesso inicial:
Usuario: adm
Senha: {{ .Values.portal.adminPassword }}
3. Usuario de administração do Zope:
Usuario: admin
Senha: {{ .Values.portal.rootPassword }}
58 changes: 43 additions & 15 deletions charts/portalmodelo/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,58 @@
Expand the name of the chart.
*/}}
{{- define "portalmodelo.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "portalmodelo.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "portalmodelo.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "portalmodelo.labels" -}}
helm.sh/chart: {{ include "portalmodelo.chart" . }}
app.kubernetes.io/name: {{ include "portalmodelo.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "portalmodelo.ploneSelectorLabels" -}}
app.kubernetes.io/name: {{ include "portalmodelo.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: plone
{{- end }}

{{- define "portalmodelo.zeoserverSelectorLabels" -}}
app.kubernetes.io/name: {{ include "portalmodelo.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: zeoserver
{{- end }}
Loading

0 comments on commit 86362e7

Please sign in to comment.