From 8712a6745f52cc0b3c9b195a090305a0b7ace999 Mon Sep 17 00:00:00 2001 From: Leon Liu Date: Fri, 8 Nov 2024 17:13:00 +0900 Subject: [PATCH] Initial template. --- apps/Chart.yaml | 23 +++++++++++++++++++++++ apps/templates/resume.yaml | 0 apps/values.yaml | 6 ++++++ simple-app/Chart.yaml | 23 +++++++++++++++++++++++ simple-app/templates/deployment.yaml | 23 +++++++++++++++++++++++ simple-app/templates/ingress.yaml | 23 +++++++++++++++++++++++ simple-app/templates/service.yaml | 11 +++++++++++ simple-app/values.yaml | 3 +++ 8 files changed, 112 insertions(+) create mode 100644 apps/Chart.yaml create mode 100644 apps/templates/resume.yaml create mode 100644 apps/values.yaml create mode 100644 simple-app/Chart.yaml create mode 100644 simple-app/templates/deployment.yaml create mode 100644 simple-app/templates/ingress.yaml create mode 100644 simple-app/templates/service.yaml create mode 100644 simple-app/values.yaml diff --git a/apps/Chart.yaml b/apps/Chart.yaml new file mode 100644 index 0000000..2af55aa --- /dev/null +++ b/apps/Chart.yaml @@ -0,0 +1,23 @@ +apiVersion: v2 +name: applications +description: Applications + +# 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. +appVersion: "1.0" \ No newline at end of file diff --git a/apps/templates/resume.yaml b/apps/templates/resume.yaml new file mode 100644 index 0000000..e69de29 diff --git a/apps/values.yaml b/apps/values.yaml new file mode 100644 index 0000000..7efa60b --- /dev/null +++ b/apps/values.yaml @@ -0,0 +1,6 @@ +spec: + destination: + server: https://kubernetes.default.svc + source: + repoURL: git@gitea.ly-dodo.win:leonliuy/argocd-apps.git + targetRevision: HEAD \ No newline at end of file diff --git a/simple-app/Chart.yaml b/simple-app/Chart.yaml new file mode 100644 index 0000000..f7f5ee4 --- /dev/null +++ b/simple-app/Chart.yaml @@ -0,0 +1,23 @@ +apiVersion: v2 +name: simple-app +description: A Helm chart for Kubernetes + +# 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. +appVersion: "1.0" \ No newline at end of file diff --git a/simple-app/templates/deployment.yaml b/simple-app/templates/deployment.yaml new file mode 100644 index 0000000..282ce0f --- /dev/null +++ b/simple-app/templates/deployment.yaml @@ -0,0 +1,23 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }} + labels: + app: {{ .Release.Name }} +spec: + replicas: 1 + selector: + matchLabels: + app: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ .Release.Name }} + spec: + containers: + - name: {{ .Release.Name }} + image: {{ .Values.image }} + ports: + - containerPort: {{ .Values.containerPort }} + imagePullSecrets: + - name: ghcr-auth \ No newline at end of file diff --git a/simple-app/templates/ingress.yaml b/simple-app/templates/ingress.yaml new file mode 100644 index 0000000..86ec8ee --- /dev/null +++ b/simple-app/templates/ingress.yaml @@ -0,0 +1,23 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ .Release.Name }} + annotations: + cert-manager.io/cluster-issuer: letsencrypt-prod +spec: + ingressClassName: nginx + rules: + - host: {{ .Values.host }} + http: + paths: + - pathType: Prefix + path: "/" + backend: + service: + name: {{ .Release.Name }} + port: + number: 80 + tls: + - hosts: + - {{ .Values.host }} + secretName: {{ .Release.Name }}-tls \ No newline at end of file diff --git a/simple-app/templates/service.yaml b/simple-app/templates/service.yaml new file mode 100644 index 0000000..6cd9c62 --- /dev/null +++ b/simple-app/templates/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }} +spec: + selector: + app: {{ .Release.Name }} + ports: + - protocol: TCP + port: 80 + targetPort: {{ .Values.containerPort }} \ No newline at end of file diff --git a/simple-app/values.yaml b/simple-app/values.yaml new file mode 100644 index 0000000..c1e4c84 --- /dev/null +++ b/simple-app/values.yaml @@ -0,0 +1,3 @@ +host: +containerPort: +image: \ No newline at end of file