Commit ed6bd29f authored by root's avatar root

update

parent d4707dd6
......@@ -29,7 +29,7 @@ spec:
image: {{ .Values.database.internal.image.repository }}:{{ .Values.database.internal.image.tag }}
command: ["rm", "-Rf", "/var/lib/postgresql/data/lost+found"]
volumeMounts:
- name: database-data
- name: data
mountPath: /var/lib/postgresql/data
containers:
- name: database
......@@ -53,17 +53,10 @@ spec:
- secretRef:
name: "{{ template "harbor.database" . }}"
volumeMounts:
- name: database-data
- name: data
mountPath: /var/lib/postgresql/data
- name: etc-localtime
mountPath: /etc/localtime
volumes:
- name: etc-localtime
hostPath:
path: /etc/localtime
- name: "database-data"
hostPath:
path: /data/{{ .Release.Namespace }}/{{ .Release.Name }}/database
{{- with .Values.database.internal.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
......@@ -76,4 +69,25 @@ spec:
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
{{- end -}}
volumes:
- name: etc-localtime
hostPath:
path: /etc/localtime
{{- if .Values.database.internal.storageSpec.hostPath }}
- name: data
hostPath:
path: /{{.Values.database.internal.storageSpec.hostPath.root | default "data" | quote}}/{{ .Release.Namespace }}/{{ .Release.Name }}/database
{{- else if .Values.database.internal.storageSpec.emptyDir }}
- name: data
emptyDir: {}
{{- else if .Values.database.internal.storageSpec.volumeClaimTemplate }}
volumeClaimTemplates:
- metadata:
name: "data"
labels:
{{ include "harbor.labels" . | indent 8 }}
app: database
spec:
{{ toYaml $.Values.database.internal.storageSpec.volumeClaimTemplate.spec | indent 6 }}
{{- end }}
{{- end -}}
{{- $storage := .Values.registry.storage }}
apiVersion: apps/v1
kind: Deployment
kind: StatefulSet
metadata:
name: "{{ template "harbor.registry" . }}"
labels:
......@@ -8,6 +8,7 @@ metadata:
app: registry
spec:
replicas: {{ .Values.registry.replicas }}
serviceName: "{{ template "harbor.registry" . }}"
selector:
matchLabels:
{{ include "harbor.matchLabels" . | indent 6 }}
......@@ -51,7 +52,7 @@ spec:
- containerPort: 5001
volumeMounts:
{{- if eq $storage.type "filesystem" }}
- name: registry-data
- name: data
mountPath: /data
{{- end }}
- name: registry-root-certificate
......@@ -98,7 +99,7 @@ spec:
- containerPort: 8080
volumeMounts:
{{- if eq $storage.type "filesystem" }}
- name: registry-data
- name: data
mountPath: /data
{{- end }}
- name: registry-config
......@@ -109,25 +110,6 @@ spec:
subPath: ctl-config.yml
- name: etc-localtime
mountPath: /etc/localtime
volumes:
- name: etc-localtime
hostPath:
path: /etc/localtime
- name: registry-root-certificate
secret:
secretName: {{ template "harbor.core" . }}
- name: registry-config
configMap:
name: "{{ template "harbor.registry" . }}"
{{- if eq $storage.type "filesystem" }}
- name: registry-data
hostPath:
{{- if .Values.registry.hostPath }}
path: {{ .Values.registry.hostPath }}
{{- else }}
path: /data/{{ .Release.Namespace }}/{{ .Release.Name }}/registry
{{- end }}
{{- end }}
{{- with .Values.registry.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
......@@ -140,3 +122,32 @@ spec:
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
volumes:
- name: etc-localtime
hostPath:
path: /etc/localtime
- name: registry-root-certificate
secret:
secretName: {{ template "harbor.core" . }}
- name: registry-config
configMap:
name: "{{ template "harbor.registry" . }}"
{{- if eq $storage.type "filesystem" }}
{{- if .Values.registry.storageSpec.hostPath }}
- name: data
hostPath:
path: /{{.Values.registry.storageSpec.hostPath.root | default "data" | quote}}/{{ .Release.Namespace }}/{{ .Release.Name }}/database
{{- else if .Values.registry.storageSpec.emptyDir }}
- name: data
emptyDir: {}
{{- else if .Values.registry.storageSpec.volumeClaimTemplate }}
volumeClaimTemplates:
- metadata:
name: "data"
labels:
{{ include "harbor.labels" . | indent 8 }}
app: registry
spec:
{{ toYaml $.Values.registry.storageSpec.volumeClaimTemplate.spec | indent 6 }}
{{- end }}
{{- end }}
......@@ -73,10 +73,18 @@ registry:
v4auth: true
chunksize: 5242880
rootdirectory: /
# hostPath , 设置改变存储registry本地路径
# 注释后将使用默认存储位置
# hostPath: /data/registry
storageSpec:
# 不用hostPath,则注释
hostPath:
root: /data
volumeClaimTemplate:
spec:
storageClassName: rook-ceph-block
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 100Gi
selector: {}
controller:
image:
......@@ -129,6 +137,9 @@ database:
nodeSelector:
harbor: enabled
storageSpec:
# 不用hostPath,则注释
hostPath:
root: /data
volumeClaimTemplate:
spec:
storageClassName: rook-ceph-block
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment