From 037b2ba89c8b733c50af54a391d213a3d9dc43a4 Mon Sep 17 00:00:00 2001 From: Leon Liu Date: Sun, 17 Nov 2024 07:54:01 +0900 Subject: [PATCH] add silverbullet --- apps/templates/silverbullet.yaml | 16 +++++++++++++ silverbullet/Chart.yaml | 23 ++++++++++++++++++ silverbullet/templates/deployment.yaml | 33 ++++++++++++++++++++++++++ silverbullet/templates/ingress.yaml | 23 ++++++++++++++++++ silverbullet/templates/pvc.yaml | 10 ++++++++ silverbullet/templates/service.yaml | 11 +++++++++ silverbullet/values.yaml | 3 +++ simple-app/templates/deployment.yaml | 2 ++ 8 files changed, 121 insertions(+) create mode 100644 apps/templates/silverbullet.yaml create mode 100644 silverbullet/Chart.yaml create mode 100644 silverbullet/templates/deployment.yaml create mode 100644 silverbullet/templates/ingress.yaml create mode 100644 silverbullet/templates/pvc.yaml create mode 100644 silverbullet/templates/service.yaml create mode 100644 silverbullet/values.yaml diff --git a/apps/templates/silverbullet.yaml b/apps/templates/silverbullet.yaml new file mode 100644 index 0000000..2fc6351 --- /dev/null +++ b/apps/templates/silverbullet.yaml @@ -0,0 +1,16 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: silverbullet.yaml + namespace: argocd +spec: + destination: + namespace: silverbullet + server: {{ .Values.spec.destination.server }} + project: default + source: + path: silverbullet + repoURL: {{ .Values.spec.source.repoURL }} + targetRevision: {{ .Values.spec.source.targetRevision }} + syncPolicy: + automated: {} \ No newline at end of file diff --git a/silverbullet/Chart.yaml b/silverbullet/Chart.yaml new file mode 100644 index 0000000..a74acee --- /dev/null +++ b/silverbullet/Chart.yaml @@ -0,0 +1,23 @@ +apiVersion: v2 +name: silverbullet +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/silverbullet/templates/deployment.yaml b/silverbullet/templates/deployment.yaml new file mode 100644 index 0000000..81566a3 --- /dev/null +++ b/silverbullet/templates/deployment.yaml @@ -0,0 +1,33 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }} + labels: + app: {{ .Release.Name }} +spec: + replicas: 1 + selector: + matchLabels: + app: {{ .Release.Name }} + strategy: + type: Recreate + template: + metadata: + labels: + app: {{ .Release.Name }} + spec: + containers: + - name: {{ .Release.Name }} + image: {{ .Values.image }} + env: + - name: SB_USER + value: leonliuy:1234 + ports: + - containerPort: {{ .Values.containerPort }} + volumeMounts: + - mountPath: /space + name: data + volumes: + - name: data + persistentVolumeClaim: + claimName: {{ .Release.Name }}-data \ No newline at end of file diff --git a/silverbullet/templates/ingress.yaml b/silverbullet/templates/ingress.yaml new file mode 100644 index 0000000..86ec8ee --- /dev/null +++ b/silverbullet/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/silverbullet/templates/pvc.yaml b/silverbullet/templates/pvc.yaml new file mode 100644 index 0000000..d19f9ff --- /dev/null +++ b/silverbullet/templates/pvc.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }}-data +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi \ No newline at end of file diff --git a/silverbullet/templates/service.yaml b/silverbullet/templates/service.yaml new file mode 100644 index 0000000..6cd9c62 --- /dev/null +++ b/silverbullet/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/silverbullet/values.yaml b/silverbullet/values.yaml new file mode 100644 index 0000000..b07f54e --- /dev/null +++ b/silverbullet/values.yaml @@ -0,0 +1,3 @@ +host: notes.ly-dodo.win +containerPort: 3000 +image: zefhemel/silverbullet:latest \ No newline at end of file diff --git a/simple-app/templates/deployment.yaml b/simple-app/templates/deployment.yaml index 282ce0f..e594e18 100644 --- a/simple-app/templates/deployment.yaml +++ b/simple-app/templates/deployment.yaml @@ -9,6 +9,8 @@ spec: selector: matchLabels: app: {{ .Release.Name }} + strategy: + type: Recreate template: metadata: labels: