Commit ed6bd29f authored by root's avatar root

update

parent d4707dd6
...@@ -29,7 +29,7 @@ spec: ...@@ -29,7 +29,7 @@ spec:
image: {{ .Values.database.internal.image.repository }}:{{ .Values.database.internal.image.tag }} image: {{ .Values.database.internal.image.repository }}:{{ .Values.database.internal.image.tag }}
command: ["rm", "-Rf", "/var/lib/postgresql/data/lost+found"] command: ["rm", "-Rf", "/var/lib/postgresql/data/lost+found"]
volumeMounts: volumeMounts:
- name: database-data - name: data
mountPath: /var/lib/postgresql/data mountPath: /var/lib/postgresql/data
containers: containers:
- name: database - name: database
...@@ -53,17 +53,10 @@ spec: ...@@ -53,17 +53,10 @@ spec:
- secretRef: - secretRef:
name: "{{ template "harbor.database" . }}" name: "{{ template "harbor.database" . }}"
volumeMounts: volumeMounts:
- name: database-data - name: data
mountPath: /var/lib/postgresql/data mountPath: /var/lib/postgresql/data
- name: etc-localtime - name: etc-localtime
mountPath: /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 }} {{- with .Values.database.internal.nodeSelector }}
nodeSelector: nodeSelector:
{{ toYaml . | indent 8 }} {{ toYaml . | indent 8 }}
...@@ -76,4 +69,25 @@ spec: ...@@ -76,4 +69,25 @@ spec:
tolerations: tolerations:
{{ toYaml . | indent 8 }} {{ toYaml . | indent 8 }}
{{- end }} {{- 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 }} {{- $storage := .Values.registry.storage }}
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: StatefulSet
metadata: metadata:
name: "{{ template "harbor.registry" . }}" name: "{{ template "harbor.registry" . }}"
labels: labels:
...@@ -8,6 +8,7 @@ metadata: ...@@ -8,6 +8,7 @@ metadata:
app: registry app: registry
spec: spec:
replicas: {{ .Values.registry.replicas }} replicas: {{ .Values.registry.replicas }}
serviceName: "{{ template "harbor.registry" . }}"
selector: selector:
matchLabels: matchLabels:
{{ include "harbor.matchLabels" . | indent 6 }} {{ include "harbor.matchLabels" . | indent 6 }}
...@@ -51,7 +52,7 @@ spec: ...@@ -51,7 +52,7 @@ spec:
- containerPort: 5001 - containerPort: 5001
volumeMounts: volumeMounts:
{{- if eq $storage.type "filesystem" }} {{- if eq $storage.type "filesystem" }}
- name: registry-data - name: data
mountPath: /data mountPath: /data
{{- end }} {{- end }}
- name: registry-root-certificate - name: registry-root-certificate
...@@ -98,7 +99,7 @@ spec: ...@@ -98,7 +99,7 @@ spec:
- containerPort: 8080 - containerPort: 8080
volumeMounts: volumeMounts:
{{- if eq $storage.type "filesystem" }} {{- if eq $storage.type "filesystem" }}
- name: registry-data - name: data
mountPath: /data mountPath: /data
{{- end }} {{- end }}
- name: registry-config - name: registry-config
...@@ -109,25 +110,6 @@ spec: ...@@ -109,25 +110,6 @@ spec:
subPath: ctl-config.yml subPath: ctl-config.yml
- name: etc-localtime - name: etc-localtime
mountPath: /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 }} {{- with .Values.registry.nodeSelector }}
nodeSelector: nodeSelector:
{{ toYaml . | indent 8 }} {{ toYaml . | indent 8 }}
...@@ -140,3 +122,32 @@ spec: ...@@ -140,3 +122,32 @@ spec:
tolerations: tolerations:
{{ toYaml . | indent 8 }} {{ toYaml . | indent 8 }}
{{- end }} {{- 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: ...@@ -73,10 +73,18 @@ registry:
v4auth: true v4auth: true
chunksize: 5242880 chunksize: 5242880
rootdirectory: / rootdirectory: /
storageSpec:
# hostPath , 设置改变存储registry本地路径 # 不用hostPath,则注释
# 注释后将使用默认存储位置 hostPath:
# hostPath: /data/registry root: /data
volumeClaimTemplate:
spec:
storageClassName: rook-ceph-block
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 100Gi
selector: {}
controller: controller:
image: image:
...@@ -129,6 +137,9 @@ database: ...@@ -129,6 +137,9 @@ database:
nodeSelector: nodeSelector:
harbor: enabled harbor: enabled
storageSpec: storageSpec:
# 不用hostPath,则注释
hostPath:
root: /data
volumeClaimTemplate: volumeClaimTemplate:
spec: spec:
storageClassName: rook-ceph-block 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