diff --git a/charts/hello-world/v0.1.0/Chart.yaml b/charts/hello-world/v0.1.0/Chart.yaml new file mode 100644 index 0000000..06421e4 --- /dev/null +++ b/charts/hello-world/v0.1.0/Chart.yaml @@ -0,0 +1,16 @@ +apiVersion: v2 +name: hello-world +description: Aplicação Hello World para teste do Traefik + Gateway API + +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.0.0" diff --git a/charts/hello-world/v0.1.0/templates/deployment.yaml b/charts/hello-world/v0.1.0/templates/deployment.yaml new file mode 100644 index 0000000..b4cf8ed --- /dev/null +++ b/charts/hello-world/v0.1.0/templates/deployment.yaml @@ -0,0 +1,31 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }} + namespace: {{ .Values.namespace }} + labels: + app: {{ .Release.Name }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ .Release.Name }} + spec: + containers: + - name: {{ .Release.Name }} + image: {{ .Values.image.repository }}:{{ .Values.image.tag }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - containerPort: {{ .Values.service.targetPort }} + resources: + requests: + cpu: {{ .Values.resources.requests.cpu }} + memory: {{ .Values.resources.requests.memory }} + limits: + cpu: {{ .Values.resources.limits.cpu }} + memory: {{ .Values.resources.limits.memory }} diff --git a/charts/hello-world/v0.1.0/templates/httproute.yaml b/charts/hello-world/v0.1.0/templates/httproute.yaml new file mode 100644 index 0000000..1d19983 --- /dev/null +++ b/charts/hello-world/v0.1.0/templates/httproute.yaml @@ -0,0 +1,25 @@ +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: {{ .Release.Name }} + namespace: {{ .Values.namespace }} + labels: + app: {{ .Release.Name }} +spec: + parentRefs: + - name: {{ .Values.gateway.name }} + namespace: {{ .Values.gateway.namespace }} + sectionName: {{ .Values.gateway.listener }} + {{- if .Values.route.hostname }} + hostnames: + - {{ .Values.route.hostname | quote }} + {{- end }} + rules: + - matches: + - path: + type: PathPrefix + value: {{ .Values.route.path }} + backendRefs: + - name: {{ .Release.Name }} + namespace: {{ .Values.namespace }} + port: {{ .Values.service.port }} diff --git a/charts/hello-world/v0.1.0/templates/namespace.yaml b/charts/hello-world/v0.1.0/templates/namespace.yaml new file mode 100644 index 0000000..77db5f9 --- /dev/null +++ b/charts/hello-world/v0.1.0/templates/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: {{ .Values.namespace }} diff --git a/charts/hello-world/v0.1.0/templates/service.yaml b/charts/hello-world/v0.1.0/templates/service.yaml new file mode 100644 index 0000000..1096a3f --- /dev/null +++ b/charts/hello-world/v0.1.0/templates/service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }} + namespace: {{ .Values.namespace }} + labels: + app: {{ .Release.Name }} +spec: + selector: + app: {{ .Release.Name }} + ports: + - port: {{ .Values.service.port }} + targetPort: {{ .Values.service.targetPort }} diff --git a/charts/hello-world/v0.1.0/values.yaml b/charts/hello-world/v0.1.0/values.yaml new file mode 100644 index 0000000..e258852 --- /dev/null +++ b/charts/hello-world/v0.1.0/values.yaml @@ -0,0 +1,41 @@ +# Namespace onde a aplicação será instalada +namespace: hello-world + +# Configurações do Deployment +replicaCount: 1 + +image: + repository: nginxdemos/hello + tag: plain-text + pullPolicy: IfNotPresent + +resources: + requests: + cpu: 50m + memory: 64Mi + limits: + cpu: 100m + memory: 128Mi + +# Configurações do Service +service: + port: 80 + targetPort: 80 + +# Configurações do Gateway API +gateway: + # Nome do Gateway criado pelo _traefik.tpl + name: internal + # Namespace onde o Gateway está instalado + namespace: traefik-internal + # Listener a usar: http (porta 80) ou https (porta 443) + listener: http + +# Rota HTTP +route: + # Deixar vazio para aceitar qualquer host (acesso por IP) + # Preencher para rotear por hostname: hello.interlegis.leg.br + hostname: "" + # Prefixo de path + path: / + \ No newline at end of file