Skip to content

Commit

Permalink
feat: Add ability to set up Che workspace and Postgres pvc class name…
Browse files Browse the repository at this point in the history
…s using arguments. (#461)

* Add ability to set up Che workspace and Postgres pvc names using arguments.

Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>

* Regenerate README file

Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
  • Loading branch information
AndrienkoAleksandr authored Jan 16, 2020
1 parent feeeb7d commit c6ea836
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 4 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,15 @@ OPTIONS
--plugin-registry-url=plugin-registry-url
The URL of the external plugin registry.
--postgres-pvc-storage-class-name=postgres-pvc-storage-class-name
persistent volume storage class name to use to store Eclipse Che Postgres database
--self-signed-cert
Authorize usage of self signed certificates for encryption. Note that `self-signed-cert` secret with CA certificate
must be created in the configured namespace.
--workspace-pvc-storage-class-name=workspace-pvc-storage-class-name
persistent volume(s) storage class name to use to store Eclipse Che workspaces data
```

_See code: [src/commands/server/start.ts](https://github.com/che-incubator/chectl/blob/v0.0.2/src/commands/server/start.ts)_
Expand Down
7 changes: 5 additions & 2 deletions src/api/kube.ts
Original file line number Diff line number Diff line change
Expand Up @@ -964,17 +964,20 @@ export class KubeHelper {
}
yamlCr.spec.server.selfSignedCert = flags['self-signed-cert']
yamlCr.spec.k8s.ingressDomain = flags.domain
let pluginRegistryUrl = flags['plugin-registry-url']
const pluginRegistryUrl = flags['plugin-registry-url']
if (pluginRegistryUrl) {
yamlCr.spec.server.pluginRegistryUrl = pluginRegistryUrl
yamlCr.spec.server.externalPluginRegistry = true
}
let devfileRegistryUrl = flags['devfile-registry-url']
const devfileRegistryUrl = flags['devfile-registry-url']
if (devfileRegistryUrl) {
yamlCr.spec.server.devfileRegistryUrl = devfileRegistryUrl
yamlCr.spec.server.externalDevfileRegistry = true
}

yamlCr.spec.storage.postgresPVCStorageClassName = flags['postgres-pvc-storage-class-name']
yamlCr.spec.storage.workspacePVCStorageClassName = flags['workspace-pvc-storage-class-name']

if (flags.cheimage === DEFAULT_CHE_IMAGE &&
yamlCr.spec.server.cheImageTag !== 'nightly' &&
yamlCr.spec.server.cheImageTag !== 'latest') {
Expand Down
9 changes: 9 additions & 0 deletions src/commands/server/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,15 @@ export default class Start extends Command {
directory: string({
char: 'd',
description: 'Directory to store logs into'
}),
'workspace-pvc-storage-class-name': string({
description: 'persistent volume(s) storage class name to use to store Eclipse Che workspaces data',
env: 'CHE_INFRA_KUBERNETES_PVC_STORAGE__CLASS__NAME',
default: ''
}),
'postgres-pvc-storage-class-name': string({
description: 'persistent volume storage class name to use to store Eclipse Che Postgres database',
default: ''
})
}

Expand Down
8 changes: 8 additions & 0 deletions src/tasks/installers/helm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,14 @@ error: E_COMMAND_FAILED`)
ctx.isDevfileRegistryDeployed = true
}

if (flags['workspace-pvc-storage-class-name']) {
setOptions.push(`--set global.cheWorkspacePVCStorageClassName=${flags['workspace-pvc-storage-class-name']}`)
}

if (flags['postgres-pvc-storage-class-name']) {
setOptions.push(`--set global.chePostgresPVCStorageClassName=${flags['postgres-pvc-storage-class-name']}`)
}

setOptions.push(`--set global.ingressDomain=${flags.domain}`)
setOptions.push(`--set cheImage=${flags.cheimage}`)
setOptions.push(`--set global.cheWorkspacesNamespace=${flags.chenamespace}`)
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1677,11 +1677,11 @@ ecc-jsbn@~0.1.1:

"eclipse-che-operator@git://github.com/eclipse/che-operator#master":
version "0.0.0"
resolved "git://github.com/eclipse/che-operator#2e47c3331782868d7b120718ded7be5f5e64c9da"
resolved "git://github.com/eclipse/che-operator#18758810310ee6b163cf59719dcffb9e5b33ea28"

"eclipse-che@git://github.com/eclipse/che#master":
version "0.0.0"
resolved "git://github.com/eclipse/che#dfdc304120cb3286071f4f8a0ded2df0d9b805e4"
resolved "git://github.com/eclipse/che#5ced53ef23269513de294be9689d91c4117fce95"

editorconfig@^0.15.0:
version "0.15.3"
Expand Down

0 comments on commit c6ea836

Please sign in to comment.