Skip to content

Commit

Permalink
Introduce experimental.managedServices.include 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 Jun 10, 2024
1 parent c6a012c commit dd89962
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ 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.
- `experimental`: Experimental features. Make sure you do not enable those on production. No guarantee provided! Backwards incompatible changes in future are quite probable!
- `managedServices`:
- `include` (_Boolean_): Enable 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.experimental.managedServices.include }}
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.experimental.managedServices.include }}
24 changes: 23 additions & 1 deletion helm/korifi/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,14 @@
"type": "string"
}
},
"required": ["description", "name", "minCLIVersion", "recommendedCLIVersion", "custom", "supportAddress"]
"required": [
"description",
"name",
"minCLIVersion",
"recommendedCLIVersion",
"custom",
"supportAddress"
]
},
"lifecycle": {
"type": "object",
Expand Down Expand Up @@ -579,6 +586,21 @@
}
},
"type": "object"
},
"experimental": {
"properties": {
"managedServices": {
"properties": {
"include": {
"description": "Enable managed services support",
"type": "boolean"
}
},
"type": "object"
}
},
"description": "Experimental features. Make sure you do not enable those on production. No guarantee provided! Backwards incompatible changes in future are quite probable!",
"type": "object"
}
},
"required": [
Expand Down
10 changes: 8 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 Expand Up @@ -138,3 +140,7 @@ helm:

networking:
gatewayClass:

experimental:
managedServices:
include: false
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=experimental.managedServices.include="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=experimental.managedServices.include="true" \
--wait
kubectl wait --for=condition=ready clusterbuilder --all=true --timeout=15m
Expand Down

0 comments on commit dd89962

Please sign in to comment.