Skip to content

Commit

Permalink
Rename properties
Browse files Browse the repository at this point in the history
Signed-off-by: Mykola Morhun <mmorhun@redhat.com>
  • Loading branch information
mmorhun committed Nov 25, 2020
1 parent 3e64c28 commit ceb42bb
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,25 @@ che.workspace.startup_debug_log_limit_bytes=10485760
# This configuration is mainly required for workspace idling when the OpenShift OAuth is enabled.
che.workspace.stop.role.enabled=true


# Name of cofig map in Che server namespace with additional CA TLS certificates to be propogated into all user's workspaces.
# If the property is set on OpenShift 4 infrastructure, then cluster CA bundle will be propogated too.
che.infra.kubernetes.trusted_ca.src_configmap=NULL

# Name of configmap in a workspace namespace with additional CA TLS certificates.
# Holds the copy of che.infra.kubernetes.trusted_ca.src_configmap but in a workspace namespace.
# Content of this config map is mounted into all workspace containers including plugin brokers.
# Do not change the config map name unless it conflicts with the already existing config map.
che.infra.kubernetes.trusted_ca.dest_configmap=ca-certs

# Configures path on workspace containers where the CA bundle should be mount.
# Content of config map specified by che.infra.kubernetes.trusted_ca.dest_configmap is mounted.
che.infra.kubernetes.trusted_ca.mount_path=/public-certs

# Comma separated list of labels to add to the CA certificates config map in user workspace.
# See che.infra.kubernetes.trusted_ca.dest_configmap property.
che.infra.kubernetes.trusted_ca.dest_configmap_labels=

### Authentication parameters

# Che has a single identity implementation, so this does not change the user experience.
Expand Down Expand Up @@ -188,18 +207,6 @@ che.oauth.openshift.verify_token_url= NULL
# a recurring schedule.
schedule.core_pool_size=10

# Name of cofig map in Che server namespace with additional CA TLS certificates to be propogated into all user's workspaces.
# If the property is set on OpenShift 4 infrastructure, then cluster CA bundle will be propogated too.
che.trusted_ca.bundles_configmap=NULL

# Name of configmap in a workspace namespace with additional CA TLS certificates.
# Holds the copy of che.trusted_ca.bundles_configmap but in a workspace namespace.
# Content of this config map is mounted into all workspace containers including plugin brokers.
che.trusted_ca.workspace_bundle_configmap=ca-certs

# Configures path on workspace containers where the CA bundles are mount.
che.trusted_ca.bundle_mount_path=/public-certs

# DB initialization and migration configuration
db.schema.flyway.baseline.enabled=true
db.schema.flyway.baseline.version=5.0.0.8.1
Expand Down Expand Up @@ -251,9 +258,6 @@ che.infra.kubernetes.ingress.domain=
# the namespace specified by the che.infra.kubernetes.namespace.default will be created and used.
che.infra.kubernetes.namespace=

# Labels for config maps which holds trusted CA bundle in workspace namespace.
che.infra.kubernetes.trusted_ca_bundles_config_map_labels=NULL

# Indicates whether Che server is allowed to create namespaces/projects for user
# workspaces, or they're intended to be created manually by cluster administrator.
# This property is also used by the OpenShift infra.
Expand Down Expand Up @@ -509,9 +513,10 @@ che.infra.kubernetes.runtimes_consistency_check_period_min=-1
# the namespace specified by the che.infra.kubernetes.namespace.default will be created and used.
che.infra.openshift.project=

# Labels for config maps which holds trusted CA bundle in workspace namespace.
# THis default value is used for automatic certificate injection in Openshift 4.
che.infra.openshift.trusted_ca_bundles_config_map_labels=config.openshift.io/inject-trusted-cabundle=true
# Comma separated list of labels to add to the CA certificates config map in user workspace.
# See che.infra.kubernetes.trusted_ca.dest_configmap property.
# This default value is used for automatic cluster CA bundle injection in Openshift 4.
che.infra.openshift.trusted_ca.dest_configmap_labels=config.openshift.io/inject-trusted-cabundle=true

