Skip to content

The Unified and Autonomous Development Platform

Fix issue #445 - Letsencrypt support on k8s installation

Robin Shencef76c1d7bff
diff --git a/server-core/src/main/java/io/onedev/server/web/page/admin/issuesetting/transitionspec/StateTransitionListPage.html b/server-core/src/main/java/io/onedev/server/web/page/admin/issuesetting/transitionspec/StateTransitionListPage.html
index 1370e38e53..59b9a9d69a 100644
--- a/server-core/src/main/java/io/onedev/server/web/page/admin/issuesetting/transitionspec/StateTransitionListPage.html
+++ b/server-core/src/main/java/io/onedev/server/web/page/admin/issuesetting/transitionspec/StateTransitionListPage.html
@@ -1,9 +1,5 @@
<wicket:extend>
<div class="state-transitions">
- <div class="text-muted mb-4">
- <wicket:svg href="bulb" class="icon"/> Define default issue transitions for all projects here.
- A certain project can override this setting to define its own issue transitions.
- </div>
<a wicket:id="addNew" class="btn btn-icon btn-primary mb-4" title="Add issue state transition"><wicket:svg href="plus" class="icon"></wicket:svg></a>
<table wicket:id="stateTransitions" class="table table-hover"></table>
</div>
diff --git a/server-product/helm/CHANGELOG.md b/server-product/helm/CHANGELOG.md
new file mode 100644
index 0000000000..bfdd326a98
--- /dev/null
+++ b/server-product/helm/CHANGELOG.md
@@ -0,0 +1 @@
+Please check https://github.com/theonedev/onedev/releases
diff --git a/server-product/helm/Chart.yaml b/server-product/helm/Chart.yaml
index aac0e12984..c15d324585 100644
--- a/server-product/helm/Chart.yaml
+++ b/server-product/helm/Chart.yaml
@@ -2,5 +2,6 @@ apiVersion: v2
name: onedev
description: All-In-One DevOps Platform
type: application
+kubeVersion: ">=1.18.0-0"
version: ${buildVersion}
appVersion: ${buildVersion}
diff --git a/server-product/helm/README.md b/server-product/helm/README.md
new file mode 100644
index 0000000000..84e98ed6c8
--- /dev/null
+++ b/server-product/helm/README.md
@@ -0,0 +1 @@
+https://code.onedev.io/projects/162/blob/main/pages/deploy-into-k8s.md#installation-using-helm
diff --git a/server-product/helm/build.sh b/server-product/helm/build.sh
old mode 100644
new mode 100755
index 28a48f273d..1b317a46d3
--- a/server-product/helm/build.sh
+++ b/server-product/helm/build.sh
@@ -6,16 +6,18 @@ cd ../target
buildVersion=`ls onedev-*.zip|sed -e 's/onedev-\(.*\).zip/\1/'`
-rm -rf helm-resources
-cp -r ../helm helm-resources
-rm helm-resources/build.sh
+rm -rf helm-chart
+mkdir -p helm-chart/onedev
+cp -r ../helm/* helm-chart/onedev
+rm helm-chart/onedev/build.sh
if [[ "$OSTYPE" == "darwin"* ]]; then
- find helm-resources -name "*.yaml" | xargs sed -i '' "s/\${buildVersion}/${buildVersion}/g"
+ find helm-chart -name "*.yaml" | xargs sed -i '' "s/\${buildVersion}/${buildVersion}/g"
else
- find helm-resources -name "*.yaml" | xargs sed -i -e "s/\${buildVersion}/${buildVersion}/g"
+ find helm-chart -name "*.yaml" | xargs sed -i -e "s/\${buildVersion}/${buildVersion}/g"
fi
-zip -r helm-resources.zip helm-resources
+cd helm-chart
+tar zcvf onedev-${buildVersion}.tgz onedev
diff --git a/server-product/helm/templates/NOTES.txt b/server-product/helm/templates/NOTES.txt
deleted file mode 100644
index b94cf12b7e..0000000000
--- a/server-product/helm/templates/NOTES.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-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 }}
-{{- end }}
\ No newline at end of file
diff --git a/server-product/helm/templates/_helpers.tpl b/server-product/helm/templates/_helpers.tpl
index b6008cde47..84a75f019f 100644
--- a/server-product/helm/templates/_helpers.tpl
+++ b/server-product/helm/templates/_helpers.tpl
@@ -49,14 +49,3 @@ Selector labels
app.kubernetes.io/name: {{ include "onedev.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
-
-{{/*
-Create the name of the service account to use
-*/}}
-{{- define "onedev.serviceAccountName" -}}
-{{- if .Values.serviceAccount.create }}
-{{- default (include "onedev.fullname" .) .Values.serviceAccount.name }}
-{{- else }}
-{{- default "default" .Values.serviceAccount.name }}
-{{- end }}
-{{- end }}
diff --git a/server-product/helm/templates/cluster-role-bindings.yaml b/server-product/helm/templates/cluster-role-bindings.yaml
deleted file mode 100644
index d08684b074..0000000000
--- a/server-product/helm/templates/cluster-role-bindings.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-kind: ClusterRoleBinding
-apiVersion: rbac.authorization.k8s.io/v1
-metadata:
- name: onedev
-subjects:
- - kind: ServiceAccount
- name: onedev
- namespace: onedev
- - kind: ServiceAccount
- name: deploy
- namespace: deploy
-roleRef:
- kind: ClusterRole
- name: onedev
- apiGroup: rbac.authorization.k8s.io
diff --git a/server-product/helm/templates/cluster-roles.yaml b/server-product/helm/templates/clusterrole.yaml
similarity index 87%
rename from server-product/helm/templates/cluster-roles.yaml
rename to server-product/helm/templates/clusterrole.yaml
index 69bd3a7f65..19d946121a 100644
--- a/server-product/helm/templates/cluster-roles.yaml
+++ b/server-product/helm/templates/clusterrole.yaml
@@ -1,7 +1,9 @@
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
- name: onedev
+ name: {{ include "onedev.fullname" . }}
+ labels:
+ {{- include "onedev.labels" . | nindent 4 }}
rules:
- apiGroups: [""]
resources: ["namespaces"]
@@ -17,4 +19,4 @@ rules:
verbs: ["get", "list", "watch", "create", "patch", "delete"] #require this permission to run builds as pods
- apiGroups: ["apps"]
resources: ["deployments"]
- verbs: ["get", "list", "create", "patch", "delete"] #require this permission to run builds as pods
\ No newline at end of file
+ verbs: ["get", "list", "create", "patch", "delete"] #require this permission to run builds as pods
diff --git a/server-product/helm/templates/clusterrolebinding.yaml b/server-product/helm/templates/clusterrolebinding.yaml
new file mode 100644
index 0000000000..4c308362f3
--- /dev/null
+++ b/server-product/helm/templates/clusterrolebinding.yaml
@@ -0,0 +1,14 @@
+kind: ClusterRoleBinding
+apiVersion: rbac.authorization.k8s.io/v1
+metadata:
+ name: {{ include "onedev.fullname" . }}
+ labels:
+ {{- include "onedev.labels" . | nindent 4 }}
+subjects:
+ - kind: ServiceAccount
+ namespace: {{ .Release.Namespace }}
+ name: {{ include "onedev.fullname" . }}
+roleRef:
+ kind: ClusterRole
+ name: {{ include "onedev.fullname" . }}
+ apiGroup: rbac.authorization.k8s.io
diff --git a/server-product/helm/templates/deployment.yaml b/server-product/helm/templates/deployment.yaml
index 1a6339dc3c..7bb100ec84 100644
--- a/server-product/helm/templates/deployment.yaml
+++ b/server-product/helm/templates/deployment.yaml
@@ -1,38 +1,41 @@
apiVersion: apps/v1
kind: Deployment
metadata:
- name: {{ .Release.Name }}-onedev
+ name: {{ include "onedev.fullname" . }}
labels:
- tier: server
{{- include "onedev.labels" . | nindent 4 }}
+ tier: onedev
spec:
replicas: 1 # only allow one replicas as OneDev doesn't support clustering
selector:
matchLabels:
- tier: server
- app: onedev
+ {{- include "onedev.selectorLabels" . | nindent 6 }}
+ tier: onedev
strategy:
type: Recreate
template:
metadata:
+ name: {{ include "onedev.fullname" . }}
labels:
- tier: server
- app: onedev
- {{- with .Values.podAnnotations }}
- annotations:
- {{- toYaml . | nindent 8 }}
- {{- end }}
+ {{- include "onedev.selectorLabels" . | nindent 8 }}
+ tier: onedev
spec:
- serviceAccountName: onedev
+ serviceAccountName: {{ include "onedev.fullname" . }}
+ {{- if .Values.nodeSelector.onedev }}
+ nodeSelector: {{ toYaml .Values.nodeSelector.onedev | nindent 8 }}
+ {{- end }}
containers:
- name: onedev
+ {{- if .Values.maintenance }}
+ command: ["/root/bin/idle.sh"]
+ {{- end }}
resources:
requests:
memory: {{ .Values.resources.onedev.memory }}
volumeMounts:
- mountPath: "/opt/onedev"
name: onedev
- image: "1dev/server:{{ .Values.image.tag | default .Chart.AppVersion }}"
+ image: "1dev/server:{{ .Chart.AppVersion }}"
ports:
- containerPort: 6610
- containerPort: 6611
@@ -42,51 +45,53 @@ spec:
- name: hibernate_connection_driver_class
value: com.mysql.cj.jdbc.Driver
- name: hibernate_connection_url
- value: jdbc:mysql://{{ .Release.Name }}-mysql:3306/onedev?serverTimezone=UTC&allowPublicKeyRetrieval=true&useSSL=false
+ value: jdbc:mysql://{{ include "onedev.fullname" . }}-mysql:3306/onedev?serverTimezone=UTC&allowPublicKeyRetrieval=true&useSSL=false
- name: hibernate_connection_username
value: root
- name: hibernate_connection_password
valueFrom:
secretKeyRef:
- name: {{.Release.Name}}-mysql
+ name: {{ include "onedev.fullname" . }}-mysql
key: password
- name: hibernate_hikari_maximumPoolSize
value: "25"
initContainers:
- name: init
image: busybox
- command: ["sh", "-c", "until nslookup {{ .Release.Name }}-mysql.{{.Release.Namespace}}.svc.cluster.local; do echo waiting for mysql; sleep 2; done;"]
+ command: ["sh", "-c", "until nslookup {{ include "onedev.fullname" . }}-mysql.{{.Release.Namespace}}.svc.cluster.local; do echo waiting for mysql; sleep 2; done;"]
volumes:
- name: onedev
persistentVolumeClaim:
- claimName: {{ .Release.Name }}-onedev
+ claimName: {{ include "onedev.fullname" . }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
- name: {{ .Release.Name }}-mysql
+ name: {{ include "onedev.fullname" . }}-mysql
labels:
- tier: database
+ {{- include "onedev.labels" . | nindent 4 }}
+ tier: mysql
spec:
selector:
matchLabels:
- tier: database
+ {{- include "onedev.selectorLabels" . | nindent 6 }}
+ tier: mysql
strategy:
type: Recreate
template:
metadata:
- name: mysql
+ name: {{ include "onedev.fullname" . }}-mysql
labels:
- tier: database
- app: onedev
+ {{- include "onedev.selectorLabels" . | nindent 8 }}
+ tier: mysql
spec:
+ {{- if .Values.nodeSelector.onedev }}
+ nodeSelector: {{ toYaml .Values.nodeSelector.mysql | nindent 8 }}
+ {{- end }}
containers:
- name: mysql
image: mysql:5.7
- resources:
- requests:
- memory: {{ .Values.resources.mysql.memory }}
args:
- "--ignore-db-dir=lost+found"
env:
@@ -95,10 +100,13 @@ spec:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
- name: {{.Release.Name}}-mysql
+ name: {{include "onedev.fullname" . }}-mysql
key: password
ports:
- containerPort: 3306
+ resources:
+ requests:
+ memory: {{ .Values.resources.mysql.memory }}
volumeMounts:
- name: mysql
mountPath: /var/lib/mysql
@@ -115,4 +123,4 @@ spec:
volumes:
- name: mysql
persistentVolumeClaim:
- claimName: {{ .Release.Name }}-mysql
\ No newline at end of file
+ claimName: {{ include "onedev.fullname" . }}-mysql
diff --git a/server-product/helm/templates/ingress.yaml b/server-product/helm/templates/ingress.yaml
index c60f942915..90b3ecb171 100644
--- a/server-product/helm/templates/ingress.yaml
+++ b/server-product/helm/templates/ingress.yaml
@@ -1,34 +1,29 @@
-{{- if .Values.ingress.enabled -}}
-{{- $fullName := include "onedev.fullname" . -}}
-{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
-apiVersion: networking.k8s.io/v1beta1
-{{- else -}}
-apiVersion: extensions/v1beta1
-{{- end }}
+{{- if .Values.ingress.host -}}
+apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
- name: {{ .Release.Name }}
+ name: {{ include "onedev.fullname" . }}
+ {{- if .Values.letsencrypt.email }}
+ annotations:
+ cert-manager.io/issuer: "{{ include "onedev.fullname" . }}"
+ {{- end }}
spec:
+ ingressClassName: {{ .Values.ingress.class }}
{{- if .Values.ingress.tls }}
tls:
- {{- range .Values.ingress.tls }}
- - hosts:
- {{- range .hosts }}
- - {{ . | quote }}
- {{- end }}
- secretName: {{ .secretName }}
- {{- end }}
+ - hosts:
+ - {{ .Values.ingress.host }}
+ secretName: {{ include "onedev.fullname" . }}-tls
{{- end }}
rules:
- {{- range .Values.ingress.hosts }}
- - host: {{ .host | quote }}
+ - host: {{ .Values.ingress.host }}
http:
paths:
- {{- range .paths }}
- - path: {{ .path }}
- backend:
- serviceName: {{ template "onedev.fullname" $ }}-onedev
- servicePort: 80
- {{- end }}
- {{- end }}
- {{- end }}
+ - path: /
+ pathType: Prefix
+ backend:
+ service:
+ name: {{ include "onedev.fullname" . }}-http
+ port:
+ number: 80
+{{- end }}
diff --git a/server-product/helm/templates/issuer.yaml b/server-product/helm/templates/issuer.yaml
new file mode 100644
index 0000000000..56b431a651
--- /dev/null
+++ b/server-product/helm/templates/issuer.yaml
@@ -0,0 +1,16 @@
+{{- if .Values.letsencrypt.email -}}
+apiVersion: cert-manager.io/v1
+kind: Issuer
+metadata:
+ name: {{ include "onedev.fullname" .}}
+spec:
+ acme:
+ server: https://acme-v02.api.letsencrypt.org/directory
+ email: {{ .Values.letsencrypt.email }}
+ privateKeySecretRef:
+ name: {{ include "onedev.fullname" . }}-private-key
+ solvers:
+ - http01:
+ ingress:
+ class: {{ .Values.ingress.class }}
+{{- end }}
diff --git a/server-product/helm/templates/persistent-volume-claims.yaml b/server-product/helm/templates/persistentvolumeclaim.yaml
similarity index 52%
rename from server-product/helm/templates/persistent-volume-claims.yaml
rename to server-product/helm/templates/persistentvolumeclaim.yaml
index 9e6c071c8a..9da6da5aa8 100644
--- a/server-product/helm/templates/persistent-volume-claims.yaml
+++ b/server-product/helm/templates/persistentvolumeclaim.yaml
@@ -1,37 +1,37 @@
-{{- $onedevPvc := lookup "v1" "PersistentVolumeClaim" .Release.Namespace "onedev" -}}
-{{- if not $onedevPvc }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
+ name: {{ include "onedev.fullname" . }}
+ labels:
+ {{- include "onedev.labels" . | nindent 4 }}
+ tier: onedev
annotations:
"helm.sh/resource-policy": keep
- name: {{ .Release.Name }}-onedev
- labels:
- tier: server
spec:
+ {{- if .Values.volumes.onedev.storageClassName }}
storageClassName: {{ .Values.volumes.onedev.storageClassName }}
+ {{- end }}
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.volumes.onedev.size }}
- {{- end }}
---
-{{- $mysqlPvc := lookup "v1" "PersistentVolumeClaim" .Release.Namespace "mysql" -}}
-{{ if not $mysqlPvc }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
+ name: {{ include "onedev.fullname" . }}-mysql
+ labels:
+ {{- include "onedev.labels" . | nindent 4 }}
+ tier: mysql
annotations:
"helm.sh/resource-policy": keep
- name: {{ .Release.Name }}-mysql
- labels:
- tier: database
spec:
- storageClassName: {{ .Values.volumes.onedev.storageClassName }}
+ {{- if .Values.volumes.mysql.storageClassName }}
+ storageClassName: {{ .Values.volumes.mysql.storageClassName }}
+ {{- end }}
accessModes:
- ReadWriteOnce
resources:
requests:
- storage: {{ .Values.volumes.onedev.size }}
-{{- end }}
\ No newline at end of file
+ storage: {{ .Values.volumes.mysql.size }}
diff --git a/server-product/helm/templates/secret.yaml b/server-product/helm/templates/secret.yaml
new file mode 100644
index 0000000000..73022a61e3
--- /dev/null
+++ b/server-product/helm/templates/secret.yaml
@@ -0,0 +1,6 @@
+apiVersion: v1
+kind: Secret
+metadata:
+ name: {{ include "onedev.fullname" . }}-mysql
+stringData:
+ password: {{ .Values.secrets.mysql.password }}
diff --git a/server-product/helm/templates/secrets.yaml b/server-product/helm/templates/secrets.yaml
deleted file mode 100644
index 6b9f792862..0000000000
--- a/server-product/helm/templates/secrets.yaml
+++ /dev/null
@@ -1,20 +0,0 @@
-{{- $secret_name := "{{.Release.Name}}-mysql" -}}
-
-apiVersion: v1
-kind: Secret
-metadata:
- name: {{.Release.Name}}-mysql
-
-data:
- # try to get the old secret
- # keep in mind, that a dry-run only returns an empty map
- {{- $old_sec := lookup "v1" "Secret" .Release.Namespace $secret_name }}
-
- # check, if a secret is already set
- {{- if or (not $old_sec) (not $old_sec.data) }}
- # if not set, then generate a new password
- password: {{ randAlphaNum 20 | b64enc }}
- {{ else }}
- # if set, then use the old value
- password: {{ index $old_sec.data "password" }}
- {{ end }}
\ No newline at end of file
diff --git a/server-product/helm/templates/service-accounts.yaml b/server-product/helm/templates/service-accounts.yaml
deleted file mode 100644
index 94919ff538..0000000000
--- a/server-product/helm/templates/service-accounts.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-apiVersion: v1
-kind: ServiceAccount
-metadata:
- name: onedev
diff --git a/server-product/helm/templates/service.yaml b/server-product/helm/templates/service.yaml
new file mode 100644
index 0000000000..eb038a5076
--- /dev/null
+++ b/server-product/helm/templates/service.yaml
@@ -0,0 +1,73 @@
+{{- if .Values.ingress.host -}}
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ include "onedev.fullname" . }}-http
+ labels:
+ {{- include "onedev.labels" . | nindent 4 }}
+ tier: onedev
+ protocol: http
+spec:
+ ports:
+ - name: http
+ port: 80
+ targetPort: 6610
+ protocol: TCP
+ selector:
+ {{- include "onedev.selectorLabels" . | nindent 4 }}
+ tier: onedev
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ include "onedev.fullname" . }}-ssh
+ labels:
+ {{- include "onedev.labels" . | nindent 4 }}
+ tier: onedev
+ protocol: ssh
+spec:
+ ports:
+ - name: ssh
+ port: 22
+ targetPort: 6611
+ protocol: TCP
+ selector:
+ {{- include "onedev.selectorLabels" . | nindent 4 }}
+ tier: onedev
+{{- else }}
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ include "onedev.fullname" . }}
+ labels:
+ {{- include "onedev.labels" . | nindent 4 }}
+ tier: onedev
+spec:
+ type: LoadBalancer
+ ports:
+ - name: http
+ port: 80
+ targetPort: 6610
+ protocol: TCP
+ - name: ssh
+ port: 22
+ targetPort: 6611
+ protocol: TCP
+ selector:
+ {{- include "onedev.selectorLabels" . | nindent 4 }}
+ tier: onedev
+{{- end }}
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ include "onedev.fullname" . }}-mysql
+ labels:
+ {{- include "onedev.labels" . | nindent 4 }}
+ tier: mysql
+spec:
+ ports:
+ - port: 3306
+ selector:
+ {{- include "onedev.selectorLabels" . | nindent 4 }}
+ tier: mysql
diff --git a/server-product/helm/templates/serviceaccount.yaml b/server-product/helm/templates/serviceaccount.yaml
new file mode 100644
index 0000000000..7be79ae4ee
--- /dev/null
+++ b/server-product/helm/templates/serviceaccount.yaml
@@ -0,0 +1,6 @@
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+ name: {{ include "onedev.fullname" . }}
+ labels:
+ {{- include "onedev.labels" . | nindent 4 }}
diff --git a/server-product/helm/templates/services.yaml b/server-product/helm/templates/services.yaml
deleted file mode 100644
index d51ef55692..0000000000
--- a/server-product/helm/templates/services.yaml
+++ /dev/null
@@ -1,33 +0,0 @@
-apiVersion: v1
-kind: Service
-metadata:
- name: {{ .Release.Name }}-onedev
- labels:
- tier: server
- app: ondev
-spec:
- type: ClusterIP
- ports:
- - name: http
- port: 80
- targetPort: 6610
- protocol: TCP
- - name: ssh
- port: 22
- targetPort: 6611
- protocol: TCP
- selector:
- tier: server
----
-apiVersion: v1
-kind: Service
-metadata:
- name: {{ .Release.Name }}-mysql
- labels:
- tier: database
- app: onedev
-spec:
- ports:
- - port: 3306
- selector:
- tier: database
diff --git a/server-product/helm/values.yaml b/server-product/helm/values.yaml
index 085f4f0719..ce81e3a18c 100644
--- a/server-product/helm/values.yaml
+++ b/server-product/helm/values.yaml
@@ -1,30 +1,37 @@
-image:
- repository:
- pullPolicy: IfNotPresent
- tag: ${buildVersion}
+# Set this as true to stop OneDev server to perform various maintenance tasks such as backup, restore.
+# Check https://code.onedev.io/projects/162/blob/main/pages/backup-restore.md for details
+maintenance: false
+nodeSelector:
+ onedev:
+ kubernetes.io/os: linux
+ mysql:
+ kubernetes.io/os: linux
+
+# Ingress support, check below for more info.
+# Check https://code.onedev.io/projects/162/blob/main/pages/deploy-into-k8s-with-helm.md#ingress-setup for details
ingress:
- enabled: false
- annotations: {}
- hosts:
- - host: chart-example.local
- paths: []
- tls: []
- # - secretName: chart-example-tls
- # hosts:
- # - chart-example.local
+ host: "" # Optionally specify dns name to access OneDev via ingress controller
+ tls: false # Whether or not to enable TLS for above host
+ class: nginx # Will be used as ingressClassName of ingress spec to match controller
+letsencrypt:
+ email: "" # Specify an email here to enable LetsEncrypt. Check https://code.onedev.io/projects/162/blob/main/pages/deploy-into-k8s-with-helm.md#letsencrypt-setup for details
+
+resources:
+ onedev:
+ memory: 1024Mi
+ mysql:
+ memory: 256Mi
volumes:
onedev:
- storageClassName: openebs-hostpath
+ storageClassName: "" # Optionally specify storage class of persistent volume to store OneDev data including git repositories and indexes. Leave empty to use default storage class
size: 100Gi
mysql:
- storageClassName: openebs-hostpath
+ storageClassName: "" # Optionally specify storage class of persistent volume to store mysql data. Leave empty to use default storage class
size: 20Gi
-resources:
- onedev:
- memory: 2Gi
+secrets:
mysql:
- memory: 500Mi
+ password: changeit # change mysql root password if desired
diff --git a/server-product/k8s/ssl/README b/server-product/k8s/ssl/README
deleted file mode 100644
index 28d8d4ea0f..0000000000
--- a/server-product/k8s/ssl/README
+++ /dev/null
@@ -1 +0,0 @@
-This folder demonstrates how to enable SSL support
diff --git a/server-product/k8s/ssl/deployments.yaml b/server-product/k8s/ssl/deployments.yaml
deleted file mode 100644
index 26e3a3460f..0000000000
--- a/server-product/k8s/ssl/deployments.yaml
+++ /dev/null
@@ -1,32 +0,0 @@
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: onedev
-spec:
- template:
- metadata:
- name: onedev
- spec:
- containers:
- - name: onedev
- env:
- - name: https_port
- value: "6643"
- - name: keystore
- value: /root/config/keystore
- - name: keystore_encoding
- value: base64
- - name: keystore_password
- valueFrom:
- secretKeyRef:
- name: keystore
- key: password
- volumeMounts:
- - name: keystore
- mountPath: /root/config
- ports:
- - containerPort: 6643
- volumes:
- - name: keystore
- configMap:
- name: keystore
diff --git a/server-product/k8s/ssl/kustomization.yaml b/server-product/k8s/ssl/kustomization.yaml
deleted file mode 100644
index 2943f61a14..0000000000
--- a/server-product/k8s/ssl/kustomization.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-namespace: onedev
-bases:
-- ../production
-configMapGenerator:
-- name: keystore
- files:
- - keystore=changeit.pfx.base64 # base64 encoded pkcs12 keystore
-secretGenerator:
-- name: keystore
- literals:
- - password=changeit
-patchesStrategicMerge:
-- deployments.yaml
-- services.yaml
diff --git a/server-product/k8s/ssl/services.yaml b/server-product/k8s/ssl/services.yaml
deleted file mode 100644
index f48ae89194..0000000000
--- a/server-product/k8s/ssl/services.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-apiVersion: v1
-kind: Service
-metadata:
- name: onedev
-spec:
- ports:
- - name: https
- port: 443
- targetPort: 6643
- protocol: TCP
diff --git a/server-product/k8s/trust-certs/README b/server-product/k8s/trust-certs/README
deleted file mode 100644
index 479ce35a8e..0000000000
--- a/server-product/k8s/trust-certs/README
+++ /dev/null
@@ -1 +0,0 @@
-This folder demonstrates how to configure OneDev to trust specified certificates
diff --git a/server-product/k8s/trust-certs/deployments.yaml b/server-product/k8s/trust-certs/deployments.yaml
deleted file mode 100644
index ad5ea89c3e..0000000000
--- a/server-product/k8s/trust-certs/deployments.yaml
+++ /dev/null
@@ -1,21 +0,0 @@
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: onedev
-spec:
- template:
- metadata:
- name: onedev
- spec:
- containers:
- - name: onedev
- env:
- - name: trust_certs
- value: /root/config/trust-certs
- volumeMounts:
- - name: trust-certs
- mountPath: /root/config/trust-certs
- volumes:
- - name: trust-certs
- configMap:
- name: trust-certs
diff --git a/server-product/k8s/trust-certs/kustomization.yaml b/server-product/k8s/trust-certs/kustomization.yaml
deleted file mode 100644
index e63e220439..0000000000
--- a/server-product/k8s/trust-certs/kustomization.yaml
+++ /dev/null
@@ -1,9 +0,0 @@
-namespace: onedev
-bases:
-- ../production
-configMapGenerator:
-- name: trust-certs
- files:
- - changeme.pem
-patchesStrategicMerge:
-- deployments.yaml