Add configuration to support running WAL-E.

- Set WAL_S3_BUCKET to point WAL-E where to fetch/store WAL files
- Set annotations/iam.amazonaws.com/role to set the role to access AWS"

The new env vairables are PGOP_WAL_S3_BUCKET and PGOP_KUBE_IAM_ROLE.
This commit is contained in:
Oleksii Kliukin
2017-05-12 11:41:31 +02:00
committed by Murat Kabilov
parent 852c5beae5
commit 7841b85892
3 changed files with 9 additions and 0 deletions
+6
View File
@@ -105,6 +105,9 @@ bootstrap:
- hostssl all all all md5`, pgVersion, c.OpConfig.PamRoleName, c.OpConfig.PamRoleName),
},
}
if c.OpConfig.WALES3Bucket != "" {
envVars = append(envVars, v1.EnvVar{Name: "WAL_S3_BUCKET", Value: c.OpConfig.WALES3Bucket})
}
privilegedMode := bool(true)
container := v1.Container{
Name: c.Metadata.Name,
@@ -153,6 +156,9 @@ bootstrap:
},
Spec: podSpec,
}
if c.OpConfig.KubeIAMRole != "" {
template.Annotations = map[string]string{constants.KubeIAmAnnotation: c.OpConfig.KubeIAMRole}
}
return &template
}