diff --git a/charts/edemocracia/v0.1.12/.helmignore b/charts/edemocracia/v0.1.12/.helmignore new file mode 100755 index 0000000..0e8a0eb --- /dev/null +++ b/charts/edemocracia/v0.1.12/.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/charts/edemocracia/v0.1.12/Chart.lock b/charts/edemocracia/v0.1.12/Chart.lock new file mode 100755 index 0000000..e2e7d86 --- /dev/null +++ b/charts/edemocracia/v0.1.12/Chart.lock @@ -0,0 +1,9 @@ +dependencies: +- name: postgresql + repository: https://charts.bitnami.com/bitnami + version: 8.6.13 +- name: redis + repository: https://charts.bitnami.com/bitnami + version: 10.6.3 +digest: sha256:988f8160c4bd6ea76a95e38d6ee19b07676affd51e6b05bc0e2ce29f488e8c9a +generated: "2020-04-07T14:22:09.711759-03:00" diff --git a/charts/edemocracia/v0.1.12/Chart.yaml b/charts/edemocracia/v0.1.12/Chart.yaml new file mode 100755 index 0000000..d8db2fc --- /dev/null +++ b/charts/edemocracia/v0.1.12/Chart.yaml @@ -0,0 +1,33 @@ +apiVersion: v2 +name: edemocracia +description: Portal que visa ampliar a participação social no processo legislativo e aproximar cidadãos e seus representantes por meio da interação digital. + +# 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. +version: 0.1.12 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. +appVersion: 1.3.3 + +icon: https://git.interlegis.leg.br/SEIT/rancher-charts/raw/master/images/edemocracia.png + + +# Dependencies +dependencies: +- name: postgresql + version: 8.6.13 + repository: https://charts.bitnami.com/bitnami +- name: redis + version: 10.6.3 + repository: https://charts.bitnami.com/bitnami diff --git a/charts/edemocracia/v0.1.12/app-readme.md b/charts/edemocracia/v0.1.12/app-readme.md new file mode 100755 index 0000000..ccc1cbc --- /dev/null +++ b/charts/edemocracia/v0.1.12/app-readme.md @@ -0,0 +1,3 @@ +# Sistema de participação popular para Casas Legislativas + +Utilize o formulário abaixo para configurar seu E-democracia. diff --git a/charts/edemocracia/v0.1.12/charts/postgresql-8.6.13.tgz b/charts/edemocracia/v0.1.12/charts/postgresql-8.6.13.tgz new file mode 100755 index 0000000..08f5aa9 Binary files /dev/null and b/charts/edemocracia/v0.1.12/charts/postgresql-8.6.13.tgz differ diff --git a/charts/edemocracia/v0.1.12/charts/redis-10.6.3.tgz b/charts/edemocracia/v0.1.12/charts/redis-10.6.3.tgz new file mode 100755 index 0000000..9b00dec Binary files /dev/null and b/charts/edemocracia/v0.1.12/charts/redis-10.6.3.tgz differ diff --git a/charts/edemocracia/v0.1.12/questions.yaml b/charts/edemocracia/v0.1.12/questions.yaml new file mode 100755 index 0000000..4454f72 --- /dev/null +++ b/charts/edemocracia/v0.1.12/questions.yaml @@ -0,0 +1,182 @@ +labels: + io.cattle.role: project +categories: +- Participação Popular +questions: +# Informações Básicas +- variable: edemocracia.siteName + default: "Câmara Municipal de Teste" + description: "Título que aparece no E-democracia" + label: "Nome do Site" + type: string + group: Básico + required: true +- variable: edemocracia.hostname + default: "edemocracia.teste.df.leg.br" + description: "Endereço para acesso ao E-democracia" + label: "URL do SAPL" + type: string + group: Básico + required: true +- variable: edemocracia.admin.email + default: "contato@admin.email" + description: "E-mail de contato do E-democracia" + label: Contato + type: string + group: Básico + required: true +- variable: edemocracia.admin.password + default: "altereme" + description: "Senha de administrador do E-democracia" + label: Senha admin + type: password + group: Básico + required: true + +# Recaptcha +- variable: edemocracia.recaptcha.privateKey + default: "altereme" + description: "Chave privada do Recaptcha" + label: Recaptcha PrivateKey + type: string + group: Recaptcha + required: true +- variable: edemocracia.recaptcha.siteKey + default: "altereme" + description: "Chave de site do Recaptcha" + label: Recaptcha SiteKey + type: string + group: Recaptcha + required: true + +# Login Social +- variable: edemocracia.socialAuth.facebook.key + default: "" + description: "Chave da autenticação via Facebook" + label: Facebook Key + type: string + group: Login Social + required: false +- variable: edemocracia.socialAuth.facebook.secret + default: "" + description: "Segredo da autenticação via Facebook" + label: Facebook Secret + type: string + group: Login Social + required: false +- variable: edemocracia.socialAuth.google.key + default: "" + description: "Chave da autenticação via Google" + label: Google Key + type: string + group: Login Social + required: false +- variable: edemocracia.socialAuth.google.secret + default: "" + description: "Segredo da autenticação via Google" + label: Google Secret + type: string + group: Login Social + required: false + +# Correio +- variable: smtp.host + default: "smtp.interlegis.leg.br" + description: "Servidor de envio de e-mail (SMTP)" + label: "Servidor SMTP" + type: string + group: Correio + required: false +- variable: smtp.port + default: 25 + description: "Porta de envio de E-mail (SMTP)" + type: int + label: "Porta SMTP" + required: false + group: Correio +- variable: smtp.tls + default: "False" + description: "Usar TLS ao conectar no servidor SMTP?" + label: "Usar TLS" + type: enum + group: Correio + options: + - "True" + - "False" + required: false +- variable: smtp.username + default: "" + description: "Nome de usuário para envio SMTP (vazio para nenhum)" + label: "SMTP Username" + required: false + group: Correio + type: string +- variable: smtp.password + default: "" + description: "Senha para envio SMTP (vazio para nenhuma)" + label: "SMTP Password" + required: false + group: Correio + type: string + +# PostgreSQL +- variable: postgresql.postgresqlPassword + default: "altereme" + description: "Senha do banco de dados Postgres" + label: "Senha do Postgres" + type: password + group: PostgreSQL + required: true + +# Avançado +- variable: edemocracia.timeZone + default: "America/Sao_Paulo" + description: "Fuso Horário do E-democracia" + 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: edemocracia.apikey + default: "uma_chave_de_api_secreta_mesmo" + description: "Chave de API do E-democracia" + type: string + label: "Chave de API" + required: true + group: Avançado + +- variable: discourse.enabled + default: true + description: "Habilitar o discourse (Expressão)?" + label: "Usar o Discourse?" + type: boolean + group: Avançado + +- variable: wikilegis.enabled + default: true + description: "Habilitar o Wikilegis?" + label: "Usar o Wikilegis?" + type: boolean + group: Avançado + +- variable: audiencias.enabled + default: true + description: "Habilitar o Audiências Interativas?" + label: "Usar o Audiências?" + type: boolean + group: Avançado diff --git a/charts/edemocracia/v0.1.12/templates/NOTES.txt b/charts/edemocracia/v0.1.12/templates/NOTES.txt new file mode 100755 index 0000000..70391fd --- /dev/null +++ b/charts/edemocracia/v0.1.12/templates/NOTES.txt @@ -0,0 +1,19 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }} +{{- end }} +{{- else if contains "NodePort" .Values.nginx.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "edemocracia.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.nginx.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 --namespace {{ .Release.Namespace }} svc -w {{ include "edemocracia.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "edemocracia.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.nginx.service.port }} +{{- else if contains "ClusterIP" .Values.nginx.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "edemocracia.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 +{{- end }} diff --git a/charts/edemocracia/v0.1.12/templates/_helpers.tpl b/charts/edemocracia/v0.1.12/templates/_helpers.tpl new file mode 100755 index 0000000..f4122fe --- /dev/null +++ b/charts/edemocracia/v0.1.12/templates/_helpers.tpl @@ -0,0 +1,79 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "edemocracia.name" -}} +{{- 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 "edemocracia.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 -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "edemocracia.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "edemocracia.labels" -}} +helm.sh/chart: {{ include "edemocracia.chart" . }} +{{ include "edemocracia.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Selector labels +*/}} +{{- define "edemocracia.selectorLabels" -}} +app.kubernetes.io/name: {{ include "edemocracia.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "edemocracia.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "edemocracia.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} + +{{/* +Create a default fully qualified app name for postgresql. +*/}} +{{- define "postgresql.fullname" -}} +{{- printf "%s-%s" .Release.Name "postgresql" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name for redis. +*/}} +{{- define "redis.fullname" -}} +{{- printf "%s-%s" .Release.Name "redis" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + + diff --git a/charts/edemocracia/v0.1.12/templates/audiencias-pvc.yaml b/charts/edemocracia/v0.1.12/templates/audiencias-pvc.yaml new file mode 100755 index 0000000..ae75435 --- /dev/null +++ b/charts/edemocracia/v0.1.12/templates/audiencias-pvc.yaml @@ -0,0 +1,19 @@ +{{- if .Values.audiencias.enabled }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "edemocracia.fullname" . }}-audiencias +spec: + accessModes: + - {{ .Values.audiencias.persistence.accessMode }} + resources: + requests: + storage: {{ .Values.audiencias.persistence.size }} +{{- if .Values.audiencias.persistence.storageClass }} +{{- if (eq "-" .Values.audiencias.persistence.storageClass) }} + storageClassName: "" +{{- else }} + storageClassName: "{{ .Values.audiencias.persistence.storageClass }}" +{{- end }} +{{- end }} +{{- end }} diff --git a/charts/edemocracia/v0.1.12/templates/audienciasweb-deployment.yaml b/charts/edemocracia/v0.1.12/templates/audienciasweb-deployment.yaml new file mode 100755 index 0000000..7d0f440 --- /dev/null +++ b/charts/edemocracia/v0.1.12/templates/audienciasweb-deployment.yaml @@ -0,0 +1,147 @@ +{{- if .Values.audiencias.enabled }} +{{- $edemoUrl := .Values.edemocracia.hostname -}} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "edemocracia.fullname" . }}-audienciasweb + labels: + {{- include "edemocracia.labels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-audienciasweb +spec: + selector: + matchLabels: + {{- include "edemocracia.selectorLabels" . | nindent 6 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-audienciasweb + app.kubernetes.io/component: audiencias + strategy: + type: Recreate + template: + metadata: + labels: + {{- include "edemocracia.selectorLabels" . | nindent 8 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-audienciasweb + app.kubernetes.io/component: audiencias + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + containers: + - name: {{ include "edemocracia.fullname" . }}-audienciasweb + image: "{{ .Values.audiencias.image.repository }}:{{ .Values.audiencias.image.tag }}" + imagePullPolicy: {{ .Values.audiencias.image.pullPolicy }} + args: + - ./start-web.sh + env: + - name: ADMIN_EMAIL + value: {{ .Values.edemocracia.admin.email | quote }} + - name: ADMIN_PASSWORD + value: {{ .Values.edemocracia.admin.password | quote }} + - name: ADMIN_USERNAME + value: admin + - name: ALLOWED_HOSTS + value: audienciasweb, localhost, 127.0.0.1, "{{ $edemoUrl }}" + - name: COMPRESS_OFFLINE + value: "True" + - name: DATABASE_ENGINE + value: postgresql_psycopg2 + - name: DATABASE_HOST + value: {{ (include "postgresql.fullname" .) }} + - name: DATABASE_NAME + value: audiencias + - name: DATABASE_PASSWORD + value: {{ .Values.postgresql.postgresqlPassword | quote }} + - name: DATABASE_PORT + value: "5432" + - name: DATABASE_USER + value: {{ .Values.postgresql.postgresqlUsername | quote }} + - name: DEBUG + value: "False" + - name: DEFAULT_FROM_EMAIL + value: '"Portal e-Democracia[audiencias]" <{{ .Values.edemocracia.admin.email }}>' + - name: DJANGO_SECRET_KEY + value: {{ .Values.edemocracia.apikey | quote }} + - name: EMAIL_HOST + value: {{ .Values.smtp.host | quote }} + - name: EMAIL_HOST_PASSWORD + value: {{ .Values.smtp.password | quote }} + - name: EMAIL_HOST_USER + value: {{ .Values.smtp.username | quote }} + - name: EMAIL_PORT + value: {{ .Values.smtp.port | quote }} + - name: EMAIL_USE_TLS + value: {{ .Values.smtp.tls | quote}} + - name: ENABLE_REMOTE_USER + value: "True" + - name: FORCE_SCRIPT_NAME + value: /audiencias + - name: GOOGLE_ANALYTICS_ID + value: {{ .Values.edemocracia.googleAnalyticsId | quote }} + - name: LOGIN_REDIRECT_URL + value: / + - name: LOGIN_URL + value: / + - name: LOGOUT_REDIRECT_URL + value: / + - name: NOTIFICATION_EMAIL_LIST + value: "{{ .Values.edemocracia.admin.email }},{{ .Values.audiencias.notifEmailList }}" + - name: OLARK_ID + value: {{ .Values.edemocracia.olarkId | quote }} + - name: RECAPTCHA_PRIVATE_KEY + value: {{ .Values.edemocracia.recaptcha.privateKey | quote }} + - name: RECAPTCHA_SITE_KEY + value: {{ .Values.edemocracia.recaptcha.siteKey | quote }} + - name: REDIS_SERVER + value: {{ (include "redis.fullname" .) }}-master + - name: SESSION_COOKIE_NAME + value: audiencias_session + - name: SITE_DOMAIN + value: "{{ $edemoUrl }}" + - name: SITE_NAME + value: {{ .Values.edemocracia.siteName | quote }} + - name: STATIC_URL + value: /audiencias/static/ + - name: URL_PREFIX + value: audiencias + - name: WEBSERVICE_URL + value: {{ .Values.audiencias.webservice.url | quote }} + - name: WORDS_BLACK_LIST + value: {{ .Values.audiencias.wordsBlacklist | quote }} + resources: + {{- toYaml .Values.audiencias.resources | nindent 12 }} + volumeMounts: + - mountPath: /var/labhacker/audiencias/public/ + name: {{ include "edemocracia.fullname" . }}-audiencias + restartPolicy: Always + serviceAccountName: "" + volumes: + - name: {{ include "edemocracia.fullname" . }}-audiencias + persistentVolumeClaim: + claimName: {{ include "edemocracia.fullname" . }}-audiencias + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + affinity: + podAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - {{ include "edemocracia.name" . }} + - key: app.kubernetes.io/instance + operator: In + values: + - {{ .Release.Name }} + - key: app.kubernetes.io/component + operator: In + values: + - edemocracia + topologyKey: kubernetes.io/hostname + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} +{{- end }} diff --git a/charts/edemocracia/v0.1.12/templates/audienciasweb-service.yaml b/charts/edemocracia/v0.1.12/templates/audienciasweb-service.yaml new file mode 100755 index 0000000..4208451 --- /dev/null +++ b/charts/edemocracia/v0.1.12/templates/audienciasweb-service.yaml @@ -0,0 +1,19 @@ +{{- if .Values.audiencias.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: audienciasweb + labels: + {{- include "edemocracia.labels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-audienciasweb +spec: + type: {{ .Values.audiencias.service.type }} + ports: + - port: {{ .Values.audiencias.service.port }} + targetPort: 8000 + protocol: TCP + name: "8000" + selector: + {{- include "edemocracia.selectorLabels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-audienciasweb +{{- end }} diff --git a/charts/edemocracia/v0.1.12/templates/audienciasworker-deployment.yaml b/charts/edemocracia/v0.1.12/templates/audienciasworker-deployment.yaml new file mode 100755 index 0000000..eebeeb8 --- /dev/null +++ b/charts/edemocracia/v0.1.12/templates/audienciasworker-deployment.yaml @@ -0,0 +1,147 @@ +{{- if .Values.audiencias.enabled }} +{{- $edemoUrl := .Values.edemocracia.hostname -}} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "edemocracia.fullname" . }}-audienciasworker + labels: + {{- include "edemocracia.labels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-audienciasworker +spec: + selector: + matchLabels: + {{- include "edemocracia.selectorLabels" . | nindent 6 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-audienciasworker + app.kubernetes.io/component: audiencias + strategy: + type: Recreate + template: + metadata: + labels: + {{- include "edemocracia.selectorLabels" . | nindent 8 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-audienciasworker + app.kubernetes.io/component: audiencias + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + containers: + - name: {{ include "edemocracia.fullname" . }}-audienciasworker + image: "{{ .Values.audiencias.image.repository }}:{{ .Values.audiencias.image.tag }}" + imagePullPolicy: {{ .Values.audiencias.image.pullPolicy }} + args: + - ./start-worker.sh + env: + - name: ADMIN_EMAIL + value: {{ .Values.edemocracia.admin.email | quote }} + - name: ADMIN_PASSWORD + value: {{ .Values.edemocracia.admin.password | quote }} + - name: ADMIN_USERNAME + value: admin + - name: ALLOWED_HOSTS + value: audienciasweb, audienciasworker, localhost, 127.0.0.1, "{{ $edemoUrl }}" + - name: COMPRESS_OFFLINE + value: "True" + - name: DATABASE_ENGINE + value: postgresql_psycopg2 + - name: DATABASE_HOST + value: {{ (include "postgresql.fullname" .) }} + - name: DATABASE_NAME + value: audiencias + - name: DATABASE_PASSWORD + value: {{ .Values.postgresql.postgresqlPassword | quote }} + - name: DATABASE_PORT + value: "5432" + - name: DATABASE_USER + value: {{ .Values.postgresql.postgresqlUsername | quote }} + - name: DEBUG + value: "False" + - name: DEFAULT_FROM_EMAIL + value: '"Portal e-Democracia[audiencias]" <{{ .Values.edemocracia.admin.email }}>' + - name: DJANGO_SECRET_KEY + value: {{ .Values.edemocracia.apikey | quote }} + - name: EMAIL_HOST + value: {{ .Values.smtp.host | quote }} + - name: EMAIL_HOST_PASSWORD + value: {{ .Values.smtp.password | quote }} + - name: EMAIL_HOST_USER + value: {{ .Values.smtp.username | quote }} + - name: EMAIL_PORT + value: {{ .Values.smtp.port | quote }} + - name: EMAIL_USE_TLS + value: {{ .Values.smtp.tls | quote }} + - name: ENABLE_REMOTE_USER + value: "True" + - name: FORCE_SCRIPT_NAME + value: /audiencias + - name: GOOGLE_ANALYTICS_ID + value: {{ .Values.edemocracia.googleAnalyticsId }} + - name: LOGIN_REDIRECT_URL + value: / + - name: LOGIN_URL + value: / + - name: LOGOUT_REDIRECT_URL + value: / + - name: NOTIFICATION_EMAIL_LIST + value: "{{ .Values.edemocracia.admin.email }},{{ .Values.audiencias.notifEmailList }}" + - name: OLARK_ID + value: {{ .Values.edemocracia.olarkId | quote }} + - name: RECAPTCHA_PRIVATE_KEY + value: {{ .Values.edemocracia.recaptcha.privateKey | quote }} + - name: RECAPTCHA_SITE_KEY + value: {{ .Values.edemocracia.recaptcha.siteKey | quote }} + - name: REDIS_SERVER + value: {{ (include "redis.fullname" .) }}-master + - name: SESSION_COOKIE_NAME + value: audiencias_session + - name: SITE_DOMAIN + value: "{{ $edemoUrl }}" + - name: SITE_NAME + value: {{ .Values.edemocracia.siteName | quote }} + - name: STATIC_URL + value: /audiencias/static/ + - name: URL_PREFIX + value: audiencias + - name: WEBSERVICE_URL + value: {{ .Values.audiencias.webservice.url | quote }} + - name: WORDS_BLACK_LIST + value: {{ .Values.audiencias.wordsBlacklist | quote }} + resources: + {{- toYaml .Values.audiencias.resources | nindent 12 }} + volumeMounts: + - mountPath: /var/labhacker/audiencias/public/ + name: {{ include "edemocracia.fullname" . }}-audiencias + restartPolicy: Always + serviceAccountName: "" + volumes: + - name: {{ include "edemocracia.fullname" . }}-audiencias + persistentVolumeClaim: + claimName: {{ include "edemocracia.fullname" . }}-audiencias + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + affinity: + podAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - {{ include "edemocracia.name" . }} + - key: app.kubernetes.io/instance + operator: In + values: + - {{ .Release.Name }} + - key: app.kubernetes.io/component + operator: In + values: + - edemocracia + topologyKey: kubernetes.io/hostname + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} +{{- end }} diff --git a/charts/edemocracia/v0.1.12/templates/discourse-deployment.yaml b/charts/edemocracia/v0.1.12/templates/discourse-deployment.yaml new file mode 100755 index 0000000..f56af38 --- /dev/null +++ b/charts/edemocracia/v0.1.12/templates/discourse-deployment.yaml @@ -0,0 +1,144 @@ +{{- if .Values.discourse.enabled }} +{{- $edemoUrl := .Values.edemocracia.hostname -}} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "edemocracia.fullname" . }}-discourse + labels: + {{- include "edemocracia.labels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-discourse +spec: + selector: + matchLabels: + {{- include "edemocracia.selectorLabels" . | nindent 6 }} + app.kubernetes.io/component: discourse + io.kompose.service: {{ include "edemocracia.fullname" . }}-discourse + strategy: + type: Recreate + template: + metadata: + labels: + {{- include "edemocracia.selectorLabels" . | nindent 8 }} + app.kubernetes.io/component: discourse + io.kompose.service: {{ include "edemocracia.fullname" . }}-discourse + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + initContainers: + - image: "{{ .Values.discourse.image.repository }}:{{ .Values.discourse.image.tag }}" + name: {{ include "edemocracia.fullname" . }}-discourse-cpimgs + command: + - "cp" + - "-au" + - "/var/www/discourse/public/images/." + - "/publicimgs/" + volumeMounts: + - mountPath: /publicimgs/ + subPath: images + name: {{ include "edemocracia.fullname" . }}-discourse + containers: + - args: + - ./start-web.sh + env: + - name: ADMIN_EMAIL + value: {{ .Values.edemocracia.admin.email | quote }} + - name: ADMIN_PASSWORD + value: {{ .Values.edemocracia.admin.password | quote }} + - name: ADMIN_USERNAME + value: admin + - name: DISCOURSE_CONTACT_EMAIL + value: {{ .Values.edemocracia.admin.email | quote }} + - name: DISCOURSE_CONTACT_URL + value: {{ $edemoUrl }} + - name: DISCOURSE_DB_HOST + value: {{ (include "postgresql.fullname" .) }} + - name: DISCOURSE_DB_NAME + value: discourse + - name: DISCOURSE_DB_PASSWORD + value: {{ .Values.postgresql.postgresqlPassword | quote }} + - name: DISCOURSE_DB_PORT + value: "5432" + - name: DISCOURSE_DB_USERNAME + value: {{ .Values.postgresql.postgresqlUsername | quote}} + - name: DISCOURSE_DEVELOPER_EMAILS + - name: DISCOURSE_FORCE_HOSTNAME + value: {{ $edemoUrl }}\/expressao + - name: DISCOURSE_HOSTNAME + value: {{ $edemoUrl }}\/expressao + - name: DISCOURSE_NOTIFICATION_EMAIL + value: {{ .Values.edemocracia.admin.email }} + - name: DISCOURSE_REDIS_HOST + value: {{ (include "redis.fullname" .) }}-master + - name: DISCOURSE_REDIS_PORT + value: "6379" + - name: DISCOURSE_RELATIVE_URL_ROOT + value: /expressao + - name: DISCOURSE_SMTP_ADDRESS + value: {{ .Values.smtp.host | quote }} + - name: DISCOURSE_SMTP_PASSWORD + value: {{ .Values.smtp.password | quote }} + - name: DISCOURSE_SMTP_PORT + value: {{ .Values.smtp.port | quote }} + - name: DISCOURSE_SMTP_USER_NAME + value: {{ .Values.smtp.username | quote }} + - name: DISCOURSE_SSO_SECRET + value: {{ .Values.discourse.sso.secret | quote }} + - name: DISCOURSE_SSO_URL + value: "https://{{ $edemoUrl }}" + - name: RAILS_ENV + value: production + image: {{.Values.discourse.image.repository}}:{{ .Values.discourse.image.tag }} + imagePullPolicy: {{ .Values.discourse.image.pullPolicy }} + name: {{ include "edemocracia.fullname" . }}-discourse + ports: + - containerPort: 8080 + resources: + {{- toYaml .Values.discourse.resources | nindent 12 }} + volumeMounts: + - mountPath: /var/www/discourse/public/assets/ + name: {{ include "edemocracia.fullname" . }}-discourse + subPath: assets + - mountPath: /var/www/discourse/public/javascripts/ + name: {{ include "edemocracia.fullname" . }}-discourse + subPath: javascripts + - mountPath: /var/www/discourse/public/images/ + name: {{ include "edemocracia.fullname" . }}-discourse + subPath: images + - mountPath: /var/www/discourse/tmp/stylesheet-cache/ + name: {{ include "edemocracia.fullname" . }}-discourse + subPath: stylesheet-cache + restartPolicy: Always + serviceAccountName: "" + volumes: + - name: {{ include "edemocracia.fullname" . }}-discourse + persistentVolumeClaim: + claimName: {{ include "edemocracia.fullname" . }}-discourse + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + affinity: + podAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - {{ include "edemocracia.name" . }} + - key: app.kubernetes.io/instance + operator: In + values: + - {{ .Release.Name }} + - key: app.kubernetes.io/component + operator: In + values: + - edemocracia + topologyKey: kubernetes.io/hostname + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} +{{- end }} diff --git a/charts/edemocracia/v0.1.12/templates/discourse-pvc.yaml b/charts/edemocracia/v0.1.12/templates/discourse-pvc.yaml new file mode 100755 index 0000000..d9e7804 --- /dev/null +++ b/charts/edemocracia/v0.1.12/templates/discourse-pvc.yaml @@ -0,0 +1,19 @@ +{{- if .Values.discourse.enabled }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "edemocracia.fullname" . }}-discourse +spec: + accessModes: + - {{ .Values.discourse.persistence.accessMode }} + resources: + requests: + storage: {{ .Values.discourse.persistence.size }} +{{- if .Values.discourse.persistence.storageClass }} +{{- if (eq "-" .Values.discourse.persistence.storageClass) }} + storageClassName: "" +{{- else }} + storageClassName: "{{ .Values.discourse.persistence.storageClass }}" +{{- end }} +{{- end }} +{{- end }} diff --git a/charts/edemocracia/v0.1.12/templates/discourse-service.yaml b/charts/edemocracia/v0.1.12/templates/discourse-service.yaml new file mode 100755 index 0000000..c0c96f0 --- /dev/null +++ b/charts/edemocracia/v0.1.12/templates/discourse-service.yaml @@ -0,0 +1,19 @@ +{{- if .Values.discourse.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: discourse + labels: + {{- include "edemocracia.labels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-discourse +spec: + type: {{ .Values.discourse.service.type }} + ports: + - port: {{ .Values.discourse.service.port }} + targetPort: 8080 + protocol: TCP + name: "8080" + selector: + {{- include "edemocracia.selectorLabels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-discourse +{{- end }} diff --git a/charts/edemocracia/v0.1.12/templates/edemocracia-deployment.yaml b/charts/edemocracia/v0.1.12/templates/edemocracia-deployment.yaml new file mode 100755 index 0000000..f07dceb --- /dev/null +++ b/charts/edemocracia/v0.1.12/templates/edemocracia-deployment.yaml @@ -0,0 +1,165 @@ +{{- $edemoUrl := .Values.edemocracia.hostname -}} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "edemocracia.fullname" . }}-edemocracia + labels: + {{- include "edemocracia.labels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-edemocracia +spec: + selector: + matchLabels: + {{- include "edemocracia.selectorLabels" . | nindent 6 }} + app.kubernetes.io/component: edemocracia + io.kompose.service: {{ include "edemocracia.fullname" . }}-edemocracia + strategy: + type: Recreate + template: + metadata: + labels: + {{- include "edemocracia.selectorLabels" . | nindent 8 }} + app.kubernetes.io/component: edemocracia + io.kompose.service: {{ include "edemocracia.fullname" . }}-edemocracia + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + initContainers: + - image: "{{ .Values.edemocracia.image.repository }}:{{ .Values.edemocracia.image.tag }}" + name: {{ include "edemocracia.fullname" . }}-edemocracia-cpmedia + command: + - "cp" + - "-au" + - "/var/labhacker/edemocracia/src/public/media/" + - "/srcpublic/" + volumeMounts: + - mountPath: /srcpublic + name: {{ include "edemocracia.fullname" . }}-edemocracia + containers: + - name: {{ include "edemocracia.fullname" . }}-edemocracia + image: "{{ .Values.edemocracia.image.repository }}:{{ .Values.edemocracia.image.tag }}" + imagePullPolicy: {{ .Values.edemocracia.image.pullPolicy }} + args: + - ./runserver-production + env: + - name: ADMIN_EMAIL + value: {{ .Values.edemocracia.admin.email | quote }} + - name: ADMIN_PASSWORD + value: {{ .Values.edemocracia.admin.password | quote }} + - name: ADMIN_USERNAME + value: admin + - name: ALLOWED_HOSTS + value: "{{ $edemoUrl }}" + - name: AUDIENCIAS_API_KEY + value: {{ .Values.edemocracia.apikey | quote }} + - name: AUDIENCIAS_ENABLED + {{- if .Values.audiencias.enabled }} + value: "True" + {{- else }} + value: "False" + {{- end }} + - name: AUDIENCIAS_UPSTREAM + value: http://audienciasweb:8000/audiencias + - name: DATABASE_ENGINE + value: postgresql_psycopg2 + - name: DATABASE_HOST + value: {{ (include "postgresql.fullname" .) }} + - name: DATABASE_NAME + value: edemocracia + - name: DATABASE_PASSWORD + value: {{ .Values.postgresql.postgresqlPassword | quote }} + - name: DATABASE_PORT + value: "5432" + - name: DATABASE_USER + value: {{ .Values.postgresql.postgresqlUsername | quote }} + - name: DEBUG + value: "{{ .Values.edemocracia.debug }}" + - name: DEFAULT_FROM_EMAIL + value: '"Portal e-Democracia" <{{ .Values.edemocracia.admin.email }}>' + - name: DISCOURSE_ENABLED + {{- if .Values.discourse.enabled }} + value: "True" + {{- else }} + value: "False" + {{- end }} + - name: DISCOURSE_SSO_SECRET + value: {{ .Values.discourse.sso.secret | quote }} + # Workaround for a bug in runserver-production script, which does not check for DISCOURSE_ENABLED variable + - name: DISCOURSE_UPSTREAM + {{- if .Values.discourse.enabled }} + value: http://discourse:8080/expressao + {{- else }} + value: "--version" + {{- end }} + - name: EMAIL_BACKEND + value: django.core.mail.backends.smtp.EmailBackend + - name: EMAIL_HOST + value: {{ .Values.smtp.host | quote }} + - name: EMAIL_HOST_PASSWORD + value: {{ .Values.smtp.password | quote }} + - name: EMAIL_HOST_USER + value: {{ .Values.smtp.username | quote }} + - name: EMAIL_PORT + value: {{ .Values.smtp.port | quote }} + - name: EMAIL_USE_TLS + value: {{ .Values.smtp.tls | quote }} + - name: GOOGLE_ANALYTICS_ID + value: {{ .Values.edemocracia.googleAnalyticsId | quote }} + - name: OLARK_ID + value: {{ .Values.edemocracia.olarkId | quote }} + - name: RECAPTCHA_PRIVATE_KEY + value: {{ .Values.edemocracia.recaptcha.privateKey | quote }} + - name: RECAPTCHA_SITE_KEY + value: {{ .Values.edemocracia.recaptcha.siteKey | quote }} + - name: SECRET_KEY + value: {{ .Values.edemocracia.apikey | quote }} + - name: SITE_NAME + value: {{ .Values.edemocracia.siteName | quote }} + - name: SITE_URL + value: "https://{{ $edemoUrl }}" + - name: SOCIAL_AUTH_FACEBOOK_KEY + value: {{ .Values.edemocracia.socialAuth.facebook.key | quote }} + - name: SOCIAL_AUTH_FACEBOOK_SECRET + value: {{ .Values.edemocracia.socialAuth.facebook.secret | quote }} + - name: SOCIAL_AUTH_GOOGLE_OAUTH2_KEY + value: {{ .Values.edemocracia.socialAuth.google.key | quote }} + - name: SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET + value: {{ .Values.edemocracia.socialAuth.google.secret | quote }} + - name: SOCIAL_AUTH_REDIRECT_IS_HTTPS + value: "True" + - name: WIKILEGIS_API_KEY + value: {{ .Values.edemocracia.apikey | quote }} + - name: WIKILEGIS_API_URL + value: /api/v1/ + - name: WIKILEGIS_ENABLED + {{- if .Values.wikilegis.enabled }} + value: "True" + {{- else }} + value: "False" + {{- end }} + - name: WIKILEGIS_UPSTREAM + value: http://wikilegis:8000 + resources: + {{- toYaml .Values.edemocracia.resources | nindent 12 }} + volumeMounts: + - mountPath: /var/labhacker/edemocracia/src/public/ + name: {{ include "edemocracia.fullname" . }}-edemocracia + restartPolicy: Always + serviceAccountName: "" + volumes: + - name: {{ include "edemocracia.fullname" . }}-edemocracia + persistentVolumeClaim: + claimName: {{ include "edemocracia.fullname" . }}-edemocracia + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/edemocracia/v0.1.12/templates/edemocracia-pvc.yaml b/charts/edemocracia/v0.1.12/templates/edemocracia-pvc.yaml new file mode 100755 index 0000000..0247fce --- /dev/null +++ b/charts/edemocracia/v0.1.12/templates/edemocracia-pvc.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "edemocracia.fullname" . }}-edemocracia +spec: + accessModes: + - {{ .Values.edemocracia.persistence.accessMode }} + resources: + requests: + storage: {{ .Values.edemocracia.persistence.size }} +{{- if .Values.edemocracia.persistence.storageClass }} +{{- if (eq "-" .Values.edemocracia.persistence.storageClass) }} + storageClassName: "" +{{- else }} + storageClassName: "{{ .Values.edemocracia.persistence.storageClass }}" +{{- end }} +{{- end }} diff --git a/charts/edemocracia/v0.1.12/templates/edemocracia-service.yaml b/charts/edemocracia/v0.1.12/templates/edemocracia-service.yaml new file mode 100755 index 0000000..2e6350f --- /dev/null +++ b/charts/edemocracia/v0.1.12/templates/edemocracia-service.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: edemocracia + labels: + {{- include "edemocracia.labels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-edemocracia +spec: + type: {{ .Values.edemocracia.service.type }} + ports: + - port: {{ .Values.edemocracia.service.port }} + targetPort: 8000 + protocol: TCP + name: "8000" + selector: + {{- include "edemocracia.selectorLabels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-edemocracia diff --git a/charts/edemocracia/v0.1.12/templates/ingress.yaml b/charts/edemocracia/v0.1.12/templates/ingress.yaml new file mode 100755 index 0000000..94b3425 --- /dev/null +++ b/charts/edemocracia/v0.1.12/templates/ingress.yaml @@ -0,0 +1,32 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "edemocracia.fullname" . -}} +{{- $hostName := .Values.edemocracia.hostname -}} +{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "edemocracia.labels" . | nindent 4 }} + annotations: + cert-manager.io/cluster-issuer: "letsencrypt-prod" + {{- with .Values.ingress.annotations }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + tls: + - hosts: + - "{{ $hostName }}" + secretName: {{ $hostName | replace "." "-" }}-tls + rules: + - host: "{{ $hostName }}" + http: + paths: + - path: / + backend: + serviceName: nginx + servicePort: http +{{- end }} diff --git a/charts/edemocracia/v0.1.12/templates/nginx-deployment.yaml b/charts/edemocracia/v0.1.12/templates/nginx-deployment.yaml new file mode 100755 index 0000000..b0ce573 --- /dev/null +++ b/charts/edemocracia/v0.1.12/templates/nginx-deployment.yaml @@ -0,0 +1,120 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "edemocracia.fullname" . }}-nginx + labels: + {{- include "edemocracia.labels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-nginx +spec: + selector: + matchLabels: + {{- include "edemocracia.selectorLabels" . | nindent 6 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-nginx + strategy: + type: Recreate + template: + metadata: + labels: + {{- include "edemocracia.selectorLabels" . | nindent 8 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-nginx + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + containers: + - name: {{ .Chart.Name }}-nginx + image: "{{ .Values.nginx.image.repository }}:{{ .Values.nginx.image.tag }}" + imagePullPolicy: {{ .Values.nginx.image.pullPolicy }} + ports: + - name: http + containerPort: 80 + protocol: TCP + livenessProbe: + failureThreshold: 3 + periodSeconds: 10 + successThreshold: 1 + tcpSocket: + port: http + timeoutSeconds: 1 + readinessProbe: + failureThreshold: 3 + periodSeconds: 10 + successThreshold: 1 + tcpSocket: + port: http + timeoutSeconds: 1 + resources: + {{- toYaml .Values.nginx.resources | nindent 12 }} + volumeMounts: + - mountPath: /var/labhacker/edemocracia/src/public/ + name: {{ include "edemocracia.fullname" . }}-edemocracia + {{- if .Values.wikilegis.enabled }} + - mountPath: /var/labhacker/wikilegis/wikilegis/public/ + name: {{ include "edemocracia.fullname" . }}-wikilegis + {{- end }} + {{- if .Values.audiencias.enabled }} + - mountPath: /var/labhacker/audiencias/public/ + name: {{ include "edemocracia.fullname" . }}-audiencias + {{- end }} + {{- if .Values.discourse.enabled }} + - mountPath: /var/www/discourse/public/assets/ + name: {{ include "edemocracia.fullname" . }}-discourse + subPath: assets + - mountPath: /var/www/discourse/public/javascripts/ + name: {{ include "edemocracia.fullname" . }}-discourse + subPath: javascripts + - mountPath: /var/www/discourse/public/images/ + name: {{ include "edemocracia.fullname" . }}-discourse + subPath: images + - mountPath: /var/www/discourse/tmp/stylesheet-cache/ + name: {{ include "edemocracia.fullname" . }}-discourse + subPath: stylesheet-cache + {{- end }} + restartPolicy: Always + serviceAccountName: "" + volumes: + - name: {{ include "edemocracia.fullname" . }}-edemocracia + persistentVolumeClaim: + claimName: {{ include "edemocracia.fullname" . }}-edemocracia + {{- if .Values.wikilegis.enabled }} + - name: {{ include "edemocracia.fullname" . }}-wikilegis + persistentVolumeClaim: + claimName: {{ include "edemocracia.fullname" . }}-wikilegis + {{- end }} + {{- if .Values.audiencias.enabled }} + - name: {{ include "edemocracia.fullname" . }}-audiencias + persistentVolumeClaim: + claimName: {{ include "edemocracia.fullname" . }}-audiencias + {{- end }} + {{- if .Values.discourse.enabled }} + - name: {{ include "edemocracia.fullname" . }}-discourse + persistentVolumeClaim: + claimName: {{ include "edemocracia.fullname" . }}-discourse + {{- end }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + affinity: + podAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - {{ include "edemocracia.name" . }} + - key: app.kubernetes.io/instance + operator: In + values: + - {{ .Release.Name }} + - key: app.kubernetes.io/component + operator: In + values: + - edemocracia + topologyKey: kubernetes.io/hostname + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/edemocracia/v0.1.12/templates/nginx-service.yaml b/charts/edemocracia/v0.1.12/templates/nginx-service.yaml new file mode 100755 index 0000000..51f175c --- /dev/null +++ b/charts/edemocracia/v0.1.12/templates/nginx-service.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: nginx + labels: + {{- include "edemocracia.labels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-nginx +spec: + type: {{ .Values.nginx.service.type }} + ports: + - port: {{ .Values.nginx.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "edemocracia.selectorLabels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-nginx diff --git a/charts/edemocracia/v0.1.12/templates/velero-schedule-monthly.yaml b/charts/edemocracia/v0.1.12/templates/velero-schedule-monthly.yaml new file mode 100755 index 0000000..04cbc3a --- /dev/null +++ b/charts/edemocracia/v0.1.12/templates/velero-schedule-monthly.yaml @@ -0,0 +1,39 @@ +{{- if .Values.velero.backup.enabled }} +apiVersion: velero.io/v1 +kind: Schedule +metadata: + name: {{ include "edemocracia.fullname" . }}-monthly + namespace: {{ .Values.velero.namespace }} +spec: + # generate a random backup time between 1 and 5 AM on first day of every month + schedule: {{ mod (randNumeric 2) 60 }} {{ mod (randNumeric 1) 6 }} 1 * * + template: + includedNamespaces: + - {{ .Release.Namespace }} + {{- with .Values.velero.backup.excludedResources }} + excludedResources: + {{- toYaml . | nindent 8 }} + {{- end }} + snapshotVolumes: {{ .Values.velero.backup.snapshotVolumes }} + # every weekday backup is good for the next year (365 days) + ttl: 8760h0m0s + defaultVolumesToRestic: {{ .Values.velero.backup.defaultVolumesToRestic }} + hooks: + resources: + - name: pgdump + includedResources: + - pods + labelSelector: + matchLabels: + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/name: postgresql + pre: + - exec: + command: + - "/bin/bash" + - "-c" + - "PGPASSWORD=$POSTGRES_PASSWORD /opt/bitnami/postgresql/bin/pg_dumpall -U postgres > /bitnami/postgresql/all.dump" + timeout: 360s + onError: Continue + useOwnerReferencesInBackup: false +{{- end }} \ No newline at end of file diff --git a/charts/edemocracia/v0.1.12/templates/velero-schedule-weekdays.yaml b/charts/edemocracia/v0.1.12/templates/velero-schedule-weekdays.yaml new file mode 100755 index 0000000..ea53bda --- /dev/null +++ b/charts/edemocracia/v0.1.12/templates/velero-schedule-weekdays.yaml @@ -0,0 +1,39 @@ +{{- if .Values.velero.backup.enabled }} +apiVersion: velero.io/v1 +kind: Schedule +metadata: + name: {{ include "edemocracia.fullname" . }}-weekdays + namespace: {{ .Values.velero.namespace }} +spec: + # generate a random backup time between 1 and 5 AM on weekdays + schedule: {{ mod (randNumeric 2) 60 }} {{ mod (randNumeric 1) 6 }} * * 1-5 + template: + includedNamespaces: + - {{ .Release.Namespace }} + {{- with .Values.velero.backup.excludedResources }} + excludedResources: + {{- toYaml . | nindent 8 }} + {{- end }} + snapshotVolumes: {{ .Values.velero.backup.snapshotVolumes }} + # every weekday backup is good for the next week (7 days) + ttl: 168h0m0s + defaultVolumesToRestic: {{ .Values.velero.backup.defaultVolumesToRestic }} + hooks: + resources: + - name: pgdump + includedResources: + - pods + labelSelector: + matchLabels: + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/name: postgresql + pre: + - exec: + command: + - "/bin/bash" + - "-c" + - "PGPASSWORD=$POSTGRES_PASSWORD /opt/bitnami/postgresql/bin/pg_dumpall -U postgres > /bitnami/postgresql/all.dump" + timeout: 360s + onError: Continue + useOwnerReferencesInBackup: false +{{- end }} \ No newline at end of file diff --git a/charts/edemocracia/v0.1.12/templates/velero-schedule-weekly.yaml b/charts/edemocracia/v0.1.12/templates/velero-schedule-weekly.yaml new file mode 100755 index 0000000..e9a09a3 --- /dev/null +++ b/charts/edemocracia/v0.1.12/templates/velero-schedule-weekly.yaml @@ -0,0 +1,39 @@ +{{- if .Values.velero.backup.enabled }} +apiVersion: velero.io/v1 +kind: Schedule +metadata: + name: {{ include "edemocracia.fullname" . }}-weekly + namespace: {{ .Values.velero.namespace }} +spec: + # generate a random backup time between 1 and 5 AM on sunday + schedule: {{ mod (randNumeric 2) 60 }} {{ mod (randNumeric 1) 6 }} * * 0 + template: + includedNamespaces: + - {{ .Release.Namespace }} + {{- with .Values.velero.backup.excludedResources }} + excludedResources: + {{- toYaml . | nindent 8 }} + {{- end }} + snapshotVolumes: {{ .Values.velero.backup.snapshotVolumes }} + # every sunday backup is good for 30 days (aprox. 1 month) + ttl: 744h0m0s + defaultVolumesToRestic: {{ .Values.velero.backup.defaultVolumesToRestic }} + hooks: + resources: + - name: pgdump + includedResources: + - pods + labelSelector: + matchLabels: + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/name: postgresql + pre: + - exec: + command: + - "/bin/bash" + - "-c" + - "PGPASSWORD=$POSTGRES_PASSWORD /opt/bitnami/postgresql/bin/pg_dumpall -U postgres > /bitnami/postgresql/all.dump" + timeout: 360s + onError: Continue + useOwnerReferencesInBackup: false +{{- end }} \ No newline at end of file diff --git a/charts/edemocracia/v0.1.12/templates/wikilegis-deployment.yaml b/charts/edemocracia/v0.1.12/templates/wikilegis-deployment.yaml new file mode 100755 index 0000000..680b6b3 --- /dev/null +++ b/charts/edemocracia/v0.1.12/templates/wikilegis-deployment.yaml @@ -0,0 +1,144 @@ +{{- if .Values.wikilegis.enabled }} +{{- $edemoUrl := .Values.edemocracia.hostname -}} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "edemocracia.fullname" . }}-wikilegis + labels: + {{- include "edemocracia.labels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-wikilegis +spec: + selector: + matchLabels: + {{- include "edemocracia.selectorLabels" . | nindent 6 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-wikilegis + app.kubernetes.io/component: wikilegis + strategy: + type: Recreate + template: + metadata: + labels: + {{- include "edemocracia.selectorLabels" . | nindent 8 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-wikilegis + app.kubernetes.io/component: wikilegis + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + initContainers: + - image: "{{ .Values.wikilegis.image.repository }}:{{ .Values.wikilegis.image.tag }}" + name: {{ include "edemocracia.fullname" . }}-wikilegis-cpmedia + command: + - "cp" + - "-au" + - "/var/labhacker/wikilegis/wikilegis/public/media/" + - "/wlpublic/" + volumeMounts: + - mountPath: /wlpublic + name: {{ include "edemocracia.fullname" . }}-wikilegis + containers: + - name: {{ include "edemocracia.fullname" . }}-wikilegis + image: "{{ .Values.wikilegis.image.repository }}:{{ .Values.wikilegis.image.tag }}" + imagePullPolicy: {{ .Values.wikilegis.image.pullPolicy }} + args: + - ./start.sh + env: + - name: ADMIN_EMAIL + value: {{ .Values.edemocracia.admin.email | quote }} + - name: ADMIN_PASSWORD + value: {{ .Values.edemocracia.admin.password | quote }} + - name: ALLOWED_HOSTS + value: "{{ $edemoUrl }},wikilegisweb,wikilegis,localhost,127.0.0.1" + - name: API_KEY + value: {{ .Values.edemocracia.apikey | quote }} + - name: AUTH_USER_MODEL + value: accounts.User + - name: DATABASE_ENGINE + value: postgresql_psycopg2 + - name: DATABASE_HOST + value: {{ (include "postgresql.fullname" .) }} + - name: DATABASE_NAME + value: wikilegis + - name: DATABASE_PASSWORD + value: {{ .Values.postgresql.postgresqlPassword | quote }} + - name: DATABASE_PORT + value: "5432" + - name: DATABASE_USER + value: {{ .Values.postgresql.postgresqlUsername | quote }} + - name: DEBUG + value: "True" + - name: DEFAULT_FROM_EMAIL + value: '"Portal e-Democracia[Wikilegis]" <{{ .Values.edemocracia.admin.email }}>' + - name: EMAIL_HOST + value: {{ .Values.smtp.host | quote }} + - name: EMAIL_HOST_PASSWORD + value: {{ .Values.smtp.password | quote }} + - name: EMAIL_HOST_USER + value: {{ .Values.smtp.username | quote }} + - name: EMAIL_PORT + value: {{ .Values.smtp.port | quote }} + - name: EMAIL_USE_TLS + value: {{ .Values.smtp.tls | quote }} + - name: ENABLE_REMOTE_USER + value: "True" + - name: FORCE_SCRIPT_NAME + value: /wikilegis + - name: LANGUAGE_CODE + value: pt-br + - name: LOGIN_REDIRECT_URL + value: / + - name: LOGIN_URL + value: / + - name: MEDIA_URL + value: /wikilegis/media/ + - name: SECRET_KEY + value: {{ .Values.edemocracia.apikey | quote }} + - name: SESSION_COOKIE_NAME + value: wikilegis_session + - name: SITE_DOMAIN + value: {{ $edemoUrl }} + - name: SITE_NAME + value: {{ .Values.edemocracia.sitename | quote }} + - name: STATIC_URL + value: /wikilegis/static/ + - name: TIME_ZONE + value: {{ .Values.edemocracia.timeZone | quote }} + resources: + {{- toYaml .Values.wikilegis.resources | nindent 12 }} + volumeMounts: + - mountPath: /var/labhacker/wikilegis/wikilegis/public/ + name: {{ include "edemocracia.fullname" . }}-wikilegis + restartPolicy: Always + serviceAccountName: "" + volumes: + - name: {{ include "edemocracia.fullname" . }}-wikilegis + persistentVolumeClaim: + claimName: {{ include "edemocracia.fullname" . }}-wikilegis + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + affinity: + podAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - {{ include "edemocracia.name" . }} + - key: app.kubernetes.io/instance + operator: In + values: + - {{ .Release.Name }} + - key: app.kubernetes.io/component + operator: In + values: + - edemocracia + topologyKey: kubernetes.io/hostname + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} +{{- end }} diff --git a/charts/edemocracia/v0.1.12/templates/wikilegis-pvc.yaml b/charts/edemocracia/v0.1.12/templates/wikilegis-pvc.yaml new file mode 100755 index 0000000..00b8660 --- /dev/null +++ b/charts/edemocracia/v0.1.12/templates/wikilegis-pvc.yaml @@ -0,0 +1,19 @@ +{{- if .Values.wikilegis.enabled }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "edemocracia.fullname" . }}-wikilegis +spec: + accessModes: + - {{ .Values.wikilegis.persistence.accessMode }} + resources: + requests: + storage: {{ .Values.wikilegis.persistence.size }} +{{- if .Values.wikilegis.persistence.storageClass }} +{{- if (eq "-" .Values.wikilegis.persistence.storageClass) }} + storageClassName: "" +{{- else }} + storageClassName: "{{ .Values.wikilegis.persistence.storageClass }}" +{{- end }} +{{- end }} +{{- end }} diff --git a/charts/edemocracia/v0.1.12/templates/wikilegis-service.yaml b/charts/edemocracia/v0.1.12/templates/wikilegis-service.yaml new file mode 100755 index 0000000..793fd2c --- /dev/null +++ b/charts/edemocracia/v0.1.12/templates/wikilegis-service.yaml @@ -0,0 +1,19 @@ +{{- if .Values.wikilegis.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: wikilegis + labels: + {{- include "edemocracia.labels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-wikilegis +spec: + type: {{ .Values.wikilegis.service.type }} + ports: + - port: {{ .Values.wikilegis.service.port }} + targetPort: 8000 + protocol: TCP + name: "8000" + selector: + {{- include "edemocracia.selectorLabels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-wikilegis +{{- end }} diff --git a/charts/edemocracia/v0.1.12/values.yaml b/charts/edemocracia/v0.1.12/values.yaml new file mode 100755 index 0000000..268d428 --- /dev/null +++ b/charts/edemocracia/v0.1.12/values.yaml @@ -0,0 +1,206 @@ +# Default values for edemocracia. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +nginx: + image: + repository: labhackercd/nginx-edemocracia + tag: 1.0.0 + pullPolicy: IfNotPresent + service: + type: ClusterIP + port: 80 + resources: + limits: + cpu: 300m + memory: 150Mi + requests: + cpu: 50m + memory: 30Mi + +discourse: + enabled: true + image: + repository: labhackercd/discourse-docker + tag: 2.0.20180703 + pullPolicy: IfNotPresent + service: + type: ClusterIP + port: 8080 + sso: + secret: "uma_chave_sso_secreta_mesmo" + persistence: + #storageClass: "" + accessMode: ReadWriteOnce + size: 500Mi + resources: + limits: + cpu: 800m + memory: 1200Mi + requests: + cpu: 100m + memory: 650Mi + +wikilegis: + enabled: true + image: + repository: labhackercd/wikilegis + tag: 2.2.0 + pullPolicy: IfNotPresent + service: + type: ClusterIP + port: 8000 + persistence: + #storageClass: "" + accessMode: ReadWriteOnce + size: 2Gi + resources: + limits: + cpu: 800m + memory: 350Mi + requests: + cpu: 100m + memory: 200Mi + + +edemocracia: + admin: + email: seitadmins@interlegis.leg.br + password: p@ssw0rd + apikey: "uma_chave_de_api_secreta_mesmo" + debug: "False" + googleAnalyticsId: "" + olarkId: "" + recaptcha: + siteKey: "altereme" + privateKey: "altereme" + socialAuth: + facebook: + key: "" + secret: "" + google: + key: "" + secret: "" + siteName: "Camara Municipal" + hostname: "edemocracia.teste.df.leg.br" + timeZone: "America/Sao_Paulo" + image: + repository: labhackercd/edemocracia + tag: 1.3.2 + pullPolicy: IfNotPresent + service: + type: ClusterIP + port: 8000 + persistence: + #storageClass: "" + accessMode: ReadWriteOnce + size: 4Gi + resources: + limits: + cpu: 500m + memory: 1350Mi + requests: + cpu: 100m + memory: 800Mi + +audiencias: + enabled: true + image: + repository: labhackercd/audiencias-publicas + tag: 3.2.0 + pullPolicy: IfNotPresent + persistence: + #storageClass: "" + accessMode: ReadWriteOnce + size: 300Mi + notifEmailList: "" + webservice: + url: "" + wordsBlacklist: "merda,cu,cuzao,cuzona,cusao,cusona,bunda,fodido,fodida,foda,foder,fodedor,fudido,fudida,fuder,chupa,chupada,chupador,chupadora,boquete,boqueteira,boquetera,boketeira,boketera,xupa,xupada,xupador,xupadora,pauduro,pauzudo,xoxota,chochota,buceta,boceta,busseta,bosseta,cacete,cassete,caceta,kacete,kassete,caralho,karalho,caraleo,pinto,pica,rola,roludo,gozado,gozada,goso,gosa,gosado,gosado,puta,puto,putinho,putinha,putona,putana,putaria,grelo,grelinho,filhodaputa,filhosdaputa,puta,fdps,siririca,punheta,trepar,trepada,trepadeira,caralho,caralhu,karalho,karalhu,tomarnocu,tomanocu,vadia,bosta,quenga,rabo,bolsa,cuzinho,piroca,pqp,puta que pariu,porra,carai,cú,viado,fdp,vtnc,corno,bicha,bixa,viado,viadinho,pederasta,filho da puta,bundao,bundão,filho de uma egua,filho de uma égua,achacador,achacadora,achacadores,achacar,babaca,bucetas,cagar,cagaram,cambada,caráleo,corja,cornão,covarde,covardes,cretino,cus,cús,cusão,cuzão,cuzinho,cuzona,danar,desgraça,drosoba,enrabar,escória,escroto,escrotas,escrotos,fodão,fodona,fudendo,fuder,idiota,imundo,imundos,ku,kú,lascar,merdas,patifaria,pilantra,pilantragem,pilantras,poha,porcaria,putas,putos,sacanagem,safadeza,safado,safados,salafrário,salafrários,vagabundagem,vagabundo,vagabundos,veadinho,veadinhos" + service: + type: ClusterIP + port: 8000 + resources: + limits: + cpu: 500m + memory: 300Mi + requests: + cpu: 50m + memory: 100Mi + + +smtp: + host: "127.0.0.1" + username: "" + password: "" + port: "25" + tls: "False" + + +# PostgreSQL definitions +postgresql: + image: + tag: 9.6.17 + pullPolicy: IfNotPresent + service: + type: ClusterIP + port: 5432 + persistence: + enabled: true + size: 2Gi + postgresqlPassword: DbP@ssw0rd + postgresqlUsername: postgres + postgresqlDatabase: root + resources: + requests: + cpu: 50m + memory: 80Mi + +# Redis definitions +redis: + image: + tag: 5.0.8 + pullPolicy: IfNotPresent + cluster: + enabled: false + usePassword: false + persistence: + enabled: true + accessModes: + - ReadWriteOnce + size: 2Gi + resources: + requests: + cpu: 50m + memory: 150Mi + limits: + cpu: 800m + memory: 1Gi + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +ingress: + enabled: true + # extra annotations only + annotations: {} + +velero: + namespace: velero + backup: + enabled: true + snapshotVolumes: false + defaultVolumesToRestic: true + # cert-manager objects are usually blocked during backup + excludedResources: + - certificates.cert-manager.io + - orders.acme.cert-manager.io + - certificaterequests.cert-manager.io + - challenges.acme.cert-manager.io + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/charts/edemocracia/v0.1.13/.helmignore b/charts/edemocracia/v0.1.13/.helmignore new file mode 100755 index 0000000..0e8a0eb --- /dev/null +++ b/charts/edemocracia/v0.1.13/.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/charts/edemocracia/v0.1.13/Chart.lock b/charts/edemocracia/v0.1.13/Chart.lock new file mode 100755 index 0000000..e2e7d86 --- /dev/null +++ b/charts/edemocracia/v0.1.13/Chart.lock @@ -0,0 +1,9 @@ +dependencies: +- name: postgresql + repository: https://charts.bitnami.com/bitnami + version: 8.6.13 +- name: redis + repository: https://charts.bitnami.com/bitnami + version: 10.6.3 +digest: sha256:988f8160c4bd6ea76a95e38d6ee19b07676affd51e6b05bc0e2ce29f488e8c9a +generated: "2020-04-07T14:22:09.711759-03:00" diff --git a/charts/edemocracia/v0.1.13/Chart.yaml b/charts/edemocracia/v0.1.13/Chart.yaml new file mode 100755 index 0000000..a9617a9 --- /dev/null +++ b/charts/edemocracia/v0.1.13/Chart.yaml @@ -0,0 +1,34 @@ +apiVersion: v2 +name: edemocracia +description: Portal que visa ampliar a participação social no processo legislativo e aproximar cidadãos e seus representantes por meio da interação digital. + +# 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.:w + +# +# 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. +version: 0.1.13 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. +appVersion: 1.3.3 + +icon: https://git.interlegis.leg.br/SEIT/rancher-charts/raw/master/images/edemocracia.png + + +# Dependencies +dependencies: +- name: postgresql + version: 8.6.13 + repository: https://charts.bitnami.com/bitnami +- name: redis + version: 10.6.3 + repository: https://charts.bitnami.com/bitnami diff --git a/charts/edemocracia/v0.1.13/app-readme.md b/charts/edemocracia/v0.1.13/app-readme.md new file mode 100755 index 0000000..ccc1cbc --- /dev/null +++ b/charts/edemocracia/v0.1.13/app-readme.md @@ -0,0 +1,3 @@ +# Sistema de participação popular para Casas Legislativas + +Utilize o formulário abaixo para configurar seu E-democracia. diff --git a/charts/edemocracia/v0.1.13/charts/postgresql-8.6.13.tgz b/charts/edemocracia/v0.1.13/charts/postgresql-8.6.13.tgz new file mode 100755 index 0000000..08f5aa9 Binary files /dev/null and b/charts/edemocracia/v0.1.13/charts/postgresql-8.6.13.tgz differ diff --git a/charts/edemocracia/v0.1.13/charts/redis-10.6.3.tgz b/charts/edemocracia/v0.1.13/charts/redis-10.6.3.tgz new file mode 100755 index 0000000..9b00dec Binary files /dev/null and b/charts/edemocracia/v0.1.13/charts/redis-10.6.3.tgz differ diff --git a/charts/edemocracia/v0.1.13/questions.yaml b/charts/edemocracia/v0.1.13/questions.yaml new file mode 100755 index 0000000..4454f72 --- /dev/null +++ b/charts/edemocracia/v0.1.13/questions.yaml @@ -0,0 +1,182 @@ +labels: + io.cattle.role: project +categories: +- Participação Popular +questions: +# Informações Básicas +- variable: edemocracia.siteName + default: "Câmara Municipal de Teste" + description: "Título que aparece no E-democracia" + label: "Nome do Site" + type: string + group: Básico + required: true +- variable: edemocracia.hostname + default: "edemocracia.teste.df.leg.br" + description: "Endereço para acesso ao E-democracia" + label: "URL do SAPL" + type: string + group: Básico + required: true +- variable: edemocracia.admin.email + default: "contato@admin.email" + description: "E-mail de contato do E-democracia" + label: Contato + type: string + group: Básico + required: true +- variable: edemocracia.admin.password + default: "altereme" + description: "Senha de administrador do E-democracia" + label: Senha admin + type: password + group: Básico + required: true + +# Recaptcha +- variable: edemocracia.recaptcha.privateKey + default: "altereme" + description: "Chave privada do Recaptcha" + label: Recaptcha PrivateKey + type: string + group: Recaptcha + required: true +- variable: edemocracia.recaptcha.siteKey + default: "altereme" + description: "Chave de site do Recaptcha" + label: Recaptcha SiteKey + type: string + group: Recaptcha + required: true + +# Login Social +- variable: edemocracia.socialAuth.facebook.key + default: "" + description: "Chave da autenticação via Facebook" + label: Facebook Key + type: string + group: Login Social + required: false +- variable: edemocracia.socialAuth.facebook.secret + default: "" + description: "Segredo da autenticação via Facebook" + label: Facebook Secret + type: string + group: Login Social + required: false +- variable: edemocracia.socialAuth.google.key + default: "" + description: "Chave da autenticação via Google" + label: Google Key + type: string + group: Login Social + required: false +- variable: edemocracia.socialAuth.google.secret + default: "" + description: "Segredo da autenticação via Google" + label: Google Secret + type: string + group: Login Social + required: false + +# Correio +- variable: smtp.host + default: "smtp.interlegis.leg.br" + description: "Servidor de envio de e-mail (SMTP)" + label: "Servidor SMTP" + type: string + group: Correio + required: false +- variable: smtp.port + default: 25 + description: "Porta de envio de E-mail (SMTP)" + type: int + label: "Porta SMTP" + required: false + group: Correio +- variable: smtp.tls + default: "False" + description: "Usar TLS ao conectar no servidor SMTP?" + label: "Usar TLS" + type: enum + group: Correio + options: + - "True" + - "False" + required: false +- variable: smtp.username + default: "" + description: "Nome de usuário para envio SMTP (vazio para nenhum)" + label: "SMTP Username" + required: false + group: Correio + type: string +- variable: smtp.password + default: "" + description: "Senha para envio SMTP (vazio para nenhuma)" + label: "SMTP Password" + required: false + group: Correio + type: string + +# PostgreSQL +- variable: postgresql.postgresqlPassword + default: "altereme" + description: "Senha do banco de dados Postgres" + label: "Senha do Postgres" + type: password + group: PostgreSQL + required: true + +# Avançado +- variable: edemocracia.timeZone + default: "America/Sao_Paulo" + description: "Fuso Horário do E-democracia" + 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: edemocracia.apikey + default: "uma_chave_de_api_secreta_mesmo" + description: "Chave de API do E-democracia" + type: string + label: "Chave de API" + required: true + group: Avançado + +- variable: discourse.enabled + default: true + description: "Habilitar o discourse (Expressão)?" + label: "Usar o Discourse?" + type: boolean + group: Avançado + +- variable: wikilegis.enabled + default: true + description: "Habilitar o Wikilegis?" + label: "Usar o Wikilegis?" + type: boolean + group: Avançado + +- variable: audiencias.enabled + default: true + description: "Habilitar o Audiências Interativas?" + label: "Usar o Audiências?" + type: boolean + group: Avançado diff --git a/charts/edemocracia/v0.1.13/templates/NOTES.txt b/charts/edemocracia/v0.1.13/templates/NOTES.txt new file mode 100755 index 0000000..70391fd --- /dev/null +++ b/charts/edemocracia/v0.1.13/templates/NOTES.txt @@ -0,0 +1,19 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }} +{{- end }} +{{- else if contains "NodePort" .Values.nginx.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "edemocracia.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.nginx.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 --namespace {{ .Release.Namespace }} svc -w {{ include "edemocracia.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "edemocracia.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.nginx.service.port }} +{{- else if contains "ClusterIP" .Values.nginx.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "edemocracia.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 +{{- end }} diff --git a/charts/edemocracia/v0.1.13/templates/_helpers.tpl b/charts/edemocracia/v0.1.13/templates/_helpers.tpl new file mode 100755 index 0000000..f4122fe --- /dev/null +++ b/charts/edemocracia/v0.1.13/templates/_helpers.tpl @@ -0,0 +1,79 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "edemocracia.name" -}} +{{- 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 "edemocracia.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 -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "edemocracia.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "edemocracia.labels" -}} +helm.sh/chart: {{ include "edemocracia.chart" . }} +{{ include "edemocracia.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Selector labels +*/}} +{{- define "edemocracia.selectorLabels" -}} +app.kubernetes.io/name: {{ include "edemocracia.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "edemocracia.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "edemocracia.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} + +{{/* +Create a default fully qualified app name for postgresql. +*/}} +{{- define "postgresql.fullname" -}} +{{- printf "%s-%s" .Release.Name "postgresql" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name for redis. +*/}} +{{- define "redis.fullname" -}} +{{- printf "%s-%s" .Release.Name "redis" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + + diff --git a/charts/edemocracia/v0.1.13/templates/audiencias-pvc.yaml b/charts/edemocracia/v0.1.13/templates/audiencias-pvc.yaml new file mode 100755 index 0000000..ae75435 --- /dev/null +++ b/charts/edemocracia/v0.1.13/templates/audiencias-pvc.yaml @@ -0,0 +1,19 @@ +{{- if .Values.audiencias.enabled }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "edemocracia.fullname" . }}-audiencias +spec: + accessModes: + - {{ .Values.audiencias.persistence.accessMode }} + resources: + requests: + storage: {{ .Values.audiencias.persistence.size }} +{{- if .Values.audiencias.persistence.storageClass }} +{{- if (eq "-" .Values.audiencias.persistence.storageClass) }} + storageClassName: "" +{{- else }} + storageClassName: "{{ .Values.audiencias.persistence.storageClass }}" +{{- end }} +{{- end }} +{{- end }} diff --git a/charts/edemocracia/v0.1.13/templates/audienciasweb-deployment.yaml b/charts/edemocracia/v0.1.13/templates/audienciasweb-deployment.yaml new file mode 100755 index 0000000..7d0f440 --- /dev/null +++ b/charts/edemocracia/v0.1.13/templates/audienciasweb-deployment.yaml @@ -0,0 +1,147 @@ +{{- if .Values.audiencias.enabled }} +{{- $edemoUrl := .Values.edemocracia.hostname -}} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "edemocracia.fullname" . }}-audienciasweb + labels: + {{- include "edemocracia.labels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-audienciasweb +spec: + selector: + matchLabels: + {{- include "edemocracia.selectorLabels" . | nindent 6 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-audienciasweb + app.kubernetes.io/component: audiencias + strategy: + type: Recreate + template: + metadata: + labels: + {{- include "edemocracia.selectorLabels" . | nindent 8 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-audienciasweb + app.kubernetes.io/component: audiencias + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + containers: + - name: {{ include "edemocracia.fullname" . }}-audienciasweb + image: "{{ .Values.audiencias.image.repository }}:{{ .Values.audiencias.image.tag }}" + imagePullPolicy: {{ .Values.audiencias.image.pullPolicy }} + args: + - ./start-web.sh + env: + - name: ADMIN_EMAIL + value: {{ .Values.edemocracia.admin.email | quote }} + - name: ADMIN_PASSWORD + value: {{ .Values.edemocracia.admin.password | quote }} + - name: ADMIN_USERNAME + value: admin + - name: ALLOWED_HOSTS + value: audienciasweb, localhost, 127.0.0.1, "{{ $edemoUrl }}" + - name: COMPRESS_OFFLINE + value: "True" + - name: DATABASE_ENGINE + value: postgresql_psycopg2 + - name: DATABASE_HOST + value: {{ (include "postgresql.fullname" .) }} + - name: DATABASE_NAME + value: audiencias + - name: DATABASE_PASSWORD + value: {{ .Values.postgresql.postgresqlPassword | quote }} + - name: DATABASE_PORT + value: "5432" + - name: DATABASE_USER + value: {{ .Values.postgresql.postgresqlUsername | quote }} + - name: DEBUG + value: "False" + - name: DEFAULT_FROM_EMAIL + value: '"Portal e-Democracia[audiencias]" <{{ .Values.edemocracia.admin.email }}>' + - name: DJANGO_SECRET_KEY + value: {{ .Values.edemocracia.apikey | quote }} + - name: EMAIL_HOST + value: {{ .Values.smtp.host | quote }} + - name: EMAIL_HOST_PASSWORD + value: {{ .Values.smtp.password | quote }} + - name: EMAIL_HOST_USER + value: {{ .Values.smtp.username | quote }} + - name: EMAIL_PORT + value: {{ .Values.smtp.port | quote }} + - name: EMAIL_USE_TLS + value: {{ .Values.smtp.tls | quote}} + - name: ENABLE_REMOTE_USER + value: "True" + - name: FORCE_SCRIPT_NAME + value: /audiencias + - name: GOOGLE_ANALYTICS_ID + value: {{ .Values.edemocracia.googleAnalyticsId | quote }} + - name: LOGIN_REDIRECT_URL + value: / + - name: LOGIN_URL + value: / + - name: LOGOUT_REDIRECT_URL + value: / + - name: NOTIFICATION_EMAIL_LIST + value: "{{ .Values.edemocracia.admin.email }},{{ .Values.audiencias.notifEmailList }}" + - name: OLARK_ID + value: {{ .Values.edemocracia.olarkId | quote }} + - name: RECAPTCHA_PRIVATE_KEY + value: {{ .Values.edemocracia.recaptcha.privateKey | quote }} + - name: RECAPTCHA_SITE_KEY + value: {{ .Values.edemocracia.recaptcha.siteKey | quote }} + - name: REDIS_SERVER + value: {{ (include "redis.fullname" .) }}-master + - name: SESSION_COOKIE_NAME + value: audiencias_session + - name: SITE_DOMAIN + value: "{{ $edemoUrl }}" + - name: SITE_NAME + value: {{ .Values.edemocracia.siteName | quote }} + - name: STATIC_URL + value: /audiencias/static/ + - name: URL_PREFIX + value: audiencias + - name: WEBSERVICE_URL + value: {{ .Values.audiencias.webservice.url | quote }} + - name: WORDS_BLACK_LIST + value: {{ .Values.audiencias.wordsBlacklist | quote }} + resources: + {{- toYaml .Values.audiencias.resources | nindent 12 }} + volumeMounts: + - mountPath: /var/labhacker/audiencias/public/ + name: {{ include "edemocracia.fullname" . }}-audiencias + restartPolicy: Always + serviceAccountName: "" + volumes: + - name: {{ include "edemocracia.fullname" . }}-audiencias + persistentVolumeClaim: + claimName: {{ include "edemocracia.fullname" . }}-audiencias + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + affinity: + podAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - {{ include "edemocracia.name" . }} + - key: app.kubernetes.io/instance + operator: In + values: + - {{ .Release.Name }} + - key: app.kubernetes.io/component + operator: In + values: + - edemocracia + topologyKey: kubernetes.io/hostname + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} +{{- end }} diff --git a/charts/edemocracia/v0.1.13/templates/audienciasweb-service.yaml b/charts/edemocracia/v0.1.13/templates/audienciasweb-service.yaml new file mode 100755 index 0000000..4208451 --- /dev/null +++ b/charts/edemocracia/v0.1.13/templates/audienciasweb-service.yaml @@ -0,0 +1,19 @@ +{{- if .Values.audiencias.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: audienciasweb + labels: + {{- include "edemocracia.labels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-audienciasweb +spec: + type: {{ .Values.audiencias.service.type }} + ports: + - port: {{ .Values.audiencias.service.port }} + targetPort: 8000 + protocol: TCP + name: "8000" + selector: + {{- include "edemocracia.selectorLabels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-audienciasweb +{{- end }} diff --git a/charts/edemocracia/v0.1.13/templates/audienciasworker-deployment.yaml b/charts/edemocracia/v0.1.13/templates/audienciasworker-deployment.yaml new file mode 100755 index 0000000..eebeeb8 --- /dev/null +++ b/charts/edemocracia/v0.1.13/templates/audienciasworker-deployment.yaml @@ -0,0 +1,147 @@ +{{- if .Values.audiencias.enabled }} +{{- $edemoUrl := .Values.edemocracia.hostname -}} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "edemocracia.fullname" . }}-audienciasworker + labels: + {{- include "edemocracia.labels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-audienciasworker +spec: + selector: + matchLabels: + {{- include "edemocracia.selectorLabels" . | nindent 6 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-audienciasworker + app.kubernetes.io/component: audiencias + strategy: + type: Recreate + template: + metadata: + labels: + {{- include "edemocracia.selectorLabels" . | nindent 8 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-audienciasworker + app.kubernetes.io/component: audiencias + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + containers: + - name: {{ include "edemocracia.fullname" . }}-audienciasworker + image: "{{ .Values.audiencias.image.repository }}:{{ .Values.audiencias.image.tag }}" + imagePullPolicy: {{ .Values.audiencias.image.pullPolicy }} + args: + - ./start-worker.sh + env: + - name: ADMIN_EMAIL + value: {{ .Values.edemocracia.admin.email | quote }} + - name: ADMIN_PASSWORD + value: {{ .Values.edemocracia.admin.password | quote }} + - name: ADMIN_USERNAME + value: admin + - name: ALLOWED_HOSTS + value: audienciasweb, audienciasworker, localhost, 127.0.0.1, "{{ $edemoUrl }}" + - name: COMPRESS_OFFLINE + value: "True" + - name: DATABASE_ENGINE + value: postgresql_psycopg2 + - name: DATABASE_HOST + value: {{ (include "postgresql.fullname" .) }} + - name: DATABASE_NAME + value: audiencias + - name: DATABASE_PASSWORD + value: {{ .Values.postgresql.postgresqlPassword | quote }} + - name: DATABASE_PORT + value: "5432" + - name: DATABASE_USER + value: {{ .Values.postgresql.postgresqlUsername | quote }} + - name: DEBUG + value: "False" + - name: DEFAULT_FROM_EMAIL + value: '"Portal e-Democracia[audiencias]" <{{ .Values.edemocracia.admin.email }}>' + - name: DJANGO_SECRET_KEY + value: {{ .Values.edemocracia.apikey | quote }} + - name: EMAIL_HOST + value: {{ .Values.smtp.host | quote }} + - name: EMAIL_HOST_PASSWORD + value: {{ .Values.smtp.password | quote }} + - name: EMAIL_HOST_USER + value: {{ .Values.smtp.username | quote }} + - name: EMAIL_PORT + value: {{ .Values.smtp.port | quote }} + - name: EMAIL_USE_TLS + value: {{ .Values.smtp.tls | quote }} + - name: ENABLE_REMOTE_USER + value: "True" + - name: FORCE_SCRIPT_NAME + value: /audiencias + - name: GOOGLE_ANALYTICS_ID + value: {{ .Values.edemocracia.googleAnalyticsId }} + - name: LOGIN_REDIRECT_URL + value: / + - name: LOGIN_URL + value: / + - name: LOGOUT_REDIRECT_URL + value: / + - name: NOTIFICATION_EMAIL_LIST + value: "{{ .Values.edemocracia.admin.email }},{{ .Values.audiencias.notifEmailList }}" + - name: OLARK_ID + value: {{ .Values.edemocracia.olarkId | quote }} + - name: RECAPTCHA_PRIVATE_KEY + value: {{ .Values.edemocracia.recaptcha.privateKey | quote }} + - name: RECAPTCHA_SITE_KEY + value: {{ .Values.edemocracia.recaptcha.siteKey | quote }} + - name: REDIS_SERVER + value: {{ (include "redis.fullname" .) }}-master + - name: SESSION_COOKIE_NAME + value: audiencias_session + - name: SITE_DOMAIN + value: "{{ $edemoUrl }}" + - name: SITE_NAME + value: {{ .Values.edemocracia.siteName | quote }} + - name: STATIC_URL + value: /audiencias/static/ + - name: URL_PREFIX + value: audiencias + - name: WEBSERVICE_URL + value: {{ .Values.audiencias.webservice.url | quote }} + - name: WORDS_BLACK_LIST + value: {{ .Values.audiencias.wordsBlacklist | quote }} + resources: + {{- toYaml .Values.audiencias.resources | nindent 12 }} + volumeMounts: + - mountPath: /var/labhacker/audiencias/public/ + name: {{ include "edemocracia.fullname" . }}-audiencias + restartPolicy: Always + serviceAccountName: "" + volumes: + - name: {{ include "edemocracia.fullname" . }}-audiencias + persistentVolumeClaim: + claimName: {{ include "edemocracia.fullname" . }}-audiencias + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + affinity: + podAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - {{ include "edemocracia.name" . }} + - key: app.kubernetes.io/instance + operator: In + values: + - {{ .Release.Name }} + - key: app.kubernetes.io/component + operator: In + values: + - edemocracia + topologyKey: kubernetes.io/hostname + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} +{{- end }} diff --git a/charts/edemocracia/v0.1.13/templates/discourse-deployment.yaml b/charts/edemocracia/v0.1.13/templates/discourse-deployment.yaml new file mode 100755 index 0000000..f56af38 --- /dev/null +++ b/charts/edemocracia/v0.1.13/templates/discourse-deployment.yaml @@ -0,0 +1,144 @@ +{{- if .Values.discourse.enabled }} +{{- $edemoUrl := .Values.edemocracia.hostname -}} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "edemocracia.fullname" . }}-discourse + labels: + {{- include "edemocracia.labels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-discourse +spec: + selector: + matchLabels: + {{- include "edemocracia.selectorLabels" . | nindent 6 }} + app.kubernetes.io/component: discourse + io.kompose.service: {{ include "edemocracia.fullname" . }}-discourse + strategy: + type: Recreate + template: + metadata: + labels: + {{- include "edemocracia.selectorLabels" . | nindent 8 }} + app.kubernetes.io/component: discourse + io.kompose.service: {{ include "edemocracia.fullname" . }}-discourse + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + initContainers: + - image: "{{ .Values.discourse.image.repository }}:{{ .Values.discourse.image.tag }}" + name: {{ include "edemocracia.fullname" . }}-discourse-cpimgs + command: + - "cp" + - "-au" + - "/var/www/discourse/public/images/." + - "/publicimgs/" + volumeMounts: + - mountPath: /publicimgs/ + subPath: images + name: {{ include "edemocracia.fullname" . }}-discourse + containers: + - args: + - ./start-web.sh + env: + - name: ADMIN_EMAIL + value: {{ .Values.edemocracia.admin.email | quote }} + - name: ADMIN_PASSWORD + value: {{ .Values.edemocracia.admin.password | quote }} + - name: ADMIN_USERNAME + value: admin + - name: DISCOURSE_CONTACT_EMAIL + value: {{ .Values.edemocracia.admin.email | quote }} + - name: DISCOURSE_CONTACT_URL + value: {{ $edemoUrl }} + - name: DISCOURSE_DB_HOST + value: {{ (include "postgresql.fullname" .) }} + - name: DISCOURSE_DB_NAME + value: discourse + - name: DISCOURSE_DB_PASSWORD + value: {{ .Values.postgresql.postgresqlPassword | quote }} + - name: DISCOURSE_DB_PORT + value: "5432" + - name: DISCOURSE_DB_USERNAME + value: {{ .Values.postgresql.postgresqlUsername | quote}} + - name: DISCOURSE_DEVELOPER_EMAILS + - name: DISCOURSE_FORCE_HOSTNAME + value: {{ $edemoUrl }}\/expressao + - name: DISCOURSE_HOSTNAME + value: {{ $edemoUrl }}\/expressao + - name: DISCOURSE_NOTIFICATION_EMAIL + value: {{ .Values.edemocracia.admin.email }} + - name: DISCOURSE_REDIS_HOST + value: {{ (include "redis.fullname" .) }}-master + - name: DISCOURSE_REDIS_PORT + value: "6379" + - name: DISCOURSE_RELATIVE_URL_ROOT + value: /expressao + - name: DISCOURSE_SMTP_ADDRESS + value: {{ .Values.smtp.host | quote }} + - name: DISCOURSE_SMTP_PASSWORD + value: {{ .Values.smtp.password | quote }} + - name: DISCOURSE_SMTP_PORT + value: {{ .Values.smtp.port | quote }} + - name: DISCOURSE_SMTP_USER_NAME + value: {{ .Values.smtp.username | quote }} + - name: DISCOURSE_SSO_SECRET + value: {{ .Values.discourse.sso.secret | quote }} + - name: DISCOURSE_SSO_URL + value: "https://{{ $edemoUrl }}" + - name: RAILS_ENV + value: production + image: {{.Values.discourse.image.repository}}:{{ .Values.discourse.image.tag }} + imagePullPolicy: {{ .Values.discourse.image.pullPolicy }} + name: {{ include "edemocracia.fullname" . }}-discourse + ports: + - containerPort: 8080 + resources: + {{- toYaml .Values.discourse.resources | nindent 12 }} + volumeMounts: + - mountPath: /var/www/discourse/public/assets/ + name: {{ include "edemocracia.fullname" . }}-discourse + subPath: assets + - mountPath: /var/www/discourse/public/javascripts/ + name: {{ include "edemocracia.fullname" . }}-discourse + subPath: javascripts + - mountPath: /var/www/discourse/public/images/ + name: {{ include "edemocracia.fullname" . }}-discourse + subPath: images + - mountPath: /var/www/discourse/tmp/stylesheet-cache/ + name: {{ include "edemocracia.fullname" . }}-discourse + subPath: stylesheet-cache + restartPolicy: Always + serviceAccountName: "" + volumes: + - name: {{ include "edemocracia.fullname" . }}-discourse + persistentVolumeClaim: + claimName: {{ include "edemocracia.fullname" . }}-discourse + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + affinity: + podAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - {{ include "edemocracia.name" . }} + - key: app.kubernetes.io/instance + operator: In + values: + - {{ .Release.Name }} + - key: app.kubernetes.io/component + operator: In + values: + - edemocracia + topologyKey: kubernetes.io/hostname + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} +{{- end }} diff --git a/charts/edemocracia/v0.1.13/templates/discourse-pvc.yaml b/charts/edemocracia/v0.1.13/templates/discourse-pvc.yaml new file mode 100755 index 0000000..d9e7804 --- /dev/null +++ b/charts/edemocracia/v0.1.13/templates/discourse-pvc.yaml @@ -0,0 +1,19 @@ +{{- if .Values.discourse.enabled }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "edemocracia.fullname" . }}-discourse +spec: + accessModes: + - {{ .Values.discourse.persistence.accessMode }} + resources: + requests: + storage: {{ .Values.discourse.persistence.size }} +{{- if .Values.discourse.persistence.storageClass }} +{{- if (eq "-" .Values.discourse.persistence.storageClass) }} + storageClassName: "" +{{- else }} + storageClassName: "{{ .Values.discourse.persistence.storageClass }}" +{{- end }} +{{- end }} +{{- end }} diff --git a/charts/edemocracia/v0.1.13/templates/discourse-service.yaml b/charts/edemocracia/v0.1.13/templates/discourse-service.yaml new file mode 100755 index 0000000..c0c96f0 --- /dev/null +++ b/charts/edemocracia/v0.1.13/templates/discourse-service.yaml @@ -0,0 +1,19 @@ +{{- if .Values.discourse.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: discourse + labels: + {{- include "edemocracia.labels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-discourse +spec: + type: {{ .Values.discourse.service.type }} + ports: + - port: {{ .Values.discourse.service.port }} + targetPort: 8080 + protocol: TCP + name: "8080" + selector: + {{- include "edemocracia.selectorLabels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-discourse +{{- end }} diff --git a/charts/edemocracia/v0.1.13/templates/edemocracia-deployment.yaml b/charts/edemocracia/v0.1.13/templates/edemocracia-deployment.yaml new file mode 100755 index 0000000..f07dceb --- /dev/null +++ b/charts/edemocracia/v0.1.13/templates/edemocracia-deployment.yaml @@ -0,0 +1,165 @@ +{{- $edemoUrl := .Values.edemocracia.hostname -}} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "edemocracia.fullname" . }}-edemocracia + labels: + {{- include "edemocracia.labels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-edemocracia +spec: + selector: + matchLabels: + {{- include "edemocracia.selectorLabels" . | nindent 6 }} + app.kubernetes.io/component: edemocracia + io.kompose.service: {{ include "edemocracia.fullname" . }}-edemocracia + strategy: + type: Recreate + template: + metadata: + labels: + {{- include "edemocracia.selectorLabels" . | nindent 8 }} + app.kubernetes.io/component: edemocracia + io.kompose.service: {{ include "edemocracia.fullname" . }}-edemocracia + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + initContainers: + - image: "{{ .Values.edemocracia.image.repository }}:{{ .Values.edemocracia.image.tag }}" + name: {{ include "edemocracia.fullname" . }}-edemocracia-cpmedia + command: + - "cp" + - "-au" + - "/var/labhacker/edemocracia/src/public/media/" + - "/srcpublic/" + volumeMounts: + - mountPath: /srcpublic + name: {{ include "edemocracia.fullname" . }}-edemocracia + containers: + - name: {{ include "edemocracia.fullname" . }}-edemocracia + image: "{{ .Values.edemocracia.image.repository }}:{{ .Values.edemocracia.image.tag }}" + imagePullPolicy: {{ .Values.edemocracia.image.pullPolicy }} + args: + - ./runserver-production + env: + - name: ADMIN_EMAIL + value: {{ .Values.edemocracia.admin.email | quote }} + - name: ADMIN_PASSWORD + value: {{ .Values.edemocracia.admin.password | quote }} + - name: ADMIN_USERNAME + value: admin + - name: ALLOWED_HOSTS + value: "{{ $edemoUrl }}" + - name: AUDIENCIAS_API_KEY + value: {{ .Values.edemocracia.apikey | quote }} + - name: AUDIENCIAS_ENABLED + {{- if .Values.audiencias.enabled }} + value: "True" + {{- else }} + value: "False" + {{- end }} + - name: AUDIENCIAS_UPSTREAM + value: http://audienciasweb:8000/audiencias + - name: DATABASE_ENGINE + value: postgresql_psycopg2 + - name: DATABASE_HOST + value: {{ (include "postgresql.fullname" .) }} + - name: DATABASE_NAME + value: edemocracia + - name: DATABASE_PASSWORD + value: {{ .Values.postgresql.postgresqlPassword | quote }} + - name: DATABASE_PORT + value: "5432" + - name: DATABASE_USER + value: {{ .Values.postgresql.postgresqlUsername | quote }} + - name: DEBUG + value: "{{ .Values.edemocracia.debug }}" + - name: DEFAULT_FROM_EMAIL + value: '"Portal e-Democracia" <{{ .Values.edemocracia.admin.email }}>' + - name: DISCOURSE_ENABLED + {{- if .Values.discourse.enabled }} + value: "True" + {{- else }} + value: "False" + {{- end }} + - name: DISCOURSE_SSO_SECRET + value: {{ .Values.discourse.sso.secret | quote }} + # Workaround for a bug in runserver-production script, which does not check for DISCOURSE_ENABLED variable + - name: DISCOURSE_UPSTREAM + {{- if .Values.discourse.enabled }} + value: http://discourse:8080/expressao + {{- else }} + value: "--version" + {{- end }} + - name: EMAIL_BACKEND + value: django.core.mail.backends.smtp.EmailBackend + - name: EMAIL_HOST + value: {{ .Values.smtp.host | quote }} + - name: EMAIL_HOST_PASSWORD + value: {{ .Values.smtp.password | quote }} + - name: EMAIL_HOST_USER + value: {{ .Values.smtp.username | quote }} + - name: EMAIL_PORT + value: {{ .Values.smtp.port | quote }} + - name: EMAIL_USE_TLS + value: {{ .Values.smtp.tls | quote }} + - name: GOOGLE_ANALYTICS_ID + value: {{ .Values.edemocracia.googleAnalyticsId | quote }} + - name: OLARK_ID + value: {{ .Values.edemocracia.olarkId | quote }} + - name: RECAPTCHA_PRIVATE_KEY + value: {{ .Values.edemocracia.recaptcha.privateKey | quote }} + - name: RECAPTCHA_SITE_KEY + value: {{ .Values.edemocracia.recaptcha.siteKey | quote }} + - name: SECRET_KEY + value: {{ .Values.edemocracia.apikey | quote }} + - name: SITE_NAME + value: {{ .Values.edemocracia.siteName | quote }} + - name: SITE_URL + value: "https://{{ $edemoUrl }}" + - name: SOCIAL_AUTH_FACEBOOK_KEY + value: {{ .Values.edemocracia.socialAuth.facebook.key | quote }} + - name: SOCIAL_AUTH_FACEBOOK_SECRET + value: {{ .Values.edemocracia.socialAuth.facebook.secret | quote }} + - name: SOCIAL_AUTH_GOOGLE_OAUTH2_KEY + value: {{ .Values.edemocracia.socialAuth.google.key | quote }} + - name: SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET + value: {{ .Values.edemocracia.socialAuth.google.secret | quote }} + - name: SOCIAL_AUTH_REDIRECT_IS_HTTPS + value: "True" + - name: WIKILEGIS_API_KEY + value: {{ .Values.edemocracia.apikey | quote }} + - name: WIKILEGIS_API_URL + value: /api/v1/ + - name: WIKILEGIS_ENABLED + {{- if .Values.wikilegis.enabled }} + value: "True" + {{- else }} + value: "False" + {{- end }} + - name: WIKILEGIS_UPSTREAM + value: http://wikilegis:8000 + resources: + {{- toYaml .Values.edemocracia.resources | nindent 12 }} + volumeMounts: + - mountPath: /var/labhacker/edemocracia/src/public/ + name: {{ include "edemocracia.fullname" . }}-edemocracia + restartPolicy: Always + serviceAccountName: "" + volumes: + - name: {{ include "edemocracia.fullname" . }}-edemocracia + persistentVolumeClaim: + claimName: {{ include "edemocracia.fullname" . }}-edemocracia + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/edemocracia/v0.1.13/templates/edemocracia-pvc.yaml b/charts/edemocracia/v0.1.13/templates/edemocracia-pvc.yaml new file mode 100755 index 0000000..0247fce --- /dev/null +++ b/charts/edemocracia/v0.1.13/templates/edemocracia-pvc.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "edemocracia.fullname" . }}-edemocracia +spec: + accessModes: + - {{ .Values.edemocracia.persistence.accessMode }} + resources: + requests: + storage: {{ .Values.edemocracia.persistence.size }} +{{- if .Values.edemocracia.persistence.storageClass }} +{{- if (eq "-" .Values.edemocracia.persistence.storageClass) }} + storageClassName: "" +{{- else }} + storageClassName: "{{ .Values.edemocracia.persistence.storageClass }}" +{{- end }} +{{- end }} diff --git a/charts/edemocracia/v0.1.13/templates/edemocracia-service.yaml b/charts/edemocracia/v0.1.13/templates/edemocracia-service.yaml new file mode 100755 index 0000000..2e6350f --- /dev/null +++ b/charts/edemocracia/v0.1.13/templates/edemocracia-service.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: edemocracia + labels: + {{- include "edemocracia.labels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-edemocracia +spec: + type: {{ .Values.edemocracia.service.type }} + ports: + - port: {{ .Values.edemocracia.service.port }} + targetPort: 8000 + protocol: TCP + name: "8000" + selector: + {{- include "edemocracia.selectorLabels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-edemocracia diff --git a/charts/edemocracia/v0.1.13/templates/ingress.yaml b/charts/edemocracia/v0.1.13/templates/ingress.yaml new file mode 100755 index 0000000..94b3425 --- /dev/null +++ b/charts/edemocracia/v0.1.13/templates/ingress.yaml @@ -0,0 +1,32 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "edemocracia.fullname" . -}} +{{- $hostName := .Values.edemocracia.hostname -}} +{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "edemocracia.labels" . | nindent 4 }} + annotations: + cert-manager.io/cluster-issuer: "letsencrypt-prod" + {{- with .Values.ingress.annotations }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + tls: + - hosts: + - "{{ $hostName }}" + secretName: {{ $hostName | replace "." "-" }}-tls + rules: + - host: "{{ $hostName }}" + http: + paths: + - path: / + backend: + serviceName: nginx + servicePort: http +{{- end }} diff --git a/charts/edemocracia/v0.1.13/templates/nginx-deployment.yaml b/charts/edemocracia/v0.1.13/templates/nginx-deployment.yaml new file mode 100755 index 0000000..b0ce573 --- /dev/null +++ b/charts/edemocracia/v0.1.13/templates/nginx-deployment.yaml @@ -0,0 +1,120 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "edemocracia.fullname" . }}-nginx + labels: + {{- include "edemocracia.labels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-nginx +spec: + selector: + matchLabels: + {{- include "edemocracia.selectorLabels" . | nindent 6 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-nginx + strategy: + type: Recreate + template: + metadata: + labels: + {{- include "edemocracia.selectorLabels" . | nindent 8 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-nginx + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + containers: + - name: {{ .Chart.Name }}-nginx + image: "{{ .Values.nginx.image.repository }}:{{ .Values.nginx.image.tag }}" + imagePullPolicy: {{ .Values.nginx.image.pullPolicy }} + ports: + - name: http + containerPort: 80 + protocol: TCP + livenessProbe: + failureThreshold: 3 + periodSeconds: 10 + successThreshold: 1 + tcpSocket: + port: http + timeoutSeconds: 1 + readinessProbe: + failureThreshold: 3 + periodSeconds: 10 + successThreshold: 1 + tcpSocket: + port: http + timeoutSeconds: 1 + resources: + {{- toYaml .Values.nginx.resources | nindent 12 }} + volumeMounts: + - mountPath: /var/labhacker/edemocracia/src/public/ + name: {{ include "edemocracia.fullname" . }}-edemocracia + {{- if .Values.wikilegis.enabled }} + - mountPath: /var/labhacker/wikilegis/wikilegis/public/ + name: {{ include "edemocracia.fullname" . }}-wikilegis + {{- end }} + {{- if .Values.audiencias.enabled }} + - mountPath: /var/labhacker/audiencias/public/ + name: {{ include "edemocracia.fullname" . }}-audiencias + {{- end }} + {{- if .Values.discourse.enabled }} + - mountPath: /var/www/discourse/public/assets/ + name: {{ include "edemocracia.fullname" . }}-discourse + subPath: assets + - mountPath: /var/www/discourse/public/javascripts/ + name: {{ include "edemocracia.fullname" . }}-discourse + subPath: javascripts + - mountPath: /var/www/discourse/public/images/ + name: {{ include "edemocracia.fullname" . }}-discourse + subPath: images + - mountPath: /var/www/discourse/tmp/stylesheet-cache/ + name: {{ include "edemocracia.fullname" . }}-discourse + subPath: stylesheet-cache + {{- end }} + restartPolicy: Always + serviceAccountName: "" + volumes: + - name: {{ include "edemocracia.fullname" . }}-edemocracia + persistentVolumeClaim: + claimName: {{ include "edemocracia.fullname" . }}-edemocracia + {{- if .Values.wikilegis.enabled }} + - name: {{ include "edemocracia.fullname" . }}-wikilegis + persistentVolumeClaim: + claimName: {{ include "edemocracia.fullname" . }}-wikilegis + {{- end }} + {{- if .Values.audiencias.enabled }} + - name: {{ include "edemocracia.fullname" . }}-audiencias + persistentVolumeClaim: + claimName: {{ include "edemocracia.fullname" . }}-audiencias + {{- end }} + {{- if .Values.discourse.enabled }} + - name: {{ include "edemocracia.fullname" . }}-discourse + persistentVolumeClaim: + claimName: {{ include "edemocracia.fullname" . }}-discourse + {{- end }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + affinity: + podAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - {{ include "edemocracia.name" . }} + - key: app.kubernetes.io/instance + operator: In + values: + - {{ .Release.Name }} + - key: app.kubernetes.io/component + operator: In + values: + - edemocracia + topologyKey: kubernetes.io/hostname + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/edemocracia/v0.1.13/templates/nginx-service.yaml b/charts/edemocracia/v0.1.13/templates/nginx-service.yaml new file mode 100755 index 0000000..51f175c --- /dev/null +++ b/charts/edemocracia/v0.1.13/templates/nginx-service.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: nginx + labels: + {{- include "edemocracia.labels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-nginx +spec: + type: {{ .Values.nginx.service.type }} + ports: + - port: {{ .Values.nginx.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "edemocracia.selectorLabels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-nginx diff --git a/charts/edemocracia/v0.1.13/templates/velero-schedule-monthly.yaml b/charts/edemocracia/v0.1.13/templates/velero-schedule-monthly.yaml new file mode 100755 index 0000000..04cbc3a --- /dev/null +++ b/charts/edemocracia/v0.1.13/templates/velero-schedule-monthly.yaml @@ -0,0 +1,39 @@ +{{- if .Values.velero.backup.enabled }} +apiVersion: velero.io/v1 +kind: Schedule +metadata: + name: {{ include "edemocracia.fullname" . }}-monthly + namespace: {{ .Values.velero.namespace }} +spec: + # generate a random backup time between 1 and 5 AM on first day of every month + schedule: {{ mod (randNumeric 2) 60 }} {{ mod (randNumeric 1) 6 }} 1 * * + template: + includedNamespaces: + - {{ .Release.Namespace }} + {{- with .Values.velero.backup.excludedResources }} + excludedResources: + {{- toYaml . | nindent 8 }} + {{- end }} + snapshotVolumes: {{ .Values.velero.backup.snapshotVolumes }} + # every weekday backup is good for the next year (365 days) + ttl: 8760h0m0s + defaultVolumesToRestic: {{ .Values.velero.backup.defaultVolumesToRestic }} + hooks: + resources: + - name: pgdump + includedResources: + - pods + labelSelector: + matchLabels: + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/name: postgresql + pre: + - exec: + command: + - "/bin/bash" + - "-c" + - "PGPASSWORD=$POSTGRES_PASSWORD /opt/bitnami/postgresql/bin/pg_dumpall -U postgres > /bitnami/postgresql/all.dump" + timeout: 360s + onError: Continue + useOwnerReferencesInBackup: false +{{- end }} \ No newline at end of file diff --git a/charts/edemocracia/v0.1.13/templates/velero-schedule-weekdays.yaml b/charts/edemocracia/v0.1.13/templates/velero-schedule-weekdays.yaml new file mode 100755 index 0000000..ea53bda --- /dev/null +++ b/charts/edemocracia/v0.1.13/templates/velero-schedule-weekdays.yaml @@ -0,0 +1,39 @@ +{{- if .Values.velero.backup.enabled }} +apiVersion: velero.io/v1 +kind: Schedule +metadata: + name: {{ include "edemocracia.fullname" . }}-weekdays + namespace: {{ .Values.velero.namespace }} +spec: + # generate a random backup time between 1 and 5 AM on weekdays + schedule: {{ mod (randNumeric 2) 60 }} {{ mod (randNumeric 1) 6 }} * * 1-5 + template: + includedNamespaces: + - {{ .Release.Namespace }} + {{- with .Values.velero.backup.excludedResources }} + excludedResources: + {{- toYaml . | nindent 8 }} + {{- end }} + snapshotVolumes: {{ .Values.velero.backup.snapshotVolumes }} + # every weekday backup is good for the next week (7 days) + ttl: 168h0m0s + defaultVolumesToRestic: {{ .Values.velero.backup.defaultVolumesToRestic }} + hooks: + resources: + - name: pgdump + includedResources: + - pods + labelSelector: + matchLabels: + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/name: postgresql + pre: + - exec: + command: + - "/bin/bash" + - "-c" + - "PGPASSWORD=$POSTGRES_PASSWORD /opt/bitnami/postgresql/bin/pg_dumpall -U postgres > /bitnami/postgresql/all.dump" + timeout: 360s + onError: Continue + useOwnerReferencesInBackup: false +{{- end }} \ No newline at end of file diff --git a/charts/edemocracia/v0.1.13/templates/velero-schedule-weekly.yaml b/charts/edemocracia/v0.1.13/templates/velero-schedule-weekly.yaml new file mode 100755 index 0000000..e9a09a3 --- /dev/null +++ b/charts/edemocracia/v0.1.13/templates/velero-schedule-weekly.yaml @@ -0,0 +1,39 @@ +{{- if .Values.velero.backup.enabled }} +apiVersion: velero.io/v1 +kind: Schedule +metadata: + name: {{ include "edemocracia.fullname" . }}-weekly + namespace: {{ .Values.velero.namespace }} +spec: + # generate a random backup time between 1 and 5 AM on sunday + schedule: {{ mod (randNumeric 2) 60 }} {{ mod (randNumeric 1) 6 }} * * 0 + template: + includedNamespaces: + - {{ .Release.Namespace }} + {{- with .Values.velero.backup.excludedResources }} + excludedResources: + {{- toYaml . | nindent 8 }} + {{- end }} + snapshotVolumes: {{ .Values.velero.backup.snapshotVolumes }} + # every sunday backup is good for 30 days (aprox. 1 month) + ttl: 744h0m0s + defaultVolumesToRestic: {{ .Values.velero.backup.defaultVolumesToRestic }} + hooks: + resources: + - name: pgdump + includedResources: + - pods + labelSelector: + matchLabels: + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/name: postgresql + pre: + - exec: + command: + - "/bin/bash" + - "-c" + - "PGPASSWORD=$POSTGRES_PASSWORD /opt/bitnami/postgresql/bin/pg_dumpall -U postgres > /bitnami/postgresql/all.dump" + timeout: 360s + onError: Continue + useOwnerReferencesInBackup: false +{{- end }} \ No newline at end of file diff --git a/charts/edemocracia/v0.1.13/templates/wikilegis-deployment.yaml b/charts/edemocracia/v0.1.13/templates/wikilegis-deployment.yaml new file mode 100755 index 0000000..680b6b3 --- /dev/null +++ b/charts/edemocracia/v0.1.13/templates/wikilegis-deployment.yaml @@ -0,0 +1,144 @@ +{{- if .Values.wikilegis.enabled }} +{{- $edemoUrl := .Values.edemocracia.hostname -}} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "edemocracia.fullname" . }}-wikilegis + labels: + {{- include "edemocracia.labels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-wikilegis +spec: + selector: + matchLabels: + {{- include "edemocracia.selectorLabels" . | nindent 6 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-wikilegis + app.kubernetes.io/component: wikilegis + strategy: + type: Recreate + template: + metadata: + labels: + {{- include "edemocracia.selectorLabels" . | nindent 8 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-wikilegis + app.kubernetes.io/component: wikilegis + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + initContainers: + - image: "{{ .Values.wikilegis.image.repository }}:{{ .Values.wikilegis.image.tag }}" + name: {{ include "edemocracia.fullname" . }}-wikilegis-cpmedia + command: + - "cp" + - "-au" + - "/var/labhacker/wikilegis/wikilegis/public/media/" + - "/wlpublic/" + volumeMounts: + - mountPath: /wlpublic + name: {{ include "edemocracia.fullname" . }}-wikilegis + containers: + - name: {{ include "edemocracia.fullname" . }}-wikilegis + image: "{{ .Values.wikilegis.image.repository }}:{{ .Values.wikilegis.image.tag }}" + imagePullPolicy: {{ .Values.wikilegis.image.pullPolicy }} + args: + - ./start.sh + env: + - name: ADMIN_EMAIL + value: {{ .Values.edemocracia.admin.email | quote }} + - name: ADMIN_PASSWORD + value: {{ .Values.edemocracia.admin.password | quote }} + - name: ALLOWED_HOSTS + value: "{{ $edemoUrl }},wikilegisweb,wikilegis,localhost,127.0.0.1" + - name: API_KEY + value: {{ .Values.edemocracia.apikey | quote }} + - name: AUTH_USER_MODEL + value: accounts.User + - name: DATABASE_ENGINE + value: postgresql_psycopg2 + - name: DATABASE_HOST + value: {{ (include "postgresql.fullname" .) }} + - name: DATABASE_NAME + value: wikilegis + - name: DATABASE_PASSWORD + value: {{ .Values.postgresql.postgresqlPassword | quote }} + - name: DATABASE_PORT + value: "5432" + - name: DATABASE_USER + value: {{ .Values.postgresql.postgresqlUsername | quote }} + - name: DEBUG + value: "True" + - name: DEFAULT_FROM_EMAIL + value: '"Portal e-Democracia[Wikilegis]" <{{ .Values.edemocracia.admin.email }}>' + - name: EMAIL_HOST + value: {{ .Values.smtp.host | quote }} + - name: EMAIL_HOST_PASSWORD + value: {{ .Values.smtp.password | quote }} + - name: EMAIL_HOST_USER + value: {{ .Values.smtp.username | quote }} + - name: EMAIL_PORT + value: {{ .Values.smtp.port | quote }} + - name: EMAIL_USE_TLS + value: {{ .Values.smtp.tls | quote }} + - name: ENABLE_REMOTE_USER + value: "True" + - name: FORCE_SCRIPT_NAME + value: /wikilegis + - name: LANGUAGE_CODE + value: pt-br + - name: LOGIN_REDIRECT_URL + value: / + - name: LOGIN_URL + value: / + - name: MEDIA_URL + value: /wikilegis/media/ + - name: SECRET_KEY + value: {{ .Values.edemocracia.apikey | quote }} + - name: SESSION_COOKIE_NAME + value: wikilegis_session + - name: SITE_DOMAIN + value: {{ $edemoUrl }} + - name: SITE_NAME + value: {{ .Values.edemocracia.sitename | quote }} + - name: STATIC_URL + value: /wikilegis/static/ + - name: TIME_ZONE + value: {{ .Values.edemocracia.timeZone | quote }} + resources: + {{- toYaml .Values.wikilegis.resources | nindent 12 }} + volumeMounts: + - mountPath: /var/labhacker/wikilegis/wikilegis/public/ + name: {{ include "edemocracia.fullname" . }}-wikilegis + restartPolicy: Always + serviceAccountName: "" + volumes: + - name: {{ include "edemocracia.fullname" . }}-wikilegis + persistentVolumeClaim: + claimName: {{ include "edemocracia.fullname" . }}-wikilegis + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + affinity: + podAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - {{ include "edemocracia.name" . }} + - key: app.kubernetes.io/instance + operator: In + values: + - {{ .Release.Name }} + - key: app.kubernetes.io/component + operator: In + values: + - edemocracia + topologyKey: kubernetes.io/hostname + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} +{{- end }} diff --git a/charts/edemocracia/v0.1.13/templates/wikilegis-pvc.yaml b/charts/edemocracia/v0.1.13/templates/wikilegis-pvc.yaml new file mode 100755 index 0000000..00b8660 --- /dev/null +++ b/charts/edemocracia/v0.1.13/templates/wikilegis-pvc.yaml @@ -0,0 +1,19 @@ +{{- if .Values.wikilegis.enabled }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "edemocracia.fullname" . }}-wikilegis +spec: + accessModes: + - {{ .Values.wikilegis.persistence.accessMode }} + resources: + requests: + storage: {{ .Values.wikilegis.persistence.size }} +{{- if .Values.wikilegis.persistence.storageClass }} +{{- if (eq "-" .Values.wikilegis.persistence.storageClass) }} + storageClassName: "" +{{- else }} + storageClassName: "{{ .Values.wikilegis.persistence.storageClass }}" +{{- end }} +{{- end }} +{{- end }} diff --git a/charts/edemocracia/v0.1.13/templates/wikilegis-service.yaml b/charts/edemocracia/v0.1.13/templates/wikilegis-service.yaml new file mode 100755 index 0000000..793fd2c --- /dev/null +++ b/charts/edemocracia/v0.1.13/templates/wikilegis-service.yaml @@ -0,0 +1,19 @@ +{{- if .Values.wikilegis.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: wikilegis + labels: + {{- include "edemocracia.labels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-wikilegis +spec: + type: {{ .Values.wikilegis.service.type }} + ports: + - port: {{ .Values.wikilegis.service.port }} + targetPort: 8000 + protocol: TCP + name: "8000" + selector: + {{- include "edemocracia.selectorLabels" . | nindent 4 }} + io.kompose.service: {{ include "edemocracia.fullname" . }}-wikilegis +{{- end }} diff --git a/charts/edemocracia/v0.1.13/values.yaml b/charts/edemocracia/v0.1.13/values.yaml new file mode 100755 index 0000000..584fdc1 --- /dev/null +++ b/charts/edemocracia/v0.1.13/values.yaml @@ -0,0 +1,206 @@ +# Default values for edemocracia. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +nginx: + image: + repository: labhackercd/nginx-edemocracia + tag: 1.0.0 + pullPolicy: IfNotPresent + service: + type: ClusterIP + port: 80 + resources: + limits: + cpu: 300m + memory: 150Mi + requests: + cpu: 50m + memory: 30Mi + +discourse: + enabled: true + image: + repository: labhackercd/discourse-docker + tag: 2.0.20180703 + pullPolicy: IfNotPresent + service: + type: ClusterIP + port: 8080 + sso: + secret: "uma_chave_sso_secreta_mesmo" + persistence: + #storageClass: "" + accessMode: ReadWriteOnce + size: 500Mi + resources: + limits: + cpu: 800m + memory: 1200Mi + requests: + cpu: 100m + memory: 650Mi + +wikilegis: + enabled: true + image: + repository: labhackercd/wikilegis + tag: 2.3.0 + pullPolicy: IfNotPresent + service: + type: ClusterIP + port: 8000 + persistence: + #storageClass: "" + accessMode: ReadWriteOnce + size: 2Gi + resources: + limits: + cpu: 800m + memory: 350Mi + requests: + cpu: 100m + memory: 200Mi + + +edemocracia: + admin: + email: seitadmins@interlegis.leg.br + password: p@ssw0rd + apikey: "uma_chave_de_api_secreta_mesmo" + debug: "False" + googleAnalyticsId: "" + olarkId: "" + recaptcha: + siteKey: "altereme" + privateKey: "altereme" + socialAuth: + facebook: + key: "" + secret: "" + google: + key: "" + secret: "" + siteName: "Camara Municipal" + hostname: "edemocracia.teste.df.leg.br" + timeZone: "America/Sao_Paulo" + image: + repository: labhackercd/edemocracia + tag: 1.3.2 + pullPolicy: IfNotPresent + service: + type: ClusterIP + port: 8000 + persistence: + #storageClass: "" + accessMode: ReadWriteOnce + size: 4Gi + resources: + limits: + cpu: 500m + memory: 1350Mi + requests: + cpu: 100m + memory: 800Mi + +audiencias: + enabled: true + image: + repository: labhackercd/audiencias-publicas + tag: 3.2.0 + pullPolicy: IfNotPresent + persistence: + #storageClass: "" + accessMode: ReadWriteOnce + size: 300Mi + notifEmailList: "" + webservice: + url: "" + wordsBlacklist: "merda,cu,cuzao,cuzona,cusao,cusona,bunda,fodido,fodida,foda,foder,fodedor,fudido,fudida,fuder,chupa,chupada,chupador,chupadora,boquete,boqueteira,boquetera,boketeira,boketera,xupa,xupada,xupador,xupadora,pauduro,pauzudo,xoxota,chochota,buceta,boceta,busseta,bosseta,cacete,cassete,caceta,kacete,kassete,caralho,karalho,caraleo,pinto,pica,rola,roludo,gozado,gozada,goso,gosa,gosado,gosado,puta,puto,putinho,putinha,putona,putana,putaria,grelo,grelinho,filhodaputa,filhosdaputa,puta,fdps,siririca,punheta,trepar,trepada,trepadeira,caralho,caralhu,karalho,karalhu,tomarnocu,tomanocu,vadia,bosta,quenga,rabo,bolsa,cuzinho,piroca,pqp,puta que pariu,porra,carai,cú,viado,fdp,vtnc,corno,bicha,bixa,viado,viadinho,pederasta,filho da puta,bundao,bundão,filho de uma egua,filho de uma égua,achacador,achacadora,achacadores,achacar,babaca,bucetas,cagar,cagaram,cambada,caráleo,corja,cornão,covarde,covardes,cretino,cus,cús,cusão,cuzão,cuzinho,cuzona,danar,desgraça,drosoba,enrabar,escória,escroto,escrotas,escrotos,fodão,fodona,fudendo,fuder,idiota,imundo,imundos,ku,kú,lascar,merdas,patifaria,pilantra,pilantragem,pilantras,poha,porcaria,putas,putos,sacanagem,safadeza,safado,safados,salafrário,salafrários,vagabundagem,vagabundo,vagabundos,veadinho,veadinhos" + service: + type: ClusterIP + port: 8000 + resources: + limits: + cpu: 500m + memory: 300Mi + requests: + cpu: 50m + memory: 100Mi + + +smtp: + host: "127.0.0.1" + username: "" + password: "" + port: "25" + tls: "False" + + +# PostgreSQL definitions +postgresql: + image: + tag: 9.6.17 + pullPolicy: IfNotPresent + service: + type: ClusterIP + port: 5432 + persistence: + enabled: true + size: 2Gi + postgresqlPassword: DbP@ssw0rd + postgresqlUsername: postgres + postgresqlDatabase: root + resources: + requests: + cpu: 50m + memory: 80Mi + +# Redis definitions +redis: + image: + tag: 5.0.8 + pullPolicy: IfNotPresent + cluster: + enabled: false + usePassword: false + persistence: + enabled: true + accessModes: + - ReadWriteOnce + size: 2Gi + resources: + requests: + cpu: 50m + memory: 150Mi + limits: + cpu: 800m + memory: 1Gi + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +ingress: + enabled: true + # extra annotations only + annotations: {} + +velero: + namespace: velero + backup: + enabled: true + snapshotVolumes: false + defaultVolumesToRestic: true + # cert-manager objects are usually blocked during backup + excludedResources: + - certificates.cert-manager.io + - orders.acme.cert-manager.io + - certificaterequests.cert-manager.io + - challenges.acme.cert-manager.io + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/charts/edemocracia/v0.4.0/.helmignore b/charts/edemocracia/v0.4.0/.helmignore old mode 100644 new mode 100755 diff --git a/charts/edemocracia/v0.4.0/Chart.lock b/charts/edemocracia/v0.4.0/Chart.lock old mode 100644 new mode 100755 diff --git a/charts/edemocracia/v0.4.0/Chart.yaml b/charts/edemocracia/v0.4.0/Chart.yaml old mode 100644 new mode 100755 diff --git a/charts/edemocracia/v0.4.0/app-readme.md b/charts/edemocracia/v0.4.0/app-readme.md old mode 100644 new mode 100755 diff --git a/charts/edemocracia/v0.4.0/charts/postgresql-8.6.13.tgz b/charts/edemocracia/v0.4.0/charts/postgresql-8.6.13.tgz old mode 100644 new mode 100755 diff --git a/charts/edemocracia/v0.4.0/charts/redis-10.6.3.tgz b/charts/edemocracia/v0.4.0/charts/redis-10.6.3.tgz old mode 100644 new mode 100755 diff --git a/charts/edemocracia/v0.4.0/questions.yaml b/charts/edemocracia/v0.4.0/questions.yaml old mode 100644 new mode 100755 index 4454f72..0ff1578 --- a/charts/edemocracia/v0.4.0/questions.yaml +++ b/charts/edemocracia/v0.4.0/questions.yaml @@ -152,6 +152,14 @@ questions: required: true group: Avançado +- 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: Avançado + - variable: edemocracia.apikey default: "uma_chave_de_api_secreta_mesmo" description: "Chave de API do E-democracia" diff --git a/charts/edemocracia/v0.4.0/templates/NOTES.txt b/charts/edemocracia/v0.4.0/templates/NOTES.txt old mode 100644 new mode 100755 diff --git a/charts/edemocracia/v0.4.0/templates/_helpers.tpl b/charts/edemocracia/v0.4.0/templates/_helpers.tpl old mode 100644 new mode 100755 diff --git a/charts/edemocracia/v0.4.0/templates/audiencias-pvc.yaml b/charts/edemocracia/v0.4.0/templates/audiencias-pvc.yaml old mode 100644 new mode 100755 diff --git a/charts/edemocracia/v0.4.0/templates/audienciasweb-deployment.yaml b/charts/edemocracia/v0.4.0/templates/audienciasweb-deployment.yaml old mode 100644 new mode 100755 diff --git a/charts/edemocracia/v0.4.0/templates/audienciasweb-service.yaml b/charts/edemocracia/v0.4.0/templates/audienciasweb-service.yaml old mode 100644 new mode 100755 diff --git a/charts/edemocracia/v0.4.0/templates/audienciasworker-deployment.yaml b/charts/edemocracia/v0.4.0/templates/audienciasworker-deployment.yaml old mode 100644 new mode 100755 diff --git a/charts/edemocracia/v0.4.0/templates/discourse-deployment.yaml b/charts/edemocracia/v0.4.0/templates/discourse-deployment.yaml old mode 100644 new mode 100755 diff --git a/charts/edemocracia/v0.4.0/templates/discourse-pvc.yaml b/charts/edemocracia/v0.4.0/templates/discourse-pvc.yaml old mode 100644 new mode 100755 diff --git a/charts/edemocracia/v0.4.0/templates/discourse-service.yaml b/charts/edemocracia/v0.4.0/templates/discourse-service.yaml old mode 100644 new mode 100755 diff --git a/charts/edemocracia/v0.4.0/templates/edemocracia-deployment.yaml b/charts/edemocracia/v0.4.0/templates/edemocracia-deployment.yaml old mode 100644 new mode 100755 diff --git a/charts/edemocracia/v0.4.0/templates/edemocracia-pvc.yaml b/charts/edemocracia/v0.4.0/templates/edemocracia-pvc.yaml old mode 100644 new mode 100755 diff --git a/charts/edemocracia/v0.4.0/templates/edemocracia-service.yaml b/charts/edemocracia/v0.4.0/templates/edemocracia-service.yaml old mode 100644 new mode 100755 diff --git a/charts/edemocracia/v0.4.0/templates/ingress.yaml b/charts/edemocracia/v0.4.0/templates/ingress.yaml old mode 100644 new mode 100755 diff --git a/charts/edemocracia/v0.4.0/templates/nginx-deployment.yaml b/charts/edemocracia/v0.4.0/templates/nginx-deployment.yaml old mode 100644 new mode 100755 diff --git a/charts/edemocracia/v0.4.0/templates/nginx-service.yaml b/charts/edemocracia/v0.4.0/templates/nginx-service.yaml old mode 100644 new mode 100755 diff --git a/charts/edemocracia/v0.4.0/templates/velero-schedule-monthly.yaml b/charts/edemocracia/v0.4.0/templates/velero-schedule-monthly.yaml new file mode 100755 index 0000000..04cbc3a --- /dev/null +++ b/charts/edemocracia/v0.4.0/templates/velero-schedule-monthly.yaml @@ -0,0 +1,39 @@ +{{- if .Values.velero.backup.enabled }} +apiVersion: velero.io/v1 +kind: Schedule +metadata: + name: {{ include "edemocracia.fullname" . }}-monthly + namespace: {{ .Values.velero.namespace }} +spec: + # generate a random backup time between 1 and 5 AM on first day of every month + schedule: {{ mod (randNumeric 2) 60 }} {{ mod (randNumeric 1) 6 }} 1 * * + template: + includedNamespaces: + - {{ .Release.Namespace }} + {{- with .Values.velero.backup.excludedResources }} + excludedResources: + {{- toYaml . | nindent 8 }} + {{- end }} + snapshotVolumes: {{ .Values.velero.backup.snapshotVolumes }} + # every weekday backup is good for the next year (365 days) + ttl: 8760h0m0s + defaultVolumesToRestic: {{ .Values.velero.backup.defaultVolumesToRestic }} + hooks: + resources: + - name: pgdump + includedResources: + - pods + labelSelector: + matchLabels: + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/name: postgresql + pre: + - exec: + command: + - "/bin/bash" + - "-c" + - "PGPASSWORD=$POSTGRES_PASSWORD /opt/bitnami/postgresql/bin/pg_dumpall -U postgres > /bitnami/postgresql/all.dump" + timeout: 360s + onError: Continue + useOwnerReferencesInBackup: false +{{- end }} \ No newline at end of file diff --git a/charts/edemocracia/v0.4.0/templates/velero-schedule-weekdays.yaml b/charts/edemocracia/v0.4.0/templates/velero-schedule-weekdays.yaml new file mode 100755 index 0000000..ea53bda --- /dev/null +++ b/charts/edemocracia/v0.4.0/templates/velero-schedule-weekdays.yaml @@ -0,0 +1,39 @@ +{{- if .Values.velero.backup.enabled }} +apiVersion: velero.io/v1 +kind: Schedule +metadata: + name: {{ include "edemocracia.fullname" . }}-weekdays + namespace: {{ .Values.velero.namespace }} +spec: + # generate a random backup time between 1 and 5 AM on weekdays + schedule: {{ mod (randNumeric 2) 60 }} {{ mod (randNumeric 1) 6 }} * * 1-5 + template: + includedNamespaces: + - {{ .Release.Namespace }} + {{- with .Values.velero.backup.excludedResources }} + excludedResources: + {{- toYaml . | nindent 8 }} + {{- end }} + snapshotVolumes: {{ .Values.velero.backup.snapshotVolumes }} + # every weekday backup is good for the next week (7 days) + ttl: 168h0m0s + defaultVolumesToRestic: {{ .Values.velero.backup.defaultVolumesToRestic }} + hooks: + resources: + - name: pgdump + includedResources: + - pods + labelSelector: + matchLabels: + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/name: postgresql + pre: + - exec: + command: + - "/bin/bash" + - "-c" + - "PGPASSWORD=$POSTGRES_PASSWORD /opt/bitnami/postgresql/bin/pg_dumpall -U postgres > /bitnami/postgresql/all.dump" + timeout: 360s + onError: Continue + useOwnerReferencesInBackup: false +{{- end }} \ No newline at end of file diff --git a/charts/edemocracia/v0.4.0/templates/velero-schedule-weekly.yaml b/charts/edemocracia/v0.4.0/templates/velero-schedule-weekly.yaml new file mode 100755 index 0000000..e9a09a3 --- /dev/null +++ b/charts/edemocracia/v0.4.0/templates/velero-schedule-weekly.yaml @@ -0,0 +1,39 @@ +{{- if .Values.velero.backup.enabled }} +apiVersion: velero.io/v1 +kind: Schedule +metadata: + name: {{ include "edemocracia.fullname" . }}-weekly + namespace: {{ .Values.velero.namespace }} +spec: + # generate a random backup time between 1 and 5 AM on sunday + schedule: {{ mod (randNumeric 2) 60 }} {{ mod (randNumeric 1) 6 }} * * 0 + template: + includedNamespaces: + - {{ .Release.Namespace }} + {{- with .Values.velero.backup.excludedResources }} + excludedResources: + {{- toYaml . | nindent 8 }} + {{- end }} + snapshotVolumes: {{ .Values.velero.backup.snapshotVolumes }} + # every sunday backup is good for 30 days (aprox. 1 month) + ttl: 744h0m0s + defaultVolumesToRestic: {{ .Values.velero.backup.defaultVolumesToRestic }} + hooks: + resources: + - name: pgdump + includedResources: + - pods + labelSelector: + matchLabels: + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/name: postgresql + pre: + - exec: + command: + - "/bin/bash" + - "-c" + - "PGPASSWORD=$POSTGRES_PASSWORD /opt/bitnami/postgresql/bin/pg_dumpall -U postgres > /bitnami/postgresql/all.dump" + timeout: 360s + onError: Continue + useOwnerReferencesInBackup: false +{{- end }} \ No newline at end of file diff --git a/charts/edemocracia/v0.4.0/templates/wikilegis-deployment.yaml b/charts/edemocracia/v0.4.0/templates/wikilegis-deployment.yaml old mode 100644 new mode 100755 diff --git a/charts/edemocracia/v0.4.0/templates/wikilegis-pvc.yaml b/charts/edemocracia/v0.4.0/templates/wikilegis-pvc.yaml old mode 100644 new mode 100755 diff --git a/charts/edemocracia/v0.4.0/templates/wikilegis-service.yaml b/charts/edemocracia/v0.4.0/templates/wikilegis-service.yaml old mode 100644 new mode 100755 diff --git a/charts/edemocracia/v0.4.0/values.yaml b/charts/edemocracia/v0.4.0/values.yaml old mode 100644 new mode 100755 index 3ebe898..8116426 --- a/charts/edemocracia/v0.4.0/values.yaml +++ b/charts/edemocracia/v0.4.0/values.yaml @@ -186,6 +186,19 @@ ingress: # extra annotations only annotations: {} +velero: + namespace: velero + backup: + enabled: true + snapshotVolumes: false + defaultVolumesToRestic: true + # cert-manager objects are usually blocked during backup + excludedResources: + - certificates.cert-manager.io + - orders.acme.cert-manager.io + - certificaterequests.cert-manager.io + - challenges.acme.cert-manager.io + nodeSelector: {} tolerations: [] diff --git a/charts/osticket/v0.2.0/.helmignore b/charts/osticket/v0.2.0/.helmignore new file mode 100644 index 0000000..50af031 --- /dev/null +++ b/charts/osticket/v0.2.0/.helmignore @@ -0,0 +1,22 @@ +# 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 +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/osticket/v0.2.0/Chart.lock b/charts/osticket/v0.2.0/Chart.lock new file mode 100644 index 0000000..54435c9 --- /dev/null +++ b/charts/osticket/v0.2.0/Chart.lock @@ -0,0 +1,9 @@ +dependencies: +- name: mariadb + repository: https://charts.bitnami.com/bitnami + version: 10.4.4 +- name: memcached + repository: https://charts.bitnami.com/bitnami + version: 6.0.10 +digest: sha256:82bd28a75702fa0313d8aedd8686527365365c914f2a5776e722da436e45135c +generated: "2022-04-01T11:42:33.634085-03:00" diff --git a/charts/osticket/v0.2.0/Chart.yaml b/charts/osticket/v0.2.0/Chart.yaml new file mode 100644 index 0000000..6b1ec6d --- /dev/null +++ b/charts/osticket/v0.2.0/Chart.yaml @@ -0,0 +1,16 @@ +apiVersion: v2 +appVersion: "1.14.1" +description: OSTicket Open Source Ticket System +name: osticket +icon: https://osticket.com/wp-content/uploads/2021/03/osticket-supsys-new-1-e1616621912452.png +version: 0.2.0 + +dependencies: +- name: mariadb + version: 10.4.4 + repository: https://charts.bitnami.com/bitnami + condition: mariadb.internal +- name: memcached + version: 6.0.10 + repository: https://charts.bitnami.com/bitnami + condition: memcached.internal \ No newline at end of file diff --git a/charts/osticket/v0.2.0/README.md b/charts/osticket/v0.2.0/README.md new file mode 100644 index 0000000..2748724 --- /dev/null +++ b/charts/osticket/v0.2.0/README.md @@ -0,0 +1,24 @@ +# OSTicket support ticket system Helm chart + +This is a Helm chart to install OSTicket with MySQL as database and memcached as session storage. +Requirements: + + - Default persistent storage class (StorageClass) + - Ingress Controller (ex: nginx) + +## Parameters and default values + +| Parametro | Description | Default | +|---------------------------|--------------------------------------------|--------------------------| +| image.repository | Repository of docker image | `interlegis/osticket` | +| image.tag | Docker image version | `1.14.1` | +| image.pullPolicy | Docker image Pull Policy | `IfNotPresent` | +| replicaCount | Number of OSTicket replicas | `1` | +| persistence.enabled | Enable persistent volumes | `true` | +| persistence.storageClass | Persistent volume storage class | `` | +| persistence.accessMode | Persistent volume acces mode | `ReadWriteOnce` | +| persistence.size | Persistent volume size | `10Gi ` | +| installSecret | OSTicket install secret | `` | +| mariadb.auth.database | OSTicket database name | `osticket` | +| mariadb.auth.username | OSTicket database user name | `osticket` | +| mariadb.auth.password | OSTicket database user password | `mysecretpw` | diff --git a/charts/osticket/v0.2.0/charts/mariadb-10.4.4.tgz b/charts/osticket/v0.2.0/charts/mariadb-10.4.4.tgz new file mode 100644 index 0000000..8a7c5f4 Binary files /dev/null and b/charts/osticket/v0.2.0/charts/mariadb-10.4.4.tgz differ diff --git a/charts/osticket/v0.2.0/charts/memcached-6.0.10.tgz b/charts/osticket/v0.2.0/charts/memcached-6.0.10.tgz new file mode 100644 index 0000000..5e5e11a Binary files /dev/null and b/charts/osticket/v0.2.0/charts/memcached-6.0.10.tgz differ diff --git a/charts/osticket/v0.2.0/templates/_helpers.tpl b/charts/osticket/v0.2.0/templates/_helpers.tpl new file mode 100644 index 0000000..5cb7dfb --- /dev/null +++ b/charts/osticket/v0.2.0/templates/_helpers.tpl @@ -0,0 +1,45 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "osticket.name" -}} +{{- 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 "osticket.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 -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "osticket.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "osticket.labels" -}} +app.kubernetes.io/name: {{ include "osticket.name" . }} +helm.sh/chart: {{ include "osticket.chart" . }} +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 -}} diff --git a/charts/osticket/v0.2.0/templates/deployment.yaml b/charts/osticket/v0.2.0/templates/deployment.yaml new file mode 100644 index 0000000..6ad39dd --- /dev/null +++ b/charts/osticket/v0.2.0/templates/deployment.yaml @@ -0,0 +1,97 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "osticket.fullname" . }} + labels: +{{ include "osticket.labels" . | indent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app.kubernetes.io/name: {{ include "osticket.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + template: + metadata: + labels: + app.kubernetes.io/name: {{ include "osticket.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + initContainers: + - name: {{ .Chart.Name }}-install + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: + - name: INSTALL_SECRET + value: "{{ .Values.installSecret }}" + - name: MYSQL_HOST + value: "{{ include "osticket.name" . }}-mariadb" + - name: MYSQL_PASSWORD + value: "{{ .Values.mariadb.auth.password }}" + - name: USE_MEMCACHE + value: "true" + - name: MEMCACHE_NAME + value: "{{ include "osticket.name" . }}-memcached" + command: + - "php" + - "/data/bin/install.php" + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 80 + protocol: TCP + env: + - name: INSTALL_SECRET + value: "{{ .Values.installSecret }}" + - name: MYSQL_HOST + value: "{{ include "osticket.name" . }}-mariadb" + - name: MYSQL_PASSWORD + value: "{{ .Values.mariadb.auth.password }}" + - name: USE_MEMCACHE + value: "true" + - name: MEMCACHE_NAME + value: "{{ include "osticket.name" . }}-memcached" + livenessProbe: + failureThreshold: 3 + httpGet: + path: / + port: http + initialDelaySeconds: 30 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 1 + httpGet: + path: / + port: http + readinessProbe: + failureThreshold: 3 + httpGet: + path: / + port: http + initialDelaySeconds: 30 + periodSeconds: 10 + successThreshold: 2 + timeoutSeconds: 1 + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/osticket/v0.2.0/templates/ingress.yaml b/charts/osticket/v0.2.0/templates/ingress.yaml new file mode 100644 index 0000000..2adf3d1 --- /dev/null +++ b/charts/osticket/v0.2.0/templates/ingress.yaml @@ -0,0 +1,35 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "osticket.fullname" . -}} +{{- $ingressPath := .Values.ingress.path -}} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ $fullName }} + labels: +{{ include "osticket.labels" . | indent 4 }} +{{- with .Values.ingress.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ . }} + http: + paths: + - path: {{ $ingressPath }} + backend: + serviceName: {{ $fullName }} + servicePort: http + {{- end }} +{{- end }} diff --git a/charts/osticket/v0.2.0/templates/service.yaml b/charts/osticket/v0.2.0/templates/service.yaml new file mode 100644 index 0000000..a4a2f85 --- /dev/null +++ b/charts/osticket/v0.2.0/templates/service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "osticket.fullname" . }} + labels: +{{ include "osticket.labels" . | indent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + app.kubernetes.io/name: {{ include "osticket.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} diff --git a/charts/osticket/v0.2.0/templates/tests/test-connection.yaml b/charts/osticket/v0.2.0/templates/tests/test-connection.yaml new file mode 100644 index 0000000..ebf694c --- /dev/null +++ b/charts/osticket/v0.2.0/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "osticket.fullname" . }}-test-connection" + labels: +{{ include "osticket.labels" . | indent 4 }} + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "osticket.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/charts/osticket/v0.2.0/templates/velero-schedule-weekdays.yaml b/charts/osticket/v0.2.0/templates/velero-schedule-weekdays.yaml new file mode 100644 index 0000000..84bc547 --- /dev/null +++ b/charts/osticket/v0.2.0/templates/velero-schedule-weekdays.yaml @@ -0,0 +1,39 @@ +{{- if .Values.velero.backup.enabled }} +apiVersion: velero.io/v1 +kind: Schedule +metadata: + name: {{ include "osticket.fullname" . }}-weekdays + namespace: {{ .Values.velero.namespace }} +spec: + # generate a random backup time between 1 and 5 AM on weekdays + schedule: {{ mod (randNumeric 2) 60 }} {{ mod (randNumeric 1) 6 }} * * 1-5 + template: + includedNamespaces: + - {{ .Release.Namespace }} + {{- with .Values.velero.backup.excludedResources }} + excludedResources: + {{- toYaml . | nindent 8 }} + {{- end }} + snapshotVolumes: {{ .Values.velero.backup.snapshotVolumes }} + # every weekday backup is good for the next week (7 days) + ttl: 168h0m0s + defaultVolumesToRestic: {{ .Values.velero.backup.defaultVolumesToRestic }} + hooks: + resources: + - name: mysqldump + includedResources: + - pods + labelSelector: + matchLabels: + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/name: mariadb + pre: + - exec: + command: + - "/bin/bash" + - "-c" + - "/opt/bitnami/mariadb/bin/mysqldump osticket -u osticket -p$MARIADB_PASSWORD > /bitnami/mariadb/osticket.dump" + timeout: 360s + onError: Continue + useOwnerReferencesInBackup: false +{{- end }} \ No newline at end of file diff --git a/charts/osticket/v0.2.0/values.yaml b/charts/osticket/v0.2.0/values.yaml new file mode 100644 index 0000000..1be17d7 --- /dev/null +++ b/charts/osticket/v0.2.0/values.yaml @@ -0,0 +1,100 @@ +# Default values for osticket. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: interlegis/osticket + tag: 1.14.1 + pullPolicy: IfNotPresent + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +installSecret: "" + +persistence: + enabled: true + #storageClass: "" + accessMode: ReadWriteOnce + size: 10Gi + +velero: + namespace: velero + backup: + enabled: true + snapshotVolumes: false + defaultVolumesToRestic: true + # cert-manager objects are usually blocked during backup + excludedResources: + - certificates.cert-manager.io + - orders.acme.cert-manager.io + - certificaterequests.cert-manager.io + - challenges.acme.cert-manager.io + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: true + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: [] + + 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 + +mariadb: + internal: true + image: + tag: 10.5.13-debian-10-r58 + architecture: standalone + auth: + database: osticket + username: osticket + password: mysecretpw + primary: + persistence: + enabled: true + accessModes: + - ReadWriteOnce + size: 20Gi + resources: + requests: + memory: 700Mi + cpu: 100m + +memcached: + internal: true + image: + tag: 1.6.13-debian-10-r0 + architecture: standalone + replicaCount: 1 + pdb: + minAvailable: 1 + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/charts/pdnsadmin/v0.1.0/templates/velero-schedule-weekdays.yaml b/charts/pdnsadmin/v0.1.0/templates/velero-schedule-weekdays.yaml new file mode 100644 index 0000000..7be5938 --- /dev/null +++ b/charts/pdnsadmin/v0.1.0/templates/velero-schedule-weekdays.yaml @@ -0,0 +1,39 @@ +{{- if .Values.velero.backup.enabled }} +apiVersion: velero.io/v1 +kind: Schedule +metadata: + name: {{ include "pdnsadmin.fullname" . }}-weekdays + namespace: {{ .Values.velero.namespace }} +spec: + # generate a random backup time between 1 and 5 AM on weekdays + schedule: {{ mod (randNumeric 2) 60 }} {{ mod (randNumeric 1) 6 }} * * 1-5 + template: + includedNamespaces: + - {{ .Release.Namespace }} + {{- with .Values.velero.backup.excludedResources }} + excludedResources: + {{- toYaml . | nindent 8 }} + {{- end }} + snapshotVolumes: {{ .Values.velero.backup.snapshotVolumes }} + # every weekday backup is good for the next week (7 days) + ttl: 168h0m0s + defaultVolumesToRestic: {{ .Values.velero.backup.defaultVolumesToRestic }} + hooks: + resources: + - name: mysqldump + includedResources: + - pods + labelSelector: + matchLabels: + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/name: mariadb + pre: + - exec: + command: + - "/bin/bash" + - "-c" + - "/opt/bitnami/mariadb/bin/mysqldump {{ .Values.mariadb.auth.database }} -u {{ .Values.mariadb.auth.username }} -p$MARIADB_PASSWORD > /bitnami/mariadb/{{ .Values.mariadb.auth.database }}.dump" + timeout: 360s + onError: Continue + useOwnerReferencesInBackup: false +{{- end }} \ No newline at end of file diff --git a/charts/pdnsadmin/v0.1.0/values.yaml b/charts/pdnsadmin/v0.1.0/values.yaml index d770a0c..5e3f5d7 100644 --- a/charts/pdnsadmin/v0.1.0/values.yaml +++ b/charts/pdnsadmin/v0.1.0/values.yaml @@ -87,4 +87,17 @@ mariadb: database: pdnsadmin password: pdnsadminpw rootPassword: pdnsadminrootpw - username: pdnsadmin \ No newline at end of file + username: pdnsadmin + +velero: + namespace: velero + backup: + enabled: true + snapshotVolumes: false + defaultVolumesToRestic: true + # cert-manager objects are usually blocked during backup + excludedResources: + - certificates.cert-manager.io + - orders.acme.cert-manager.io + - certificaterequests.cert-manager.io + - challenges.acme.cert-manager.io \ No newline at end of file diff --git a/charts/portalmodelo/v0.5.0/questions.yaml b/charts/portalmodelo/v0.5.0/questions.yaml index 9a68d44..5607751 100644 --- a/charts/portalmodelo/v0.5.0/questions.yaml +++ b/charts/portalmodelo/v0.5.0/questions.yaml @@ -125,14 +125,14 @@ questions: description: "Espaço em disco disponível para o portal." group: Armazenamento - variable: velero.backup.enabled - default: false + 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: true + default: false type: boolean label: "Habilitar backup com Repozo?" description: "Habilitar ou não backup com repozo em volumes NFS." @@ -158,6 +158,12 @@ questions: 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 diff --git a/charts/portalmodelo/v0.5.0/templates/repozo-configmap.yaml b/charts/portalmodelo/v0.5.0/templates/repozo-configmap.yaml index 73944b2..c680d87 100644 --- a/charts/portalmodelo/v0.5.0/templates/repozo-configmap.yaml +++ b/charts/portalmodelo/v0.5.0/templates/repozo-configmap.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.persistence.enabled .Values.repozo.enabled }} +{{- if and .Values.persistence.enabled (or .Values.repozo.enabled .Values.velero.backup.enabled )}} apiVersion: v1 kind: ConfigMap metadata: @@ -34,16 +34,21 @@ data: format='%(levelname)s: %(message)s') import collective.recipe.backup.main + + {{- $bkpLocation := "/backup" -}} + {{- if .Values.velero.backup.enabled -}} + {{- $bkpLocation = "/data" -}} + {{- end }} if __name__ == '__main__': sys.exit(collective.recipe.backup.main.backup_main( bin_dir='/plone/instance/bin', - storages=[{'backup_location': '/backup/backups', - 'blob_backup_location': '/backup/blobstoragebackups', - 'blob_snapshot_location': '/backup/blobstoragesnapshots', + storages=[{'backup_location': '{{ $bkpLocation }}/backups', + 'blob_backup_location': '{{ $bkpLocation }}/blobstoragebackups', + 'blob_snapshot_location': '{{ $bkpLocation }}/blobstoragesnapshots', 'blobdir': '/data/blobstorage', 'datafs': '/data/filestorage/Data.fs', - 'snapshot_location': '/backup/snapshotbackups', + 'snapshot_location': '{{ $bkpLocation }}/snapshotbackups', 'storage': '1'}], keep={{ .Values.repozo.keep }}, keep_blob_days={{ .Values.repozo.keepblobdays }}, @@ -51,7 +56,11 @@ data: verbose=False, gzip=True, only_blobs=False, + {{- if .Values.repozo.backupblobs }} backup_blobs=True, + {{- else }} + backup_blobs=False, + {{- end }} use_rsync=True, gzip_blob=False, pre_command='', diff --git a/charts/portalmodelo/v0.5.0/templates/velero-schedule-monthly.yaml b/charts/portalmodelo/v0.5.0/templates/velero-schedule-monthly.yaml index e37a400..efe2b20 100644 --- a/charts/portalmodelo/v0.5.0/templates/velero-schedule-monthly.yaml +++ b/charts/portalmodelo/v0.5.0/templates/velero-schedule-monthly.yaml @@ -17,5 +17,24 @@ spec: snapshotVolumes: {{ .Values.velero.backup.snapshotVolumes }} # every weekday backup is good for the next year (365 days) ttl: 8760h0m0s + defaultVolumesToRestic: {{ .Values.velero.backup.defaultVolumesToRestic }} + hooks: + resources: + - name: repozo + includedResources: + - pods + labelSelector: + matchLabels: + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/name: portalmodelo + app.kubernetes.io/component: zeoserver + pre: + - exec: + command: + - "/bin/bash" + - "-c" + - "/plone/Python-2.7/bin/python /plone/instance/bin/backup" + timeout: 3600s + onError: Continue useOwnerReferencesInBackup: false {{- end }} \ No newline at end of file diff --git a/charts/portalmodelo/v0.5.0/templates/velero-schedule-weekdays.yaml b/charts/portalmodelo/v0.5.0/templates/velero-schedule-weekdays.yaml index 43171f4..2816c3a 100644 --- a/charts/portalmodelo/v0.5.0/templates/velero-schedule-weekdays.yaml +++ b/charts/portalmodelo/v0.5.0/templates/velero-schedule-weekdays.yaml @@ -17,5 +17,24 @@ spec: snapshotVolumes: {{ .Values.velero.backup.snapshotVolumes }} # every weekday backup is good for the next week (7 days) ttl: 168h0m0s + defaultVolumesToRestic: {{ .Values.velero.backup.defaultVolumesToRestic }} + hooks: + resources: + - name: repozo + includedResources: + - pods + labelSelector: + matchLabels: + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/name: portalmodelo + app.kubernetes.io/component: zeoserver + pre: + - exec: + command: + - "/bin/bash" + - "-c" + - "/plone/Python-2.7/bin/python /plone/instance/bin/backup" + timeout: 3600s + onError: Continue useOwnerReferencesInBackup: false {{- end }} \ No newline at end of file diff --git a/charts/portalmodelo/v0.5.0/templates/velero-schedule-weekly.yaml b/charts/portalmodelo/v0.5.0/templates/velero-schedule-weekly.yaml index 3c6bbe1..6ba21ae 100644 --- a/charts/portalmodelo/v0.5.0/templates/velero-schedule-weekly.yaml +++ b/charts/portalmodelo/v0.5.0/templates/velero-schedule-weekly.yaml @@ -17,5 +17,24 @@ spec: snapshotVolumes: {{ .Values.velero.backup.snapshotVolumes }} # every sunday backup is good for 30 days (aprox. 1 month) ttl: 744h0m0s + defaultVolumesToRestic: {{ .Values.velero.backup.defaultVolumesToRestic }} + hooks: + resources: + - name: repozo + includedResources: + - pods + labelSelector: + matchLabels: + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/name: portalmodelo + app.kubernetes.io/component: zeoserver + pre: + - exec: + command: + - "/bin/bash" + - "-c" + - "/plone/Python-2.7/bin/python /plone/instance/bin/backup" + timeout: 3600s + onError: Continue useOwnerReferencesInBackup: false {{- end }} \ No newline at end of file diff --git a/charts/portalmodelo/v0.5.0/templates/zeoserver-deployment.yaml b/charts/portalmodelo/v0.5.0/templates/zeoserver-deployment.yaml index 2ce452b..18d4373 100644 --- a/charts/portalmodelo/v0.5.0/templates/zeoserver-deployment.yaml +++ b/charts/portalmodelo/v0.5.0/templates/zeoserver-deployment.yaml @@ -79,6 +79,11 @@ spec: volumeMounts: - mountPath: /data name: data + {{- if .Values.velero.backup.enabled }} + - mountPath: /plone/instance/bin/backup + subPath: backup + name: backupscript + {{- end }} livenessProbe: tcpSocket: port: 8100 @@ -106,6 +111,11 @@ spec: {{- else }} emptyDir: {} {{- end }} + {{- if .Values.velero.backup.enabled }} + - name: backupscript + configMap: + name: {{ include "portalmodelo.fullname" . }}-backupscript + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/charts/portalmodelo/v0.5.0/values.yaml b/charts/portalmodelo/v0.5.0/values.yaml index fcd3198..f07b4c8 100644 --- a/charts/portalmodelo/v0.5.0/values.yaml +++ b/charts/portalmodelo/v0.5.0/values.yaml @@ -18,13 +18,14 @@ persistence: enabled: true #storageClass: "" accessMode: ReadWriteOnce - size: 1Gi + size: 5Gi velero: namespace: velero backup: enabled: false - snapshotVolumes: true + snapshotVolumes: false + defaultVolumesToRestic: true # cert-manager objects are usually blocked during backup excludedResources: - certificates.cert-manager.io @@ -58,6 +59,7 @@ repozo: storageClass: nfs-backup keep: 1 keepblobdays: 30 + backupblobs: true podAnnotations: {}