-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adicionando mais coisas sobre o helm
- Loading branch information
Showing
11 changed files
with
975 additions
and
1 deletion.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# charts-example |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: v2 | ||
name: giropops-senhas | ||
description: Esse é o chart do Giropops-Senhas, utilizados nos laboratórios de Kubernetes. | ||
version: 0.1.0 | ||
appVersion: 0.1.0 | ||
sources: | ||
- https://github.com/badtuxx/giropops-senhas |
45 changes: 45 additions & 0 deletions
45
pt/day-16/files/charts/giropops-senhas/templates/_helpers.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{{/* Define a base para reutilização de labels */}} | ||
{{- define "app.labels" -}} | ||
app: {{ .labels.app | quote }} | ||
env: {{ .labels.env | quote }} | ||
live: {{ .labels.live | quote }} | ||
{{- end }} | ||
|
||
{{/* Template para especificações de recursos de containers */}} | ||
{{- define "app.resources" -}} | ||
requests: | ||
memory: {{ .resources.requests.memory }} | ||
cpu: {{ .resources.requests.cpu }} | ||
limits: | ||
memory: {{ .resources.limits.memory }} | ||
cpu: {{ .resources.limits.cpu }} | ||
{{- end }} | ||
|
||
{{/* Template para definição de portas em containers */}} | ||
{{- define "app.ports" -}} | ||
{{- range .ports }} | ||
- containerPort: {{ .port }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* Template para gerar um ConfigMap para configurações de banco de dados */}} | ||
{{- define "database.configmap" -}} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ .component }}-db-config | ||
data: | ||
app-config.yaml: | | ||
{{- toYaml .config | nindent 4 }} | ||
{{- end }} | ||
|
||
{{/* Template para gerar um ConfigMap para configurações de observabilidade */}} | ||
{{- define "observability.configmap" -}} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ .component }}-observability-config | ||
data: | ||
app-config.json: | | ||
{{ toJson .config }} | ||
{{- end }} |
4 changes: 4 additions & 0 deletions
4
pt/day-16/files/charts/giropops-senhas/templates/configmap-db.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{{- range $component, $config := .Values.databases }} | ||
{{- $data := dict "component" $component "config" $config }} | ||
{{- include "database.configmap" $data | nindent 0 }} | ||
{{- end }} |
4 changes: 4 additions & 0 deletions
4
pt/day-16/files/charts/giropops-senhas/templates/configmap-observability.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{{- range $component, $config := .Values.observability }} | ||
{{- $data := dict "component" $component "config" $config }} | ||
{{- include "observability.configmap" $data | nindent 0 }} | ||
{{- end }} |
33 changes: 33 additions & 0 deletions
33
pt/day-16/files/charts/giropops-senhas/templates/deployments.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{{- range $component, $config := .Values.deployments }} | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ $component }} | ||
labels: | ||
{{- include "app.labels" $config | nindent 4 }} | ||
spec: | ||
replicas: {{ $config.replicas | default 3 }} | ||
selector: | ||
matchLabels: | ||
app: {{ $config.labels.app }} | ||
template: | ||
metadata: | ||
labels: | ||
{{- include "app.labels" $config | nindent 8 }} | ||
spec: | ||
containers: | ||
- name: {{ $component }} | ||
image: {{ $config.image }} | ||
ports: | ||
{{- include "app.ports" $config | nindent 10 }} | ||
resources: | ||
{{- include "app.resources" $config | nindent 12 }} | ||
{{- if $config.env }} | ||
env: | ||
{{- range $config.env }} | ||
- name: {{ .name }} | ||
value: {{ .value }} | ||
{{- end }} | ||
{{- end }} | ||
--- | ||
{{- end }} |
23 changes: 23 additions & 0 deletions
23
pt/day-16/files/charts/giropops-senhas/templates/services.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{{- range $component, $config := .Values.services }} | ||
{{- range $port := $config.ports }} | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ $component }}-{{ $port.name }} | ||
labels: | ||
{{- include "app.labels" $config | nindent 4 }} | ||
spec: | ||
type: {{ $port.serviceType }} | ||
ports: | ||
- port: {{ $port.port }} | ||
targetPort: {{ $port.targetPort }} | ||
protocol: TCP | ||
name: {{ $port.name }} | ||
{{- if eq $port.serviceType "NodePort" }} | ||
nodePort: {{ $port.nodePort }} | ||
{{- end }} | ||
selector: | ||
app: {{ $config.labels.app }} | ||
--- | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
deployments: | ||
giropops-senhas: | ||
name: "giropops-senhas" | ||
image: "linuxtips/giropops-senhas:1.0" | ||
replicas: 2 | ||
labels: | ||
app: "giropops-senhas" | ||
env: "labs" | ||
live: "true" | ||
resources: | ||
requests: | ||
memory: "128Mi" | ||
cpu: "250m" | ||
limits: | ||
memory: "256Mi" | ||
cpu: "500m" | ||
redis: | ||
image: "redis" | ||
replicas: 1 | ||
port: 6379 | ||
labels: | ||
app: "redis" | ||
env: "labs" | ||
live: "true" | ||
resources: | ||
requests: | ||
memory: "128Mi" | ||
cpu: "250m" | ||
limits: | ||
memory: "256Mi" | ||
cpu: "500m" | ||
services: | ||
giropops-senhas: | ||
ports: | ||
- port: 5000 | ||
targetPort: 5000 | ||
name: "app" | ||
serviceType: NodePort | ||
NodePort: 32500 | ||
- port: 8088 | ||
targetPort: 8088 | ||
name: "metrics" | ||
serviceType: ClusterIP | ||
labels: | ||
app: "giropops-senhas" | ||
env: "labs" | ||
live: "true" | ||
redis: | ||
ports: | ||
- port: 6379 | ||
targetPort: 6379 | ||
name: "service" | ||
serviceType: ClusterIP | ||
labels: | ||
app: "redis" | ||
env: "labs" | ||
live: "true" | ||
observability: | ||
giropops-senhas: | ||
logging: true | ||
metrics: | ||
enabled: true | ||
path: "/metrics" | ||
databases: | ||
giropops-senhas: | ||
type: "MySQL" | ||
host: "mysql.svc.cluster.local" | ||
port: 3306 | ||
name: "MyDB" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.