-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Furkan Türkal <[email protected]>
- Loading branch information
Showing
7 changed files
with
155 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!--monopod:start--> | ||
# k8ssandra-system-logger | ||
| | | | ||
| - | - | | ||
| **OCI Reference** | `cgr.dev/chainguard/k8ssandra-system-logger` | | ||
|
||
|
||
* [View Image in Chainguard Academy](https://edu.chainguard.dev/chainguard/chainguard-images/reference/k8ssandra-system-logger/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--> | ||
|
||
<!--overview:start--> | ||
Sidecar for DataStax Kubernetes Operator for Apache Cassandra | ||
<!--overview:end--> | ||
|
||
<!--getting:start--> | ||
## Download this Image | ||
The image is available on `cgr.dev`: | ||
|
||
``` | ||
docker pull cgr.dev/chainguard/k8ssandra-system-logger:latest | ||
``` | ||
<!--getting:end--> | ||
|
||
<!--body:start--><!--body:end--> |
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,29 @@ | ||
variable "name" { | ||
description = "Package name (e.g. cainjector, acmeresolver, controller, webhook)" | ||
} | ||
|
||
variable "extra_packages" { | ||
description = "Additional packages to install." | ||
type = list(string) | ||
default = [] | ||
} | ||
|
||
module "accts" { | ||
source = "../../../tflib/accts" | ||
run-as = 65532 | ||
uid = 65532 | ||
gid = 65532 | ||
name = var.name | ||
} | ||
|
||
output "config" { | ||
value = jsonencode({ | ||
contents = { | ||
packages = ["cass-operator-config", "vector", "libstdc++"] | ||
} | ||
accounts = module.accts.block | ||
entrypoint = { | ||
command = "/usr/bin/vector" | ||
} | ||
}) | ||
} |
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,36 @@ | ||
terraform { | ||
required_providers { | ||
oci = { source = "chainguard-dev/oci" } | ||
} | ||
} | ||
|
||
variable "target_repository" { | ||
description = "The docker repo into which the image and attestations should be published." | ||
} | ||
|
||
module "latest-config" { source = "./config" } | ||
|
||
module "latest" { | ||
source = "../../tflib/publisher" | ||
name = basename(path.module) | ||
target_repository = var.target_repository | ||
config = module.latest-config.config | ||
build-dev = true | ||
} | ||
|
||
module "test-latest" { | ||
source = "./tests" | ||
digest = module.latest.image_ref | ||
} | ||
|
||
resource "oci_tag" "latest" { | ||
depends_on = [module.test-latest] | ||
digest_ref = module.latest.image_ref | ||
tag = "latest" | ||
} | ||
|
||
resource "oci_tag" "latest-dev" { | ||
depends_on = [module.test-latest] | ||
digest_ref = module.latest.dev_ref | ||
tag = "latest-dev" | ||
} |
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,9 @@ | ||
name: k8ssandra-system-logger | ||
image: cgr.dev/chainguard/k8ssandra-system-logger | ||
logo: https://storage.googleapis.com/chainguard-academy/logos/k8ssandra-system-logger.svg | ||
endoflife: "" | ||
console_summary: "" | ||
short_description: Sidecar for DataStax Kubernetes Operator for Apache Cassandra | ||
compatibility_notes: "" | ||
readme_file: README.md | ||
upstream_url: https://github.com/k8ssandra/cass-operator/blob/master/logger.Dockerfile |
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,26 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit -o nounset -o errtrace -o pipefail -x | ||
|
||
NAME="k8ssandra-system-logger" | ||
|
||
docker run --rm -d --name "$NAME" ${IMAGE_NAME} | ||
|
||
sleep 10 | ||
|
||
logs=$(docker logs "$NAME" 2>&1) | ||
|
||
docker kill --signal=INT "$NAME" | ||
docker wait "$NAME" | ||
|
||
asserts=("Vector has started." "Healthcheck passed.") | ||
|
||
# assert that all the expected logs are present | ||
for assert in "${asserts[@]}"; do | ||
if ! echo "$logs" | grep -q "$assert"; then | ||
echo "Assertion failed: $assert" | ||
exit 1 | ||
fi | ||
done | ||
|
||
echo "All assertions passed." |
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,22 @@ | ||
terraform { | ||
required_providers { | ||
oci = { source = "chainguard-dev/oci" } | ||
helm = { source = "hashicorp/helm" } | ||
} | ||
} | ||
|
||
variable "digest" { | ||
description = "The image digest to run tests over." | ||
} | ||
|
||
data "oci_string" "ref" { input = var.digest } | ||
|
||
data "oci_exec_test" "help" { | ||
digest = var.digest | ||
script = "docker run --rm $IMAGE_NAME --help" | ||
} | ||
|
||
data "oci_exec_test" "test" { | ||
digest = var.digest | ||
script = "${path.module}/01-test.sh" | ||
} |
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