Skip to content

Commit

Permalink
Merge pull request #35 from projectsyn/fix-token-missing-error
Browse files Browse the repository at this point in the history
Start vault agent and let it finish before attempting a backup
  • Loading branch information
bastjan authored Apr 7, 2022
2 parents 9e56584 + 574188b commit 1a0d06c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
16 changes: 16 additions & 0 deletions component/backup.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ local backupPod = backup.PreBackupPod(
containers_: {
backup: kube.Container('backup') {
image: '%s/%s:%s' % [ params.images.vault.registry, params.images.vault.repository, params.images.vault.version ],
args: [
'agent',
'-config',
'/etc/vault/vault-agent-config.hcl',
],
env_: {
HOME: '/home/vault',
VAULT_ADDR: 'http://%s-active:8200' % params.name,
Expand All @@ -100,6 +105,17 @@ local backupPod = backup.PreBackupPod(
mountPath: '/home/vault',
},
},
readinessProbe: {
exec: {
command: [
'test',
'-e',
'/home/vault/.vault-token',
],
},
initialDelaySeconds: 3,
periodSeconds: 3,
},
},
},
volumes_: {
Expand Down
13 changes: 12 additions & 1 deletion tests/golden/defaults/vault/vault/30_backup/32_backup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ spec:
pod:
spec:
containers:
- args: []
- args:
- agent
- -config
- /etc/vault/vault-agent-config.hcl
env:
- name: HOME
value: /home/vault
Expand All @@ -35,6 +38,14 @@ spec:
imagePullPolicy: IfNotPresent
name: backup
ports: []
readinessProbe:
exec:
command:
- test
- -e
- /home/vault/.vault-token
initialDelaySeconds: 3
periodSeconds: 3
stdin: false
tty: false
volumeMounts:
Expand Down

0 comments on commit 1a0d06c

Please sign in to comment.