Use dynamic provisioning and stateful sets
This commit is contained in:
parent
c8b1ad3059
commit
85adad84ef
@ -77,7 +77,7 @@ data:
|
|||||||
[INPUT]
|
[INPUT]
|
||||||
Name tail
|
Name tail
|
||||||
Tag nexus.nexus-log
|
Tag nexus.nexus-log
|
||||||
Path /var/log/containers/{{ .Chart.Name }}-{{ .Chart.Version }}.{{ .Release.Name }}-nxrm.deployment*{{ .Values.namespaces.nexusNs }}_nxrm-app-*.log
|
Path /var/log/containers/{{ .Chart.Name }}-{{ .Chart.Version | replace "." "-" }}-{{ .Release.Name }}-{{ .Values.statefulset.name }}*{{ .Values.namespaces.nexusNs }}_nxrm-app-*.log
|
||||||
Parser docker
|
Parser docker
|
||||||
DB /var/fluent-bit/state/flb_container.db
|
DB /var/fluent-bit/state/flb_container.db
|
||||||
Mem_Buf_Limit 5MB
|
Mem_Buf_Limit 5MB
|
||||||
@ -112,7 +112,7 @@ data:
|
|||||||
[INPUT]
|
[INPUT]
|
||||||
Name tail
|
Name tail
|
||||||
Tag nexus.request-log
|
Tag nexus.request-log
|
||||||
Path /var/log/containers/{{ .Chart.Name }}-{{ .Chart.Version }}.{{ .Release.Name }}-nxrm.deployment*{{ .Values.namespaces.nexusNs }}_request-log-*.log
|
Path /var/log/containers/{{ .Chart.Name }}-{{ .Chart.Version | replace "." "-" }}-{{ .Release.Name }}-{{ .Values.statefulset.name }}*{{ .Values.namespaces.nexusNs }}_request-log-*.log
|
||||||
Parser docker
|
Parser docker
|
||||||
DB /var/fluent-bit/state/flb_container.db
|
DB /var/fluent-bit/state/flb_container.db
|
||||||
Mem_Buf_Limit 5MB
|
Mem_Buf_Limit 5MB
|
||||||
@ -147,7 +147,7 @@ data:
|
|||||||
[INPUT]
|
[INPUT]
|
||||||
Name tail
|
Name tail
|
||||||
Tag nexus.audit-log
|
Tag nexus.audit-log
|
||||||
Path /var/log/containers/{{ .Chart.Name }}-{{ .Chart.Version }}.{{ .Release.Name }}-nxrm.deployment*{{ .Values.namespaces.nexusNs }}_audit-log-*.log
|
Path /var/log/containers/{{ .Chart.Name }}-{{ .Chart.Version | replace "." "-" }}-{{ .Release.Name }}-{{ .Values.statefulset.name }}*{{ .Values.namespaces.nexusNs }}_audit-log-*.log
|
||||||
Parser docker
|
Parser docker
|
||||||
DB /var/fluent-bit/state/flb_container.db
|
DB /var/fluent-bit/state/flb_container.db
|
||||||
Mem_Buf_Limit 5MB
|
Mem_Buf_Limit 5MB
|
||||||
@ -182,7 +182,7 @@ data:
|
|||||||
[INPUT]
|
[INPUT]
|
||||||
Name tail
|
Name tail
|
||||||
Tag nexus.tasks-log
|
Tag nexus.tasks-log
|
||||||
Path /var/log/containers/{{ .Chart.Name }}-{{ .Chart.Version }}.{{ .Release.Name }}-nxrm.deployment*{{ .Values.namespaces.nexusNs }}_tasks-log-*.log
|
Path /var/log/containers/{{ .Chart.Name }}-{{ .Chart.Version | replace "." "-" }}-{{ .Release.Name }}-{{ .Values.statefulset.name }}*{{ .Values.namespaces.nexusNs }}_tasks-log-*.log
|
||||||
Parser docker
|
Parser docker
|
||||||
DB /var/fluent-bit/state/flb_container.db
|
DB /var/fluent-bit/state/flb_container.db
|
||||||
Mem_Buf_Limit 5MB
|
Mem_Buf_Limit 5MB
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: StatefulSet
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ .Chart.Name }}-{{ .Chart.Version }}.{{ .Release.Name }}-{{ .Values.deployment.name }}
|
name: {{ .Chart.Name }}-{{ .Chart.Version | replace "." "-"}}-{{ .Release.Name }}-{{ .Values.statefulset.name }}
|
||||||
namespace: {{ .Values.namespaces.nexusNs }}
|
namespace: {{ .Values.namespaces.nexusNs }}
|
||||||
labels:
|
labels:
|
||||||
app: nxrm
|
app: nxrm
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: {{.Values.statefulset.replicaCount}}
|
||||||
|
serviceName: "{{ .Chart.Name }}-{{ .Chart.Version | replace "." "-"}}-{{ .Release.Name }}-{{ .Values.statefulset.name }}"
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: nxrm
|
app: nxrm
|
||||||
@ -21,7 +22,7 @@ spec:
|
|||||||
# otherwise the side car containers will crash a couple of times and backoff whilst waiting
|
# otherwise the side car containers will crash a couple of times and backoff whilst waiting
|
||||||
# for nxrm-app to start and this increases the total start up time.
|
# for nxrm-app to start and this increases the total start up time.
|
||||||
- name: chown-nexusdata-owner-to-nexus-and-init-log-dir
|
- name: chown-nexusdata-owner-to-nexus-and-init-log-dir
|
||||||
image: {{ .Values.deployment.initContainer.image.repository }}:{{ .Values.deployment.initContainer.image.tag }}
|
image: {{ .Values.statefulset.initContainer.image.repository }}:{{ .Values.statefulset.initContainer.image.tag }}
|
||||||
command: [/bin/sh]
|
command: [/bin/sh]
|
||||||
args:
|
args:
|
||||||
- -c
|
- -c
|
||||||
@ -34,19 +35,20 @@ spec:
|
|||||||
touch -a /nexus-data/log/request.log &&
|
touch -a /nexus-data/log/request.log &&
|
||||||
chown -R '200:200' /nexus-data
|
chown -R '200:200' /nexus-data
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: nexusdata
|
- name: nexus-data
|
||||||
mountPath: /nexus-data
|
mountPath: /nexus-data
|
||||||
|
terminationGracePeriodSeconds: 20
|
||||||
containers:
|
containers:
|
||||||
- name: nxrm-app
|
- name: nxrm-app
|
||||||
image: {{ .Values.deployment.container.image.repository }}:{{ .Values.deployment.container.image.tag }}
|
image: {{ .Values.statefulset.container.image.repository }}:{{ .Values.statefulset.container.image.tag }}
|
||||||
securityContext:
|
securityContext:
|
||||||
runAsUser: 200
|
runAsUser: 200
|
||||||
imagePullPolicy: {{ .Values.deployment.container.pullPolicy }}
|
imagePullPolicy: {{ .Values.statefulset.container.pullPolicy }}
|
||||||
ports:
|
ports:
|
||||||
- containerPort: {{ .Values.deployment.container.containerPort }}
|
- containerPort: {{ .Values.statefulset.container.containerPort }}
|
||||||
env:
|
env:
|
||||||
- name: DB_NAME
|
- name: DB_NAME
|
||||||
value: "{{ .Values.deployment.container.env.nexusDBName }}"
|
value: "{{ .Values.statefulset.container.env.nexusDBName }}"
|
||||||
- name: DB_PASSWORD
|
- name: DB_PASSWORD
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
@ -70,41 +72,38 @@ spec:
|
|||||||
- name: NEXUS_SECURITY_RANDOMPASSWORD
|
- name: NEXUS_SECURITY_RANDOMPASSWORD
|
||||||
value: "false"
|
value: "false"
|
||||||
- name: INSTALL4J_ADD_VM_PARAMS
|
- name: INSTALL4J_ADD_VM_PARAMS
|
||||||
value: "{{ .Values.deployment.container.env.install4jAddVmParams }} -Dnexus.licenseFile=/nxrm-secrets/{{ .Values.secret.license.alias }} \
|
value: "{{ .Values.statefulset.container.env.install4jAddVmParams }} -Dnexus.licenseFile=/nxrm-secrets/{{ .Values.secret.license.alias }} \
|
||||||
-Dnexus.datastore.enabled=true -Djava.util.prefs.userRoot=${NEXUS_DATA}/javaprefs \
|
-Dnexus.datastore.enabled=true -Djava.util.prefs.userRoot=${NEXUS_DATA}/javaprefs \
|
||||||
-Dnexus.datastore.nexus.jdbcUrl=jdbc:postgresql://${DB_HOST}:{{ .Values.deployment.container.env.nexusDBPort }}/${DB_NAME} \
|
-Dnexus.datastore.nexus.jdbcUrl=jdbc:postgresql://${DB_HOST}:{{ .Values.statefulset.container.env.nexusDBPort }}/${DB_NAME} \
|
||||||
-Dnexus.datastore.nexus.username=${DB_USER} \
|
-Dnexus.datastore.nexus.username=${DB_USER} \
|
||||||
-Dnexus.datastore.nexus.password=${DB_PASSWORD}"
|
-Dnexus.datastore.nexus.password=${DB_PASSWORD}"
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: /nxrm-secrets
|
- mountPath: /nxrm-secrets
|
||||||
name: nxrm-secrets
|
name: nxrm-secrets
|
||||||
- name: nexusdata
|
- name: nexus-data
|
||||||
mountPath: /nexus-data
|
mountPath: /nexus-data
|
||||||
- name: logback-tasklogfile-override
|
- name: logback-tasklogfile-override
|
||||||
mountPath: /nexus-data/etc/logback/logback-tasklogfile-appender-override.xml
|
mountPath: /nexus-data/etc/logback/logback-tasklogfile-appender-override.xml
|
||||||
subPath: logback-tasklogfile-appender-override.xml
|
subPath: logback-tasklogfile-appender-override.xml
|
||||||
- name: request-log
|
- name: request-log
|
||||||
image: {{ .Values.deployment.requestLogContainer.image.repository }}:{{ .Values.deployment.requestLogContainer.image.tag }}
|
image: {{ .Values.statefulset.requestLogContainer.image.repository }}:{{ .Values.statefulset.requestLogContainer.image.tag }}
|
||||||
args: [/bin/sh, -c, 'tail -n+1 -F /nexus-data/log/request.log']
|
args: [/bin/sh, -c, 'tail -n+1 -F /nexus-data/log/request.log']
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: nexusdata
|
- name: nexus-data
|
||||||
mountPath: /nexus-data
|
mountPath: /nexus-data
|
||||||
- name: audit-log
|
- name: audit-log
|
||||||
image: {{ .Values.deployment.auditLogContainer.image.repository }}:{{ .Values.deployment.auditLogContainer.image.tag }}
|
image: {{ .Values.statefulset.auditLogContainer.image.repository }}:{{ .Values.statefulset.auditLogContainer.image.tag }}
|
||||||
args: [/bin/sh, -c, 'tail -n+1 -F /nexus-data/log/audit/audit.log']
|
args: [/bin/sh, -c, 'tail -n+1 -F /nexus-data/log/audit/audit.log']
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: nexusdata
|
- name: nexus-data
|
||||||
mountPath: /nexus-data
|
mountPath: /nexus-data
|
||||||
- name: tasks-log
|
- name: tasks-log
|
||||||
image: {{ .Values.deployment.taskLogContainer.image.repository }}:{{ .Values.deployment.taskLogContainer.image.tag }}
|
image: {{ .Values.statefulset.taskLogContainer.image.repository }}:{{ .Values.statefulset.taskLogContainer.image.tag }}
|
||||||
args: [/bin/sh, -c, 'tail -n+1 -F /nexus-data/log/tasks/allTasks.log']
|
args: [/bin/sh, -c, 'tail -n+1 -F /nexus-data/log/tasks/allTasks.log']
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: nexusdata
|
- name: nexus-data
|
||||||
mountPath: /nexus-data
|
mountPath: /nexus-data
|
||||||
volumes:
|
volumes:
|
||||||
- name: nexusdata
|
|
||||||
persistentVolumeClaim:
|
|
||||||
claimName: {{ .Chart.Name }}-{{ .Chart.Version }}.{{ .Release.Name }}-ebs-claim
|
|
||||||
- name: nxrm-secrets
|
- name: nxrm-secrets
|
||||||
csi:
|
csi:
|
||||||
driver: secrets-store.csi.k8s.io
|
driver: secrets-store.csi.k8s.io
|
||||||
@ -118,3 +117,12 @@ spec:
|
|||||||
items:
|
items:
|
||||||
- key: logback-tasklogfile-appender-override.xml
|
- key: logback-tasklogfile-appender-override.xml
|
||||||
path: logback-tasklogfile-appender-override.xml
|
path: logback-tasklogfile-appender-override.xml
|
||||||
|
volumeClaimTemplates:
|
||||||
|
- metadata:
|
||||||
|
name: nexus-data
|
||||||
|
spec:
|
||||||
|
accessModes: [ "{{.Values.pvc.accessModes }}" ]
|
||||||
|
storageClassName: "{{ .Chart.Name }}-{{ .Chart.Version}}-{{ .Release.Name }}-ebs-storage"
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{.Values.pvc.storage }}
|
@ -1,7 +1,11 @@
|
|||||||
apiVersion: storage.k8s.io/v1
|
apiVersion: storage.k8s.io/v1
|
||||||
kind: StorageClass
|
kind: StorageClass
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ .Chart.Name }}-{{ .Chart.Version }}.{{ .Release.Name }}-local-storage
|
name: "{{ .Chart.Name }}-{{ .Chart.Version}}-{{ .Release.Name }}-ebs-storage"
|
||||||
namespace: {{ .Values.namespaces.nexusNs }}
|
namespace: {{ .Values.namespaces.nexusNs }}
|
||||||
provisioner: kubernetes.io/no-provisioner
|
provisioner: kubernetes.io/aws-ebs
|
||||||
volumeBindingMode: WaitForFirstConsumer
|
parameters:
|
||||||
|
type: io1
|
||||||
|
fsType: "ext4"
|
||||||
|
iopsPerGB: "{{ .Values.storageClass.iopsPerGB }}"
|
||||||
|
volumeBindingMode: WaitForFirstConsumer
|
||||||
|
Loading…
x
Reference in New Issue
Block a user