Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
feat: add apps chart (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiendan authored Aug 11, 2023
1 parent 0f9ff02 commit 3a991b7
Show file tree
Hide file tree
Showing 7 changed files with 156 additions and 0 deletions.
23 changes: 23 additions & 0 deletions charts/explorer/.helmignore
Original file line number Diff line number Diff line change
@@ -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/
24 changes: 24 additions & 0 deletions charts/explorer/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: explorer
description: A Helm chart for Topos Explorer

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "main"
16 changes: 16 additions & 0 deletions charts/explorer/templates/00-explorer-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: explorer
labels:
app: explorer
spec:
type: ClusterIP
ports:
- name: http
port: { { $.Values.ports.http } }
targetPort: http
protocol: TCP
selector:
app: explorer
sessionAffinity: ClientIP
15 changes: 15 additions & 0 deletions charts/explorer/templates/01-explorer-pod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Pod
metadata:
name: explorer
labels:
app: explorer
spec:
restartPolicy: Always
containers:
- name: explorer
image: "{{ $.Values.image.repository }}:{{ $.Values.image.tag }}"
imagePullPolicy: Always
ports:
- name: http
containerPort: "{{ $.Values.containerPorts.http }}"
35 changes: 35 additions & 0 deletions charts/explorer/templates/03-lets-encrypt-issuers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{{ $issuer := lookup "cert-manager.io/v1" "Issuer" .Release.Namespace "letsencrypt-staging" }}
{{ if not $issuer }}
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: letsencrypt-staging
spec:
acme:
server: https://acme-staging-v02.api.letsencrypt.org/directory
email: {{ $.Values.acme.email }}
privateKeySecretRef:
name: letsencrypt-staging
solvers:
- http01:
ingress:
class: nginx
{{ end }}
---
{{ $issuer := lookup "cert-manager.io/v1" "Issuer" .Release.Namespace "letsencrypt-production" }}
{{ if not $issuer }}
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: letsencrypt-production
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: {{ $.Values.acme.email }}
privateKeySecretRef:
name: letsencrypt-production
solvers:
- http01:
ingress:
class: nginx
{{ end }}
23 changes: 23 additions & 0 deletions charts/explorer/templates/04-explorer-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: explorer
annotations:
kubernetes.io/ingress.class: "nginx"
cert-manager.io/issuer: "letsencrypt-{{ .Values.acme.environment }}"
spec:
tls:
- hosts:
- "{{ .Values.host }}"
secretName: "{{ .Values.host }}-secret-tls"
rules:
- host: "{{ .Values.host }}"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: explorer
port:
name: http
20 changes: 20 additions & 0 deletions charts/explorer/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Default values for tce-all-in-one.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

host: nowhere.com

acme:
email: [email protected]
# acme issuer type (staging | production)
environment: staging

image:
repository: nobody
tag: main

containerPorts:
http: 80

ports:
http: 80

0 comments on commit 3a991b7

Please sign in to comment.