Skip to content

Devspaces #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ vault.init
super-linter.log
/archive

ocp-connection.txt
23 changes: 23 additions & 0 deletions charts/hub/devspaces/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
24 changes: 24 additions & 0 deletions charts/hub/devspaces/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: devspaces
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.16.0"
62 changes: 62 additions & 0 deletions charts/hub/devspaces/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "devspaces.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "devspaces.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "devspaces.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "devspaces.labels" -}}
helm.sh/chart: {{ include "devspaces.chart" . }}
{{ include "devspaces.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "devspaces.selectorLabels" -}}
app.kubernetes.io/name: {{ include "devspaces.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "devspaces.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "devspaces.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
43 changes: 43 additions & 0 deletions charts/hub/devspaces/templates/devspaces-instance.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apiVersion: org.eclipse.che/v2
kind: CheCluster
metadata:
name: devspaces
labels:
{{- include "devspaces.labels" . | nindent 4 }}
spec:
devEnvironments:
defaultEditor: che-incubator/che-code/insiders
defaultNamespace:
template: <username>-devspaces
secondsOfInactivityBeforeIdling: -1
secondsOfRunBeforeIdling: -1
storage:
pvcStrategy: per-user
components:
cheServer:
debug: false
logLevel: INFO
dashboard: {}
database:
credentialsSecretName: postgres-credentials
externalDb: false
postgresDb: dbche
postgresHostName: postgres
postgresPort: "5432"
pvc:
claimSize: 1Gi
devWorkspace: {}
devfileRegistry: {}
imagePuller:
enable: false
spec: {}
metrics:
enable: true
pluginRegistry: {}
containerRegistry: {}
networking:
auth:
gateway:
configLabels:
app: che
component: che-gateway-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: git-oauth-credentials
labels:
{{- include "devspaces.labels" . | nindent 4 }}
spec:
refreshInterval: 1h
secretStoreRef:
name: {{ $.Values.secretStore.name }}
kind: {{ $.Values.secretStore.kind }}
target:
name: github-oauth-config
creationPolicy: Owner
template:
metadata:
labels:
app.kubernetes.io/part-of: che.eclipse.org
app.kubernetes.io/component: oauth-scm-configuration
annotations:
che.eclipse.org/oauth-scm-server: github
che.eclipse.org/scm-server-endpoint: https://github.com
data:
id: "{{ "{{" }} .clientID {{ "}}" }}"
secret: "{{ "{{" }} .clientSecret {{ "}}" }}"
data:
- secretKey: clientID
remoteRef:
key: secret/data/hub/github-devspaces
#version: provider-key-version
property: client-id
- secretKey: clientSecret
remoteRef:
key: secret/data/hub/github-devspaces
#version: provider-key-version
property: client-secret
3 changes: 3 additions & 0 deletions charts/hub/devspaces/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
secretStore:
name: vault-backend
kind: ClusterSecretStore
13 changes: 13 additions & 0 deletions values-hub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ clusterGroup:
- devsecops-ci
- openshift-storage
- quay-enterprise
- openshift-devspaces

# subscriptions: OpenShift Operator subscriptions from OLM/OperatorHub
# - name: the Operator package name (required)
Expand Down Expand Up @@ -44,13 +45,19 @@ clusterGroup:
namespace: openshift-operators
channel: stable-3.7

devspaces:
name: devspaces
namespace: openshift-operators
channel: stable

# The following section is used by
# OpenShift GitOps (ArgoCD)
# Projects are just ArgoCD groupings that can be filtered on.
projects:
- hub
- opp
- external-secrets
- devspaces

applications:
acm:
Expand Down Expand Up @@ -123,6 +130,12 @@ clusterGroup:
project: hub
path: charts/hub/cli-tools

devspaces:
name: devspaces
namespace: openshift-devspaces
project: devspaces
path: charts/hub/devspaces

imperative:
# NOTE: We *must* use lists and not hashes. As hashes lose ordering once parsed by helm
# The default schedule is every 10 minutes: imperative.schedule
Expand Down