# Additional labels to add into every Route created by Che server
# to allow clear identification.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ che.limits.workspace.idle.timeout=che.workspace.agent.dev.inactive_stop_timeout_

che.workspace.default_memory_limit_mb=che.workspace.default_memory_mb

che.trusted_ca.bundles_configmap=che.trusted_ca_bundles_configmap
che.trusted_ca.workspace_bundle_configmap=che.infra.openshift.trusted_ca_bundles_config_map
che.trusted_ca.bundle_mount_path=che.infra.openshift.trusted_ca_bundles_mount_path
che.infra.kubernetes.trusted_ca.src_configmap=che.trusted_ca_bundles_configmap
che.infra.kubernetes.trusted_ca.dest_configmap=che.infra.openshift.trusted_ca_bundles_config_map
che.infra.kubernetes.trusted_ca.mount_path=che.infra.openshift.trusted_ca_bundles_mount_path
che.infra.openshift.trusted_ca.dest_configmap_labels=che.infra.openshift.trusted_ca_bundles_config_map_labels
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ public class KubernetesTrustedCAProvisioner implements TrustedCAProvisioner {

@Inject
public KubernetesTrustedCAProvisioner(
@Nullable @Named("che.trusted_ca.bundles_configmap") String caBundleConfigMap,
@Named("che.trusted_ca.workspace_bundle_configmap") String configMapName,
@Named("che.trusted_ca.bundle_mount_path") String certificateMountPath,
@Nullable @Named("che.infra.kubernetes.trusted_ca_bundles_config_map_labels")
@Nullable @Named("che.infra.kubernetes.trusted_ca.src_configmap") String caBundleConfigMap,
@Named("che.infra.kubernetes.trusted_ca.dest_configmap") String configMapName,
@Named("che.infra.kubernetes.trusted_ca.mount_path") String certificateMountPath,
@Nullable @Named("che.infra.kubernetes.trusted_ca.dest_configmap_labels")
String configMapLabel,
CheInstallationLocation cheInstallationLocation,
KubernetesNamespaceFactory namespaceFactory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@

/**
* This class overrides CA bundle config map labels (from
* che.infra.openshift.trusted_ca_bundles_config_map_labels property) to be able to include
* OpenShift 4+ specific label config.openshift.io/inject-trusted-cabundle=true that makes OpenShift
* inject cluster CA bundle into resulting config map. For more details see
* che.infra.openshift.trusted_ca.dest_configmap_labels) to be able to include OpenShift 4+ specific
* label config.openshift.io/inject-trusted-cabundle=true that makes OpenShift inject cluster CA
* bundle into resulting config map. For more details see
* https://docs.openshift.com/container-platform/4.3/networking/configuring-a-custom-pki.html#certificate-injection-using-operators_configuring-a-custom-pki
*/
@Singleton
public class OpenshiftTrustedCAProvisioner extends KubernetesTrustedCAProvisioner {

@Inject
public OpenshiftTrustedCAProvisioner(
@Nullable @Named("che.trusted_ca.bundles_configmap") String caBundleConfigMap,
@Named("che.trusted_ca.workspace_bundle_configmap") String configMapName,
@Named("che.trusted_ca.bundle_mount_path") String certificateMountPath,
@Nullable @Named("che.infra.openshift.trusted_ca_bundles_config_map_labels")
@Nullable @Named("che.infra.kubernetes.trusted_ca.src_configmap") String caBundleConfigMap,
@Named("che.infra.kubernetes.trusted_ca.dest_configmap") String configMapName,
@Named("che.infra.kubernetes.trusted_ca.mount_path") String certificateMountPath,
@Nullable @Named("che.infra.openshift.trusted_ca.dest_configmap_labels")
String configMapLabel,
CheInstallationLocation cheInstallationLocation,
OpenShiftProjectFactory projectFactory,
Expand Down

0 comments on commit ceb42bb

Please sign in to comment.