From a864c75a68c71ee16fe7ffb66c7ef6e9ee2af041 Mon Sep 17 00:00:00 2001 From: Julian Date: Fri, 31 Oct 2025 15:51:20 +0000 Subject: [PATCH] Upload files to "affine/templates" --- affine/templates/NOTES.txt | 22 +++++++++++++++ affine/templates/pvc.yaml | 41 ++++++++++++++++++++++++++++ affine/templates/service.yaml | 13 +++++++++ affine/templates/serviceaccount.yaml | 13 +++++++++ 4 files changed, 89 insertions(+) create mode 100644 affine/templates/NOTES.txt create mode 100644 affine/templates/pvc.yaml create mode 100644 affine/templates/service.yaml create mode 100644 affine/templates/serviceaccount.yaml diff --git a/affine/templates/NOTES.txt b/affine/templates/NOTES.txt new file mode 100644 index 0000000..bfa479f --- /dev/null +++ b/affine/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "affine.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "affine.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "affine.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "affine.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/affine/templates/pvc.yaml b/affine/templates/pvc.yaml new file mode 100644 index 0000000..5033bee --- /dev/null +++ b/affine/templates/pvc.yaml @@ -0,0 +1,41 @@ +{{- if .Values.affine.persistence.enabled }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "affine.fullname" . }}-storage + labels: + {{- include "affine.labels" . | nindent 4 }} +spec: + accessModes: + {{- toYaml .Values.affine.persistence.accessModes | nindent 4 }} + resources: + requests: + storage: {{ .Values.affine.persistence.size | quote }} + {{- if .Values.affine.persistence.storageClassName }} + storageClassName: {{ .Values.affine.persistence.storageClassName }} + {{- end }} + {{- if .Values.affine.persistence.existingClaim }} + volumeName: {{ .Values.affine.persistence.existingClaim }} + {{- end }} +--- +{{- end }} +{{- if .Values.affine.configPersistence.enabled }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "affine.fullname" . }}-config + labels: + {{- include "affine.labels" . | nindent 4 }} +spec: + accessModes: + {{- toYaml .Values.affine.configPersistence.accessModes | nindent 4 }} + resources: + requests: + storage: {{ .Values.affine.configPersistence.size | quote }} + {{- if .Values.affine.configPersistence.storageClassName }} + storageClassName: {{ .Values.affine.configPersistence.storageClassName }} + {{- end }} + {{- if .Values.affine.configPersistence.existingClaim }} + volumeName: {{ .Values.affine.configPersistence.existingClaim }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/affine/templates/service.yaml b/affine/templates/service.yaml new file mode 100644 index 0000000..4a25981 --- /dev/null +++ b/affine/templates/service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "affine.fullname" . }} + labels: {{- include "affine.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: {{- include "affine.selectorLabels" . | nindent 4 }} diff --git a/affine/templates/serviceaccount.yaml b/affine/templates/serviceaccount.yaml new file mode 100644 index 0000000..34ba051 --- /dev/null +++ b/affine/templates/serviceaccount.yaml @@ -0,0 +1,13 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "affine.serviceAccountName" . }} + labels: + {{- include "affine.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automount }} +{{- end }}