Skip to content

Commit

Permalink
Introduce experimentalManagedServicesEnabled helm value
Browse files Browse the repository at this point in the history
The upcoming managed services support would be initially disabled by
setting the helm value to `false` (the default)

Operators should deliberately enable the flag should they want to give
the feature a try.

This change simply introduces the flag in the helm chart, there is no
implementation that uses it yet. The `deploy-on-kind` script sets it to
`true` as it is meant to be run for development purposes.

The kind installer sets it to `true` as well - whoever is installing
Korifi on kind probably just wants to play with it, therefore enabling
the experimental support does make sense.

fixes #3262
  • Loading branch information
danail-branekov committed May 31, 2024
1 parent 839943a commit 2210544
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ Here are all the values that can be set for the chart:
- `debug` (_Boolean_): Enables remote debugging with [Delve](https://github.com/go-delve/delve).
- `defaultAppDomainName` (_String_): Base domain name for application URLs.
- `eksContainerRegistryRoleARN` (_String_): Amazon Resource Name (ARN) of the IAM role to use to access the ECR registry from an EKS deployed Korifi. Required if containerRegistrySecret not set.
- `experimentalManagedServicesEnabled` (_Boolean_): Enable the experimental managed services support
- `generateIngressCertificates` (_Boolean_): Use `cert-manager` to generate self-signed certificates for the API and app endpoints.
- `helm`:
- `hooksImage` (_String_): Image for the helm hooks containing kubectl
Expand Down
2 changes: 2 additions & 0 deletions api/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ type (
AuthProxyHost string `yaml:"authProxyHost"`
AuthProxyCACert string `yaml:"authProxyCACert"`
LogLevel zapcore.Level `yaml:"logLevel"`

ExperimentalManagedServicesEnabled bool `yaml:"experimentalManagedServicesEnabled"`
}

RoleLevel string
Expand Down
2 changes: 2 additions & 0 deletions api/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ var _ = Describe("Config", func() {
Stack: "lc-stack",
StagingMemoryMB: 10,
},
"experimentalManagedServicesEnabled": true,
}
})

Expand Down Expand Up @@ -88,6 +89,7 @@ var _ = Describe("Config", func() {
StagingMemoryMB: 10,
}))
Expect(cfg.ContainerRegistryType).To(BeEmpty())
Expect(cfg.ExperimentalManagedServicesEnabled).To(BeTrue())
})

When("the FQDN is not specified", func() {
Expand Down
2 changes: 2 additions & 0 deletions controllers/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ type ControllerConfig struct {
ContainerRepositoryPrefix string `yaml:"containerRepositoryPrefix"`
ContainerRegistryType string `yaml:"containerRegistryType"`
Networking Networking `yaml:"networking"`

ExperimentalManagedServicesEnabled bool `yaml:"experimentalManagedServicesEnabled"`
}

type CFProcessDefaults struct {
Expand Down
2 changes: 2 additions & 0 deletions controllers/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ var _ = Describe("LoadFromPath", func() {
GatewayName: "gw-name",
GatewayNamespace: "gw-ns",
},
ExperimentalManagedServicesEnabled: true,
}
})

Expand Down Expand Up @@ -94,6 +95,7 @@ var _ = Describe("LoadFromPath", func() {
GatewayName: "gw-name",
GatewayNamespace: "gw-ns",
},
ExperimentalManagedServicesEnabled: true,
}))
})

Expand Down
1 change: 1 addition & 0 deletions helm/korifi/api/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ data:
{{- if .Values.eksContainerRegistryRoleARN }}
containerRegistryType: "ECR"
{{- end }}
experimentalManagedServicesEnabled: {{ .Values.experimentalManagedServicesEnabled }}
role_mappings_config.yaml: |
roleMappings:
admin:
Expand Down
1 change: 1 addition & 0 deletions helm/korifi/controllers/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,5 @@ data:
networking:
gatewayNamespace: {{ .Release.Namespace }}-gateway
gatewayName: korifi
experimentalManagedServicesEnabled: {{ .Values.experimentalManagedServicesEnabled }}
13 changes: 12 additions & 1 deletion helm/korifi/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
"description": "Amazon Resource Name (ARN) of the IAM role to use to access the ECR registry from an EKS deployed Korifi. Required if containerRegistrySecret not set.",
"type": "string"
},
"experimentalManagedServicesEnabled": {
"description": "Enable the experimental managed services support",
"type": "boolean"
},
"reconcilers": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -224,7 +228,14 @@
"type": "string"
}
},
"required": ["description", "name", "minCLIVersion", "recommendedCLIVersion", "custom", "supportAddress"]
"required": [
"description",
"name",
"minCLIVersion",
"recommendedCLIVersion",
"custom",
"supportAddress"
]
},
"lifecycle": {
"type": "object",
Expand Down
6 changes: 4 additions & 2 deletions helm/korifi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ eksContainerRegistryRoleARN: ""
containerRegistryCACertSecret:
systemImagePullSecrets: []

experimentalManagedServicesEnabled: false

reconcilers:
build: kpack-image-builder
run: statefulset-runner
Expand All @@ -23,7 +25,7 @@ api:
include: true

image: cloudfoundry/korifi-api:latest

nodeSelector: {}
tolerations: []
replicas: 1
Expand Down Expand Up @@ -66,7 +68,7 @@ api:

controllers:
image: cloudfoundry/korifi-controllers:latest

nodeSelector: {}
tolerations: []
replicas: 1
Expand Down
1 change: 1 addition & 0 deletions scripts/deploy-on-kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ function deploy_korifi() {
--set=kpackImageBuilder.clusterStackRunImage="paketobuildpacks/run-jammy-base" \
--set=kpackImageBuilder.builderRepository="$KPACK_BUILDER_REPOSITORY" \
--set=networking.gatewayClass="contour" \
--set=experimentalManagedServicesEnabled="true" \
--wait
}
popd >/dev/null
Expand Down
1 change: 1 addition & 0 deletions scripts/installer/install-korifi-kind.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ spec:
--set=kpackImageBuilder.clusterStackRunImage="paketobuildpacks/run-jammy-base" \
--set=kpackImageBuilder.builderRepository="localregistry-docker-registry.default.svc.cluster.local:30050/kpack-builder" \
--set=networking.gatewayClass="contour" \
--set=experimentalManagedServicesEnabled="true" \
--wait
kubectl wait --for=condition=ready clusterbuilder --all=true --timeout=15m

0 comments on commit 2210544

Please sign in to comment.