diff --git a/charts/eventcatalog/.helmignore b/charts/eventcatalog/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/eventcatalog/.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/eventcatalog/Chart.yaml b/charts/eventcatalog/Chart.yaml new file mode 100644 index 0000000..c49ca0d --- /dev/null +++ b/charts/eventcatalog/Chart.yaml @@ -0,0 +1,8 @@ +apiVersion: v2 +name: eventcatalog +description: A Helm chart for deploying EventCatalog's static site +type: application +version: 0.1.0 +appVersion: "1.0.1" +maintainers: + - name: oso diff --git a/charts/eventcatalog/templates/deployment.yaml b/charts/eventcatalog/templates/deployment.yaml new file mode 100644 index 0000000..40aaa9e --- /dev/null +++ b/charts/eventcatalog/templates/deployment.yaml @@ -0,0 +1,23 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Chart.Name }} + labels: + app: {{ .Chart.Name }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app: {{ .Chart.Name }} + template: + metadata: + labels: + app: {{ .Chart.Name }} + spec: + containers: + - name: {{.Values.image.name}} + image: {{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }} + ports: + - containerPort: {{ .Values.service.port }} + resources: + {{- toYaml .Values.resources | nindent 12 }} \ No newline at end of file diff --git a/charts/eventcatalog/templates/ingress.yaml b/charts/eventcatalog/templates/ingress.yaml new file mode 100644 index 0000000..2bba899 --- /dev/null +++ b/charts/eventcatalog/templates/ingress.yaml @@ -0,0 +1,51 @@ +{{- if .Values.ingress.enabled }} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ .Chart.Name }} + annotations: + {{- range $key, $value := .Values.ingress.annotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} +spec: + ingressClassName: {{ .Values.ingress.ingressClass }} + {{- if and .Values.ingress.domain (not (empty .Values.ingress.hosts)) }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + pathType: {{ .pathType }} + backend: + service: + name: {{ $.Chart.Name }} # Accessing chart name globally + port: + number: {{ $.Values.service.port }} + {{- end }} + {{- end }} + {{- else }} + # If no domain, use default path without host + rules: + - http: + paths: + - path: / + pathType: ImplementationSpecific + backend: + service: + name: {{ .Chart.Name }} + port: + number: {{ $.Values.service.port }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} +{{- end }} diff --git a/charts/eventcatalog/templates/service.yaml b/charts/eventcatalog/templates/service.yaml new file mode 100644 index 0000000..a8a4ce9 --- /dev/null +++ b/charts/eventcatalog/templates/service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Chart.Name }} + labels: + app: {{ .Chart.Name }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: 80 + selector: + app: {{ .Chart.Name }} diff --git a/charts/eventcatalog/values.yaml b/charts/eventcatalog/values.yaml new file mode 100644 index 0000000..c2c62ad --- /dev/null +++ b/charts/eventcatalog/values.yaml @@ -0,0 +1,35 @@ +replicaCount: 1 +image: + name: eventcatalog + # Container image with static EventCatalog demo built + repository: quay.io/osodevops/eventcatalog + # If not specified, defaults to .Chart.AppVersion + tag: "" + pullPolicy: IfNotPresent +service: + type: ClusterIP + # Default port for the service + port: 80 +ingress: + enabled: true + domain: true + ingressClass: nginx + annotations: + nginx.ingress.kubernetes.io/rewrite-target: / + cert-manager.io/cluster-issuer: letsencrypt-prod + hosts: + - host: example.com + paths: + - path: / + pathType: ImplementationSpecific + tls: + - secretName: test-eventcatalog + hosts: + - example.com +resources: + requests: + memory: "256Mi" + cpu: "500m" + limits: + memory: "512Mi" + cpu: "1"