-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add configFile listener; ETag support
- Loading branch information
1 parent
b168a5c
commit 4b48ff9
Showing
7 changed files
with
207 additions
and
60 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 |
---|---|---|
|
@@ -170,6 +170,8 @@ r.Handle("/") | |
- [Run with containers](#run-with-containers) | ||
- [Running as Kubernetes Service](#running-as-kubernetes-service) | ||
- [Static environment variables](#static-environment-variables) | ||
- [Dynamic Configuration File Updates](#dynamic-configuration-file-updates) | ||
- [ETag](#etag) | ||
- [Extending the sample](#extending-the-sample) | ||
- [Using link-local address](#using-link-local-address) | ||
- [Using domain sockets](#using-domain-sockets) | ||
|
@@ -608,22 +610,7 @@ This emulator is also published as a release-tagged container to dockerhub: | |
|
||
* [https://hub.docker.com/r/salrashid123/gcemetadataserver](https://hub.docker.com/r/salrashid123/gcemetadataserver) | ||
|
||
The images are also signed using my github address (`salrashid123@gmail`). If you really want to, you can verify each signature usign `cosign`: | ||
|
||
```bash | ||
## for tag/version 3.4.0: | ||
IMAGE="index.docker.io/salrashid123/gcemetadataserver@sha256:c3cec9e18adb87a14889f19ab0c3c87d66339284b35ca72135ff9dcd58a59671" | ||
|
||
## i signed it directly, keyless: | ||
# $ cosign sign $IMAGE | ||
|
||
## which you can verify: | ||
$ cosign verify [email protected] --certificate-oidc-issuer=https://github.com/login/oauth $IMAGE | jq '.' | ||
|
||
## search and get | ||
# $ rekor-cli search --rekor_server https://rekor.sigstore.dev --email [email protected] | ||
# $ rekor-cli get --rekor_server https://rekor.sigstore.dev --log-index $LogIndex --format=json | jq '.' | ||
``` | ||
You can verify the image were signed by the repo owner if you really want to (see section below). | ||
|
||
### Run with containers | ||
|
||
|
@@ -696,6 +683,21 @@ Number of Buckets: 62 | |
>> needless to say, the metadata Service should be accessed only form authorized pods | ||
### Dynamic Configuration File Updates | ||
Changes to the claims configuration file (`--configFile=`) while the metadata server is running will automatically update values returned by the server. | ||
|
||
On startup, the metadata server sets a file listener on that config file and any updates to the values will propagate back to the server without requiring a restart. | ||
|
||
### ETag | ||
|
||
GCE metadata servers return values with [ETag](https://cloud.google.com/compute/docs/metadata/querying-metadata#etags) headers. The ETag is used to check if a specific attribute or value has changed. | ||
|
||
This metadata server will hash the value for the body to return and use that as the ETag. If you update the configuration file with new attributes or values, the ETag for that node will change. The `ETag` header key is returned in non-canonical format. | ||
|
||
Note `wait-for-change` value is not supported currently so while you can poll for etag changes, you cannot listen and hold. | ||
|
||
|
||
### Static environment variables | ||
|
||
If you do not have access to certificate file or would like to specify **static** token values via env-var, the metadata server supports the following environment variables as substitutions. Once you set these environment variables, the service will not look for anything using the service Account JSON file (even if specified) | ||
|
@@ -973,6 +975,25 @@ wget https://github.com/salrashid123/gce_metadata_server/releases/download/v3.4. | |
gpg --verify gce_metadata_server_3.4.1_checksums.txt.sig gce_metadata_server_3.4.1_checksums.txt | ||
``` | ||
|
||
#### Verify Container Image Signature | ||
|
||
The images are also signed using my github address (`salrashid123@gmail`). If you really want to, you can verify each signature usign `cosign`: | ||
|
||
```bash | ||
## for tag/version 3.4.0: | ||
IMAGE="index.docker.io/salrashid123/gcemetadataserver@sha256:c3cec9e18adb87a14889f19ab0c3c87d66339284b35ca72135ff9dcd58a59671" | ||
|
||
## i signed it directly, keyless: | ||
# $ cosign sign $IMAGE | ||
|
||
## which you can verify: | ||
$ cosign verify [email protected] --certificate-oidc-issuer=https://github.com/login/oauth $IMAGE | jq '.' | ||
|
||
## search and get | ||
# $ rekor-cli search --rekor_server https://rekor.sigstore.dev --email [email protected] | ||
# $ rekor-cli get --rekor_server https://rekor.sigstore.dev --log-index $LogIndex --format=json | jq '.' | ||
``` | ||
|
||
## Testing | ||
|
||
a lot todo here, right...thats just life | ||
|
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
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
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
Oops, something went wrong.