Skip to content

Commit

Permalink
add placement table helm config (dapr#6732)
Browse files Browse the repository at this point in the history
Signed-off-by: zhangchao <zchao9100@gmail.com>
Co-authored-by: Artur Souza <asouza.pro@gmail.com>
  • Loading branch information
Taction and artursouza authored Aug 2, 2023
1 parent c585729 commit a82fc71
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 22 deletions.
29 changes: 15 additions & 14 deletions charts/dapr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,20 +119,21 @@ The Helm chart has the follow configuration options that can be supplied:
| `dapr_operator.watchNamespace` | The namespace to watch for annotated Dapr resources in | `""` |

### Dapr Placement options:
| Parameter | Description | Default |
|-------------------------------------------|-------------------------------------------------------------------------|-------------------------|
| `dapr_placement.ha` | If set to true, deploys the Placement service with 3 nodes regardless of the value of `global.ha.enabled` | `false` |
| `dapr_placement.replicationFactor` | Number of consistent hashing virtual node | `100` |
| `dapr_placement.logLevel` | Service Log level | `info` |
| `dapr_placement.image.name` | Service docker image name (`global.registry/dapr_placement.image.name`) | `dapr` |
| `dapr_placement.cluster.forceInMemoryLog` | Use in-memory log store and disable volume attach when HA is true | `false` |
| `dapr_placement.cluster.logStorePath` | Mount path for persistent volume for log store in unix-like system when HA is true | `/var/run/dapr/raft-log` |
| `dapr_placement.cluster.logStoreWinPath` | Mount path for persistent volume for log store in windows when HA is true | `C:\\raft-log` |
| `dapr_placement.volumeclaims.storageSize` | Attached volume size | `1Gi` |
| `dapr_placement.volumeclaims.storageClassName` | storage class name | |
| `dapr_placement.runAsNonRoot` | Boolean value for `securityContext.runAsNonRoot`. Does not apply unless `forceInMemoryLog` is set to `true`. You may have to set this to `false` when running in Minikube | `false` |
| `dapr_placement.resources` | Value of `resources` attribute. Can be used to set memory/cpu resources/limits. See the section "Resource configuration" above. Defaults to empty | `{}` |
| `dapr_placement.debug.enabled` | Boolean value for enabling debug mode | `{}` |
| Parameter | Description | Default |
|------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------|
| `dapr_placement.ha` | If set to true, deploys the Placement service with 3 nodes regardless of the value of `global.ha.enabled` | `false` |
| `dapr_placement.replicationFactor` | Number of consistent hashing virtual node | `100` |
| `dapr_placement.logLevel` | Service Log level | `info` |
| `dapr_placement.image.name` | Service docker image name (`global.registry/dapr_placement.image.name`) | `dapr` |
| `dapr_placement.cluster.forceInMemoryLog` | Use in-memory log store and disable volume attach when HA is true | `false` |
| `dapr_placement.cluster.logStorePath` | Mount path for persistent volume for log store in unix-like system when HA is true | `/var/run/dapr/raft-log` |
| `dapr_placement.cluster.logStoreWinPath` | Mount path for persistent volume for log store in windows when HA is true | `C:\\raft-log` |
| `dapr_placement.volumeclaims.storageSize` | Attached volume size | `1Gi` |
| `dapr_placement.volumeclaims.storageClassName` | storage class name | |
| `dapr_placement.runAsNonRoot` | Boolean value for `securityContext.runAsNonRoot`. Does not apply unless `forceInMemoryLog` is set to `true`. You may have to set this to `false` when running in Minikube | `false` |
| `dapr_placement.resources` | Value of `resources` attribute. Can be used to set memory/cpu resources/limits. See the section "Resource configuration" above. Defaults to empty | `{}` |
| `dapr_placement.debug.enabled` | Boolean value for enabling debug mode | `{}` |
| `dapr_placement.metadataEnabled` | Boolean value for enabling placement tables metadata HTTP API | `false` |

### Dapr RBAC options:
| Parameter | Description | Default |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ spec:
{{- if eq .Values.global.logAsJson true }}
- "--log-as-json"
{{- end }}
{{- if eq .Values.metadataEnabled true }}
- "--metadata-enabled"
{{- end }}
{{- if eq .Values.global.prometheus.enabled true }}
- "--enable-metrics"
- "--replicationFactor"
Expand Down
2 changes: 2 additions & 0 deletions charts/dapr/charts/dapr_placement/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ volumeclaims:

replicationFactor: 100

metadataEnabled: false

livenessProbe:
initialDelaySeconds: 10
periodSeconds: 3
Expand Down
16 changes: 8 additions & 8 deletions pkg/placement/tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ type PlacementTables struct {
TableVersion uint64 `json:"tableVersion,omitempty"`
}
type HostInfo struct {
Name string `json:"name,omitempty"`
AppID string `json:"appId,omitempty"`
Entities []string `json:"entities,omitempty"`
UpdatedAt int64 `json:"updatedAt,omitempty"`
Name string `json:"name,omitempty"`
AppID string `json:"appId,omitempty"`
ActorTypes []string `json:"actorTypes,omitempty"`
UpdatedAt int64 `json:"updatedAt,omitempty"`
}

// GetPlacementTables returns the current placement host infos.
Expand All @@ -35,10 +35,10 @@ func (p *Service) GetPlacementTables() (*PlacementTables, error) {
// the key of the member map is the host name, so we can just ignore it.
for _, v := range m {
members = append(members, HostInfo{
Name: v.Name,
AppID: v.AppID,
Entities: v.Entities,
UpdatedAt: v.UpdatedAt,
Name: v.Name,
AppID: v.AppID,
ActorTypes: v.Entities,
UpdatedAt: v.UpdatedAt,
})
}
response.HostList = members
Expand Down

0 comments on commit a82fc71

Please sign in to comment.