THIS IS ONLY A TEST INSTANCE. DON'T DO IMPORTANT WORK HERE!

Unverified Commit 8ee9b4ea authored by Michal Vala's avatar Michal Vala Committed by GitHub
Browse files

Support workspace namespace configuration (#136)


Signed-off-by: default avatarMichal Vala <mvala@redhat.com>
parent f03ed110
......@@ -50,6 +50,10 @@ spec:
serverMemoryRequest: ''
# sets mem limit for server deployment. Defaults to 1Gi
serverMemoryLimit: ''
# sets default namespace where new workspaces will be created
workspaceNamespaceDefault: ''
# defines if user is able to specify namespace different from the default
allowUserDefinedWorkspaceNamespaces: false
database:
# when set to true, the operator skips deploying Postgres, and passes connection details of existing DB to Che server
# otherwise a Postgres deployment is created
......
......@@ -30,12 +30,12 @@ spec:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type: string
metadata:
type: object
......@@ -220,7 +220,7 @@ spec:
used by the Che installation.
properties:
enable:
description: Enables `metrics` Che server endpoint.
description: Enables `metrics` Che server endpoint. Default to `false`.
type: boolean
type: object
server:
......@@ -241,6 +241,12 @@ spec:
involved in a Che deployment. This is particularly useful to install
Che in an air-gapped environment.
type: string
allowUserDefinedWorkspaceNamespaces:
description: Defines if a user is able to specify Kubernetes namespace
(or OpenShift project) different from the default. It's NOT RECOMMENDED
to configured true without OAuth configured. This property is
also used by the OpenShift infra.
type: boolean
cheDebug:
description: Enables the debug mode for Che server. Defaults to
`false`.
......@@ -398,6 +404,14 @@ spec:
WARNING: Enabling TLS might require enabling the `selfSignedCert`
field also in some cases.'
type: boolean
workspaceNamespaceDefault:
description: 'Defines Kubernetes default namespace in which user''s
workspaces are created if user does not override it. It''s possible
to use <username>, <userid> and <workspaceid> placeholders (e.g.:
che-workspace-<username>). In that case, new namespace will be
created for each user (or workspace). Is used by OpenShift infra
as well to specify Project'
type: string
type: object
storage:
description: Configuration settings related to the persistent storage
......@@ -488,6 +502,6 @@ spec:
type: object
version: v1
versions:
- name: v1
served: true
storage: true
- name: v1
served: true
storage: true
--- /workdir/olm/eclipse-che-preview-kubernetes/deploy/olm-catalog/eclipse-che-preview-kubernetes/9.9.9-nightly.1572295030/eclipse-che-preview-kubernetes.crd.yaml
+++ /workdir/olm/eclipse-che-preview-kubernetes/deploy/olm-catalog/eclipse-che-preview-kubernetes/9.9.9-nightly.1575355471/eclipse-che-preview-kubernetes.crd.yaml
@@ -24,6 +24,8 @@
status: {}
validation:
openAPIV3Schema:
+ description: The `CheCluster` custom resource allows defining and managing a
+ Che server installation
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
@@ -38,6 +40,11 @@
metadata:
type: object
spec:
+ description: Desired configuration of the Che installation. Based on these
+ settings, the operator automatically creates and maintains several config
+ maps that will contain the appropriate environment variables the various
+ components of the Che installation. These generated config maps should
+ NOT be updated manually.
properties:
auth:
description: Configuration settings related to the Authentication used
@@ -208,6 +215,14 @@
TLS termination if TLS is enabled. See also the `tlsSupport` field.
type: string
type: object
+ metrics:
+ description: Configuration settings related to the metrics collection
+ used by the Che installation.
+ properties:
+ enable:
+ description: Enables `metrics` Che server endpoint. Default to `false`.
+ type: boolean
+ type: object
server:
description: General configuration settings related to the Che server
and the plugin and devfile registries
@@ -226,6 +241,12 @@
involved in a Che deployment. This is particularly useful to install
Che in an air-gapped environment.
type: string
+ allowUserDefinedWorkspaceNamespaces:
+ description: Defines if a user is able to specify Kubernetes namespace
+ (or OpenShift project) different from the default. It's NOT RECOMMENDED
+ to configured true without OAuth configured. This property is
+ also used by the OpenShift infra.
+ type: boolean
cheDebug:
description: Enables the debug mode for Che server. Defaults to
`false`.
@@ -343,8 +364,8 @@
default this will be automatically calculated by the operator.
type: string
proxyPassword:
- description: Password of the proxy server Only use when proxy configuration
- is required (see also the `proxyUser` field).
+ description: "Password of the proxy server \n Only use when proxy
+ configuration is required (see also the `proxyUser` field)."
type: string
proxyPort:
description: Port of the proxy server. Only use when configuring
@@ -383,6 +404,14 @@
WARNING: Enabling TLS might require enabling the `selfSignedCert`
field also in some cases.'
type: boolean
+ workspaceNamespaceDefault:
+ description: 'Defines Kubernetes default namespace in which user''s
+ workspaces are created if user does not override it. It''s possible
+ to use <username>, <userid> and <workspaceid> placeholders (e.g.:
+ che-workspace-<username>). In that case, new namespace will be
+ created for each user (or workspace). Is used by OpenShift infra
+ as well to specify Project'
+ type: string
type: object
storage:
description: Configuration settings related to the persistent storage
@@ -423,6 +452,7 @@
type: object
type: object
status:
+ description: CheClusterStatus defines the observed state of Che installation
properties:
cheClusterRunning:
description: Status of a Che installation. Can be `Available`, `Unavailable`,
@@ -469,6 +499,7 @@
the pod is in this state.
type: string
type: object
+ type: object
version: v1
versions:
- name: v1
--- /workdir/olm/eclipse-che-preview-kubernetes/deploy/olm-catalog/eclipse-che-preview-kubernetes/9.9.9-nightly.1572295030/eclipse-che-preview-kubernetes.v9.9.9-nightly.1572295030.clusterserviceversion.yaml
+++ /workdir/olm/eclipse-che-preview-kubernetes/deploy/olm-catalog/eclipse-che-preview-kubernetes/9.9.9-nightly.1575355471/eclipse-che-preview-kubernetes.v9.9.9-nightly.1575355471.clusterserviceversion.yaml
@@ -49,12 +49,12 @@
categories: Developer Tools
certified: "false"
containerImage: quay.io/eclipse/che-operator:nightly
- createdAt: "2019-10-28T20:37:10Z"
+ createdAt: "2019-12-03T06:44:31Z"
description: A Kube-native development solution that delivers portable and collaborative
developer workspaces.
repository: https://github.com/eclipse/che-operator
support: Eclipse Foundation
- name: eclipse-che-preview-kubernetes.v9.9.9-nightly.1572295030
+ name: eclipse-che-preview-kubernetes.v9.9.9-nightly.1575355471
namespace: placeholder
spec:
apiservicedefinitions: {}
@@ -350,5 +350,5 @@
maturity: stable
provider:
name: Eclipse Foundation
- replaces: eclipse-che-preview-kubernetes.v9.9.9-nightly.1571049441
- version: 9.9.9-nightly.1572295030
+ replaces: eclipse-che-preview-kubernetes.v9.9.9-nightly.1572295030
+ version: 9.9.9-nightly.1575355471
channels:
- currentCSV: eclipse-che-preview-kubernetes.v9.9.9-nightly.1572295030
- currentCSV: eclipse-che-preview-kubernetes.v9.9.9-nightly.1575355471
name: nightly
- currentCSV: eclipse-che-preview-kubernetes.v7.4.0
name: stable
......
--- /workdir/olm/eclipse-che-preview-openshift/deploy/olm-catalog/eclipse-che-preview-openshift/9.9.9-nightly.1572295030/eclipse-che-preview-openshift.crd.yaml
+++ /workdir/olm/eclipse-che-preview-openshift/deploy/olm-catalog/eclipse-che-preview-openshift/9.9.9-nightly.1575355471/eclipse-che-preview-openshift.crd.yaml
@@ -24,6 +24,8 @@
status: {}
validation:
openAPIV3Schema:
+ description: The `CheCluster` custom resource allows defining and managing a
+ Che server installation
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
@@ -38,6 +40,11 @@
metadata:
type: object
spec:
+ description: Desired configuration of the Che installation. Based on these
+ settings, the operator automatically creates and maintains several config
+ maps that will contain the appropriate environment variables the various
+ components of the Che installation. These generated config maps should
+ NOT be updated manually.
properties:
auth:
description: Configuration settings related to the Authentication used
@@ -208,6 +215,14 @@
TLS termination if TLS is enabled. See also the `tlsSupport` field.
type: string
type: object
+ metrics:
+ description: Configuration settings related to the metrics collection
+ used by the Che installation.
+ properties:
+ enable:
+ description: Enables `metrics` Che server endpoint. Default to `false`.
+ type: boolean
+ type: object
server:
description: General configuration settings related to the Che server
and the plugin and devfile registries
@@ -226,6 +241,12 @@
involved in a Che deployment. This is particularly useful to install
Che in an air-gapped environment.
type: string
+ allowUserDefinedWorkspaceNamespaces:
+ description: Defines if a user is able to specify Kubernetes namespace
+ (or OpenShift project) different from the default. It's NOT RECOMMENDED
+ to configured true without OAuth configured. This property is
+ also used by the OpenShift infra.
+ type: boolean
cheDebug:
description: Enables the debug mode for Che server. Defaults to
`false`.
@@ -343,8 +364,8 @@
default this will be automatically calculated by the operator.
type: string
proxyPassword:
- description: Password of the proxy server Only use when proxy configuration
- is required (see also the `proxyUser` field).
+ description: "Password of the proxy server \n Only use when proxy
+ configuration is required (see also the `proxyUser` field)."
type: string
proxyPort:
description: Port of the proxy server. Only use when configuring
@@ -383,6 +404,14 @@
WARNING: Enabling TLS might require enabling the `selfSignedCert`
field also in some cases.'
type: boolean
+ workspaceNamespaceDefault:
+ description: 'Defines Kubernetes default namespace in which user''s
+ workspaces are created if user does not override it. It''s possible
+ to use <username>, <userid> and <workspaceid> placeholders (e.g.:
+ che-workspace-<username>). In that case, new namespace will be
+ created for each user (or workspace). Is used by OpenShift infra
+ as well to specify Project'
+ type: string
type: object
storage:
description: Configuration settings related to the persistent storage
@@ -423,6 +452,7 @@
type: object
type: object
status:
+ description: CheClusterStatus defines the observed state of Che installation
properties:
cheClusterRunning:
description: Status of a Che installation. Can be `Available`, `Unavailable`,
@@ -469,6 +499,7 @@
the pod is in this state.
type: string
type: object
+ type: object
version: v1
versions:
- name: v1
--- /workdir/olm/eclipse-che-preview-openshift/deploy/olm-catalog/eclipse-che-preview-openshift/9.9.9-nightly.1572295030/eclipse-che-preview-openshift.v9.9.9-nightly.1572295030.clusterserviceversion.yaml
+++ /workdir/olm/eclipse-che-preview-openshift/deploy/olm-catalog/eclipse-che-preview-openshift/9.9.9-nightly.1575355471/eclipse-che-preview-openshift.v9.9.9-nightly.1575355471.clusterserviceversion.yaml
@@ -46,12 +46,12 @@
categories: Developer Tools, OpenShift Optional
certified: "false"
containerImage: quay.io/eclipse/che-operator:nightly
- createdAt: "2019-10-28T20:37:10Z"
+ createdAt: "2019-12-03T06:44:31Z"
description: A Kube-native development solution that delivers portable and collaborative
developer workspaces in OpenShift.
repository: https://github.com/eclipse/che-operator
support: Eclipse Foundation
- name: eclipse-che-preview-openshift.v9.9.9-nightly.1572295030
+ name: eclipse-che-preview-openshift.v9.9.9-nightly.1575355471
namespace: placeholder
spec:
apiservicedefinitions: {}
@@ -395,5 +395,5 @@
maturity: stable
provider:
name: Eclipse Foundation
- replaces: eclipse-che-preview-openshift.v9.9.9-nightly.1571049441
- version: 9.9.9-nightly.1572295030
+ replaces: eclipse-che-preview-openshift.v9.9.9-nightly.1572295030
+ version: 9.9.9-nightly.1575355471
channels:
- currentCSV: eclipse-che-preview-openshift.v9.9.9-nightly.1572295030
- currentCSV: eclipse-che-preview-openshift.v9.9.9-nightly.1575355471
name: nightly
- currentCSV: eclipse-che-preview-openshift.v7.4.0
name: stable
......
......@@ -98,6 +98,17 @@ type CheClusterSpecServer struct {
// The default roles are used if this is omitted or left blank.
// +optional
CheWorkspaceClusterRole string `json:"cheWorkspaceClusterRole,omitempty"`
// Defines Kubernetes default namespace in which user's workspaces are created
// if user does not override it.
// It's possible to use <username>, <userid> and <workspaceid> placeholders (e.g.: che-workspace-<username>).
// In that case, new namespace will be created for each user (or workspace).
// Is used by OpenShift infra as well to specify Project
// +optional
WorkspaceNamespaceDefault string `json:"workspaceNamespaceDefault,omitempty"`
// Defines if a user is able to specify Kubernetes namespace (or OpenShift project) different from the default.
// It's NOT RECOMMENDED to configured true without OAuth configured. This property is also used by the OpenShift infra.
// +optional
AllowUserDefinedWorkspaceNamespaces bool `json:"allowUserDefinedWorkspaceNamespaces"`
// Enables the support of OpenShift clusters whose router uses self-signed certificates.
// When enabled, the operator retrieves the default self-signed certificate of OpenShift routes
// and adds it to the Java trust store of the Che server.
......
// +build !ignore_autogenerated
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by operator-sdk. DO NOT EDIT.
package v1
......@@ -56,7 +40,7 @@ func (in *CheCluster) DeepCopyObject() runtime.Object {
func (in *CheClusterList) DeepCopyInto(out *CheClusterList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]CheCluster, len(*in))
......
......@@ -30,14 +30,14 @@ func schema_pkg_apis_org_v1_CheCluster(ref common.ReferenceCallback) common.Open
Properties: map[string]spec.Schema{
"kind": {
SchemaProps: spec.SchemaProps{
Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds",
Type: []string{"string"},
Format: "",
},
},
"apiVersion": {
SchemaProps: spec.SchemaProps{
Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources",
Type: []string{"string"},
Format: "",
},
......@@ -421,6 +421,20 @@ func schema_pkg_apis_org_v1_CheClusterSpecServer(ref common.ReferenceCallback) c
Format: "",
},
},
"workspaceNamespaceDefault": {
SchemaProps: spec.SchemaProps{
Description: "Defines Kubernetes default namespace in which user's workspaces are created if user does not override it. It's possible to use <username>, <userid> and <workspaceid> placeholders (e.g.: che-workspace-<username>). In that case, new namespace will be created for each user (or workspace). Is used by OpenShift infra as well to specify Project",
Type: []string{"string"},
Format: "",
},
},
"allowUserDefinedWorkspaceNamespaces": {
SchemaProps: spec.SchemaProps{
Description: "Defines if a user is able to specify Kubernetes namespace (or OpenShift project) different from the default. It's NOT RECOMMENDED to configured true without OAuth configured. This property is also used by the OpenShift infra.",
Type: []string{"boolean"},
Format: "",
},
},
"selfSignedCert": {
SchemaProps: spec.SchemaProps{
Description: "Enables the support of OpenShift clusters whose router uses self-signed certificates. When enabled, the operator retrieves the default self-signed certificate of OpenShift routes and adds it to the Java trust store of the Che server. This is usually required when activating the `tlsSupport` field on demo OpenShift clusters that have not been setup with a valid certificate for the routes. This is disabled by default.",
......
......@@ -40,6 +40,7 @@ type CheConfigMap struct {
CheInfrastructureActive string `json:"CHE_INFRASTRUCTURE_ACTIVE"`
CheInfraKubernetesServiceAccountName string `json:"CHE_INFRA_KUBERNETES_SERVICE__ACCOUNT__NAME"`
DefaultTargetNamespace string `json:"CHE_INFRA_KUBERNETES_NAMESPACE_DEFAULT"`
NamespaceAllowUserDefined string `json:"CHE_INFRA_KUBERNETES_NAMESPACE_ALLOW__USER__DEFINED"`
PvcStrategy string `json:"CHE_INFRA_KUBERNETES_PVC_STRATEGY"`
PvcClaimSize string `json:"CHE_INFRA_KUBERNETES_PVC_QUANTITY"`
PvcJobsImage string `json:"CHE_INFRA_KUBERNETES_PVC_JOBS_IMAGE"`
......@@ -86,7 +87,8 @@ func GetConfigMapData(cr *orgv1.CheCluster) (cheEnv map[string]string) {
if isOpenShift {
infra = "openshift"
}
defaultTargetNamespace := cr.Namespace
defaultTargetNamespace := util.GetValue(cr.Spec.Server.WorkspaceNamespaceDefault, cr.Namespace)
namespaceAllowUserDefined := strconv.FormatBool(cr.Spec.Server.AllowUserDefinedWorkspaceNamespaces)
tls := "false"
openShiftIdentityProviderId := "NULL"
openshiftOAuth := cr.Spec.Auth.OpenShiftoAuth
......@@ -163,6 +165,7 @@ func GetConfigMapData(cr *orgv1.CheCluster) (cheEnv map[string]string) {
CheInfrastructureActive: infra,
CheInfraKubernetesServiceAccountName: "che-workspace",
DefaultTargetNamespace: defaultTargetNamespace,
NamespaceAllowUserDefined: namespaceAllowUserDefined,
PvcStrategy: pvcStrategy,
PvcClaimSize: pvcClaimSize,
WorkspacePvcStorageClassName: workspacePvcStorageClassName,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment