Skip to content

Commit

Permalink
Move the helm stagingRequirements to the top-level
Browse files Browse the repository at this point in the history
 - Move the api.lifecycle.stagingRequirements to
   stagingRequirements because both api and controllers use those
   params
 - Leave the existing api.lifecycle params other than stagingRequirements
   because only api uses those

[#2650]

Co-authored-by: Matt Royal <mroyal@vmware.com>
  • Loading branch information
Clint Yoshimura and matt-royal committed Aug 14, 2023
1 parent bde108a commit 77d8943
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 34 deletions.
8 changes: 4 additions & 4 deletions README.helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ Here are all the values that can be set for the chart:
- `include` (_Boolean_): Deploy the API component.
- `lifecycle`: Default lifecycle for apps.
- `stack` (_String_): Stack.
- `stagingRequirements`:
- `buildCacheMB` (_Integer_): Persistent disk in MB for caching staging artifacts across builds.
- `diskMB` (_Integer_): Ephemeral Disk request in MB for staging apps.
- `memoryMB` (_Integer_): Memory request in MB for staging.
- `type` (_String_): Lifecycle type (only `buildpack` accepted currently).
- `replicas` (_Integer_): Number of replicas.
- `resources`: [`ResourceRequirements`](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#resourcerequirements-v1-core) for the API.
Expand Down Expand Up @@ -105,6 +101,10 @@ Here are all the values that can be set for the chart:
- `requests`: Resource requests.
- `cpu` (_String_): CPU request.
- `memory` (_String_): Memory request.
- `stagingRequirements`:
- `buildCacheMB` (_Integer_): Persistent disk in MB for caching staging artifacts across builds.
- `diskMB` (_Integer_): Ephemeral Disk request in MB for staging apps.
- `memoryMB` (_Integer_): Memory request in MB for staging.
- `statefulsetRunner`:
- `include` (_Boolean_): Deploy the `statefulset-runner` component.
- `replicas` (_Integer_): Number of replicas.
Expand Down
2 changes: 1 addition & 1 deletion helm/korifi/api/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ data:
defaultLifecycleConfig:
type: {{ .Values.api.lifecycle.type }}
stack: {{ .Values.api.lifecycle.stack }}
stagingMemoryMB: {{ .Values.api.lifecycle.stagingRequirements.memoryMB }}
stagingMemoryMB: {{ .Values.stagingRequirements.memoryMB }}
containerRepositoryPrefix: {{ .Values.global.containerRepositoryPrefix | quote }}
{{- if not .Values.global.eksContainerRegistryRoleARN }}
{{- if .Values.global.containerRegistrySecrets }}
Expand Down
6 changes: 3 additions & 3 deletions helm/korifi/controllers/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ data:
containerRepositoryPrefix: {{ .Values.global.containerRepositoryPrefix | quote }}
builderServiceAccount: kpack-service-account
cfStagingResources:
buildCacheMB: {{ .Values.api.lifecycle.stagingRequirements.buildCacheMB }}
diskMB: {{ .Values.api.lifecycle.stagingRequirements.diskMB }}
memoryMB: {{ .Values.api.lifecycle.stagingRequirements.memoryMB }}
buildCacheMB: {{ .Values.stagingRequirements.buildCacheMB }}
diskMB: {{ .Values.stagingRequirements.diskMB }}
memoryMB: {{ .Values.stagingRequirements.memoryMB }}
{{- if .Values.global.eksContainerRegistryRoleARN }}
containerRegistryType: "ECR"
{{- end }}
Expand Down
39 changes: 20 additions & 19 deletions helm/korifi/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@
"description": "Name of the admin user that will be bound to the Cloud Foundry Admin role.",
"type": "string"
},
"stagingRequirements": {
"type": "object",
"properties": {
"memoryMB": {
"description": "Memory request in MB for staging.",
"type": "integer"
},
"diskMB": {
"description": "Ephemeral Disk request in MB for staging apps.",
"type": "integer"
},
"buildCacheMB": {
"description": "Persistent disk in MB for caching staging artifacts across builds.",
"type": "integer"
}
},
"required": ["memoryMB", "diskMB", "buildCacheMB"]
},
"global": {
"description": "Global values that are shared between Korifi and its subcharts.",
"properties": {
Expand Down Expand Up @@ -179,27 +197,9 @@
"stack": {
"description": "Stack.",
"type": "string"
},
"stagingRequirements": {
"type": "object",
"properties": {
"memoryMB": {
"description": "Memory request in MB for staging.",
"type": "integer"
},
"diskMB": {
"description": "Ephemeral Disk request in MB for staging apps.",
"type": "integer"
},
"buildCacheMB": {
"description": "Persistent disk in MB for caching staging artifacts across builds.",
"type": "integer"
}
},
"required": ["memoryMB", "diskMB", "buildCacheMB"]
}
},
"required": ["type", "stack", "stagingRequirements"]
"required": ["type", "stack"]
},
"userCertificateExpirationWarningDuration": {
"description": "Issue a warning if the user certificate provided for login has a long expiry. See [`time.ParseDuration`](https://pkg.go.dev/time#ParseDuration) for details on the format.",
Expand Down Expand Up @@ -516,6 +516,7 @@
"required": [
"global",
"adminUserName",
"stagingRequirements",
"api",
"controllers",
"kpackImageBuilder",
Expand Down
8 changes: 4 additions & 4 deletions helm/korifi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ global:
run: statefulset-runner

adminUserName:
stagingRequirements:
memoryMB: 0
diskMB: 0
buildCacheMB: 2048

api:
include: true
Expand Down Expand Up @@ -44,10 +48,6 @@ api:
lifecycle:
type: buildpack
stack: cflinuxfs3
stagingRequirements:
memoryMB: 0
diskMB: 0
buildCacheMB: 2048

userCertificateExpirationWarningDuration: 168h

Expand Down
5 changes: 2 additions & 3 deletions scripts/assets/values-template.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
adminUserName: cf-admin
stagingRequirements:
buildCacheMB: 1024

global:
defaultAppDomainName: apps-127-0-0-1.nip.io
Expand All @@ -9,9 +11,6 @@ api:
apiServer:
url: localhost
image: cloudfoundry/korifi-api:latest
lifecycle:
stagingRequirements:
buildCacheMB: 1024


controllers:
Expand Down

0 comments on commit 77d8943

Please sign in to comment.