forked from chainguard-images/images
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new image: bank-vaults (chainguard-images#1395)
* new image: bank-vaults Signed-off-by: Tuan Anh Tran <[email protected]> * tf fmt Signed-off-by: Tuan Anh Tran <[email protected]> * fix monopod readme Signed-off-by: Tuan Anh Tran <[email protected]> * sleep before kubectl wait test Signed-off-by: Tuan Anh Tran <[email protected]> * sleep 30 Signed-off-by: Tuan Anh Tran <[email protected]> * wait for custom resource vault become healthy Signed-off-by: Tuan Anh Tran <[email protected]> * wait for custom resource vault become healthy, timeout 300s Signed-off-by: Tuan Anh Tran <[email protected]> --------- Signed-off-by: Tuan Anh Tran <[email protected]>
- Loading branch information
Showing
8 changed files
with
164 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<!--monopod:start--> | ||
# bank-vaults | ||
| | | | ||
| - | - | | ||
| **Status** | stable | | ||
| **OCI Reference** | `cgr.dev/chainguard/bank-vaults` | | ||
|
||
|
||
* [View Image in Chainguard Academy](https://edu.chainguard.dev/chainguard/chainguard-images/reference/bank-vaults/overview/) | ||
* [View Image Catalog](https://console.enforce.dev/images/catalog) for a full list of available tags. | ||
*[Contact Chainguard](https://www.chainguard.dev/chainguard-images) for enterprise support, SLAs, and access to older tags.* | ||
|
||
--- | ||
<!--monopod:end--> | ||
|
||
Minimal Image for Bank Vaults | ||
|
||
## Get It! | ||
|
||
The image is available on `cgr.dev`: | ||
|
||
``` | ||
docker pull cgr.dev/chainguard/bank-vaults:latest | ||
``` | ||
|
||
## Usage | ||
|
||
This image is a drop-in replacement for the upstream image. | ||
You can run it using the helm chart with: | ||
|
||
```shell | ||
$ helm repo add bank-vaults oci://ghcr.io/bank-vaults/helm-charts/vault-operator | ||
$ helm install bank-vaults bank-vaults/bank-vaults \ | ||
--set bankVaults.image.repository=cgr.dev/chainguard/bank-vaults \ | ||
--set bankVaults.image.tag=latest | ||
<other configuration parameters here> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
contents: | ||
packages: | ||
- bank-vaults-template | ||
- bank-vaults | ||
|
||
accounts: | ||
groups: | ||
- groupname: bank-vaults | ||
gid: 65532 | ||
users: | ||
- username: bank-vaults | ||
uid: 65532 | ||
run-as: 65532 | ||
|
||
entrypoint: | ||
command: /usr/bin/bank-vaults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
versions: | ||
- apko: | ||
config: configs/latest.apko.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
terraform { | ||
required_providers { | ||
apko = { source = "chainguard-dev/apko" } | ||
} | ||
} | ||
|
||
variable "target_repository" { | ||
description = "The docker repo into which the image and attestations should be published." | ||
} | ||
|
||
module "latest" { | ||
source = "../../tflib/publisher" | ||
|
||
name = basename(path.module) | ||
|
||
target_repository = var.target_repository | ||
config = file("${path.module}/configs/latest.apko.yaml") | ||
} | ||
|
||
module "dev" { source = "../../tflib/dev-subvariant" } | ||
|
||
module "latest-dev" { | ||
source = "../../tflib/publisher" | ||
|
||
name = basename(path.module) | ||
|
||
target_repository = var.target_repository | ||
# Make the dev variant an explicit extension of the | ||
# locked original. | ||
config = jsonencode(module.latest.config) | ||
extra_packages = module.dev.extra_packages | ||
} | ||
|
||
module "version-tags" { | ||
source = "../../tflib/version-tags" | ||
package = "bank-vaults" | ||
config = module.latest.config | ||
} | ||
|
||
module "test-latest" { | ||
source = "./tests" | ||
digest = module.latest.image_ref | ||
} | ||
|
||
module "tagger" { | ||
source = "../../tflib/tagger" | ||
|
||
depends_on = [module.test-latest] | ||
|
||
tags = merge( | ||
{ for t in toset(concat(["latest"], module.version-tags.tag_list)) : t => module.latest.image_ref }, | ||
{ for t in toset(concat(["latest"], module.version-tags.tag_list)) : "${t}-dev" => module.latest-dev.image_ref }, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit -o nounset -o errtrace -o pipefail -x | ||
|
||
# installation instruction from here https://bank-vaults.dev/docs/installing/ | ||
|
||
kubectl config set-context --current --namespace=default | ||
|
||
helm upgrade --install --wait vault-operator oci://ghcr.io/bank-vaults/helm-charts/vault-operator \ | ||
--set bankVaults.image.repository=${IMAGE_REGISTRY}/${IMAGE_REPOSITORY} \ | ||
--set bankVaults.image.tag=$IMAGE_TAG | ||
|
||
kubectl kustomize https://github.com/bank-vaults/vault-operator/deploy/rbac | kubectl apply -f - | ||
|
||
kubectl apply -f https://raw.githubusercontent.com/bank-vaults/vault-operator/v1.21.0/deploy/examples/cr-raft.yaml | ||
|
||
kubectl -n default wait --for=condition=healthy vault vault --timeout=300s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
terraform { | ||
required_providers { | ||
oci = { source = "chainguard-dev/oci" } | ||
} | ||
} | ||
|
||
variable "digest" { | ||
description = "The image digest to run tests over." | ||
} | ||
|
||
data "oci_string" "ref" { input = var.digest } | ||
|
||
data "oci_exec_test" "test" { | ||
digest = var.digest | ||
script = "${path.module}/full-test.sh" | ||
|
||
env { | ||
name = "IMAGE_REGISTRY" | ||
value = data.oci_string.ref.registry | ||
} | ||
|
||
env { | ||
name = "IMAGE_REPOSITORY" | ||
value = data.oci_string.ref.repo | ||
} | ||
|
||
env { | ||
name = "IMAGE_TAG" | ||
value = data.oci_string.ref.pseudo_tag | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters