Skip to content

Commit

Permalink
docs: Describe how to run the service locally (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
wndhydrnt committed Mar 28, 2024
1 parent 49ca421 commit d3ad1bb
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
secrets-store-csi-driver-provider-spring-cloud-config
.dev/
51 changes: 50 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
fileName: "application.yaml" # the name of the file to create - supports extensions .yaml, .yml, .json and .properties
```

Afterwards you can reference your `SecretProviderClass` in your Pod Definition
Afterward, reference your `SecretProviderClass` in your Pod Definition

```yaml
kind: Pod
Expand Down Expand Up @@ -63,6 +63,55 @@ spec:
secretProviderClass: "spring-cloud-config-example"
```

## Development

### Run the binary locally

#### Requirements

- [Go](https://go.dev/doc/install)
- [gRPCurl](https://github.com/fullstorydev/grpcurl?tab=readme-ov-file#installation)


#### Steps to execute

1. Build the binary:
```shell
go build
```
1. Start the binary:
```shell
./secrets-store-csi-driver-provider-spring-cloud-config
```
1. In a new terminal window, create the directory `.dev`:
```shell
mkdir -p .dev
```
1. Download the grpc protobuf definitions:
```shell
curl -L -o .dev/service.proto https://raw.githubusercontent.com/kubernetes-sigs/secrets-store-csi-driver/main/provider/v1alpha1/service.proto
```
1. Create the payload `.dev/mount.json`:
```json
{
"attributes": "{\"serverAddress\":\"<your-server-address>\",\"application\":\"<your application>\",\"profile\":\"<your profile>\",\"fileName\":\"application.yaml\"}",
"secrets": "{}",
"targetPath": "./.dev",
"permission": "420"
}
```
**Make sure to replace the placeholders**
1. Send the payload to the provider:
```shell
cat ./.dev/mount.json | grpcurl -unix -plaintext -proto ./.dev/service.proto -d @ ./spring-cloud-config.sock v1alpha1.CSIDriverProvider/Mount
```
1. Verify that the file has been created:
```shell
cat ./.dev/application.yaml
# Should display YAML content
```


## Release

Follow these steps to release a new version:
Expand Down

0 comments on commit d3ad1bb

Please sign in to comment.