Fix yaml in configuration
This commit is contained in:
		
							parent
							
								
									202d7a87b7
								
							
						
					
					
						commit
						4c60936da2
					
				|  | @ -43,16 +43,26 @@ $ kubectl -n <namespace> create -f pvc.yaml | ||||||
| apiVersion: jenkins.io/v1alpha2 | apiVersion: jenkins.io/v1alpha2 | ||||||
| kind: Jenkins | kind: Jenkins | ||||||
| metadata: | metadata: | ||||||
|   name: <cr_name> |   name: jenkins-cr | ||||||
|   namespace: <namespace> |  | ||||||
| spec: | spec: | ||||||
|  |   jenkinsAPISettings: | ||||||
|  |     authorizationStrategy: createUser | ||||||
|   master: |   master: | ||||||
|     securityContext: |     securityContext: | ||||||
|       runAsUser: 1000 |       runAsUser: 1000 | ||||||
|       fsGroup: 1000 |       fsGroup: 1000 | ||||||
|  |     disableCSRFProtection: false | ||||||
|     containers: |     containers: | ||||||
|       - name: jenkins-master |       - name: jenkins-master | ||||||
|         image: jenkins/jenkins:2.277.4-lts-alpine |         image: jenkins/jenkins:2.277.4-lts-alpine | ||||||
|  |         imagePullPolicy: IfNotPresent | ||||||
|  |         resources: | ||||||
|  |           limits: | ||||||
|  |             cpu: 1500m | ||||||
|  |             memory: 3Gi | ||||||
|  |           requests: | ||||||
|  |             cpu: "1" | ||||||
|  |             memory: 500Mi | ||||||
|       - name: backup # container responsible for the backup and restore |       - name: backup # container responsible for the backup and restore | ||||||
|         env: |         env: | ||||||
|           - name: BACKUP_DIR |           - name: BACKUP_DIR | ||||||
|  | @ -68,6 +78,13 @@ spec: | ||||||
|             name: jenkins-home |             name: jenkins-home | ||||||
|           - mountPath: /backup # backup volume |           - mountPath: /backup # backup volume | ||||||
|             name: backup |             name: backup | ||||||
|  |         resources: | ||||||
|  |           limits: | ||||||
|  |             cpu: 1000m | ||||||
|  |             memory: 3Gi | ||||||
|  |           requests: | ||||||
|  |             cpu: "1" | ||||||
|  |             memory: 500Mi | ||||||
|     volumes: |     volumes: | ||||||
|       - name: backup # PVC volume where backups will be stored |       - name: backup # PVC volume where backups will be stored | ||||||
|         persistentVolumeClaim: |         persistentVolumeClaim: | ||||||
|  | @ -78,10 +95,6 @@ spec: | ||||||
|       exec: |       exec: | ||||||
|         command: |         command: | ||||||
|           - /home/user/bin/backup.sh # this command is invoked on "backup" container to make backup, for example /home/user/bin/backup.sh <backup_number>, <backup_number> is passed by operator |           - /home/user/bin/backup.sh # this command is invoked on "backup" container to make backup, for example /home/user/bin/backup.sh <backup_number>, <backup_number> is passed by operator | ||||||
|     getLatestAction: |  | ||||||
|       exec: |  | ||||||
|         command: |  | ||||||
|         - /home/user/bin/get-latest.sh # this command is invoked on "backup" container to get last backup number before pod deletion; not having it in the CR may cause loss of data |  | ||||||
|     interval: 30 # how often make backup in seconds |     interval: 30 # how often make backup in seconds | ||||||
|     makeBackupBeforePodDeletion: true # make a backup before pod deletion |     makeBackupBeforePodDeletion: true # make a backup before pod deletion | ||||||
|   restore: |   restore: | ||||||
|  | @ -91,4 +104,8 @@ spec: | ||||||
|         command: |         command: | ||||||
|           - /home/user/bin/restore.sh # this command is invoked on "backup" container to make restore backup, for example /home/user/bin/restore.sh <backup_number>, <backup_number> is passed by operator |           - /home/user/bin/restore.sh # this command is invoked on "backup" container to make restore backup, for example /home/user/bin/restore.sh <backup_number>, <backup_number> is passed by operator | ||||||
|     #recoveryOnce: <backup_number> # if want to restore specific backup configure this field and then Jenkins will be restarted and desired backup will be restored |     #recoveryOnce: <backup_number> # if want to restore specific backup configure this field and then Jenkins will be restarted and desired backup will be restored | ||||||
|  |     getLatestAction: | ||||||
|  |       exec: | ||||||
|  |         command: | ||||||
|  |           - /home/user/bin/get-latest.sh # this command is invoked on "backup" container to get last backup number before pod deletion; not having it in the CR may cause loss of data | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue