codetogether-hq

by CodeTogther Inc.

Helm chartv1.4.20App 2024.1.0

CodeTogether HQ provides advanced project insights for developers

About this chart

README.md Helm Chart for CodeTogether HQ

CodeTogether HQ Chart (Legacy)

⚠️ Legacy Chart
This chart is now considered legacy and is not recommended for new deployments. Please use the codetogether-intel chart for configurations requiring hqproperties.hq.collab.*.

Summary

This chart creates a CodeTogether HQ server deployment on a Kubernetes cluster using the Helm package manager.

Prerequisites

This chart has been created with Helm v3 and tested with:

  • Kubernetes v1.18+
  • Helm v3.5+
  • Cassandra v3.11+

Configuration

The following table lists configurable parameters of the CodeTogether HQ chart and their default values:

ParameterDescriptionDefault
nameOverrideOverrides the name of the chart""
fullnameOverrideOverrides the full name of the chart""
image.repositoryDocker image repository for CodeTogether HQhub.edge.codetogether.com/releases/codetogether-hq
image.pullPolicyContainer image pull policyAlways
image.tagTag for the CodeTogether HQ imagelatest
imageCredentials.enabledEnables authentication for private Docker registrytrue
imageCredentials.registryDocker registry URLhub.edge.codetogether.com
imageCredentials.usernameDocker registry usernamemy-customer-username
imageCredentials.passwordDocker registry passwordmy-customer-password
imageCredentials.emailDocker registry emailunused
codetogether.urlFull URL for the CodeTogether HQ serverhttps://<server-fqdn>
hqproperties.hq.sso.client.idClient ID for Single Sign-On (SSO)CLIENTID.apps.googleusercontent.com
hqproperties.hq.sso.client.secretClient Secret for Single Sign-On (SSO)CLIENTSECRET
hqproperties.hq.sso.client.issuer.urlIssuer URL for Single Sign-On (SSO)https://accounts.google.com
hqproperties.name.attrName attribute for SSOname
hqproperties.hq.db.typeDatabase type for CodeTogether HQCASSANDRA
hqproperties.hq.secretSecret key for CodeTogether HQSECRET1
hqproperties.hq.encryption.secretEncryption secret key for CodeTogether HQSECRET2
hqproperties.hq.base.urlBase URL for CodeTogether HQhttps://<server-fqdn>
hqproperties.hq.cassandra.db.nameCassandra database namehq
hqproperties.hq.cassandra.db.portCassandra database port9042
hqproperties.hq.cassandra.db.hostCassandra database hostcodetogether-cassandra.default.svc.cluster.local
hqproperties.hq.sso.redirect.uriRedirect URI for SSOhttps://<server-fqdn>/api/v1/auth/sso/success/hq
hqproperties.hq.cassandra.db.passwordPassword for Cassandra databasecassandra
hqproperties.hq.cassandra.db.usernameUsername for Cassandra databasecassandra
hqproperties.hq.sso.role.mapping.claimSpecifies the claim in the SSO token containing user rolesroles
hqproperties.hq.sso.role.mappingsDefines the role mappings for CodeTogether HQcthq_user,project-manager[pm],system-admin[sa]
ingress.enabledEnables ingress controller resourcetrue
ingress.annotationsAnnotations for ingress{}
ingress.tls.secretNameTLS secret name for ingresscodetogether-hq-tls
service.typeKubernetes service typeClusterIP
service.portPort for CodeTogether HQ service1080
serviceAccount.createSpecifies whether a service account should be createdtrue
serviceAccount.nameName of the service accountcodetogether-hq
replicaCountNumber of replicas for CodeTogether HQ deployment1
readinessProbe.initialDelaySecondsInitial delay before readiness probe is initiated60
readinessProbe.periodSecondsPeriod between readiness probes60
readinessProbe.timeoutSecondsTimeout for readiness probes15
livenessProbe.initialDelaySecondsInitial delay before liveness probe is initiated60
livenessProbe.periodSecondsPeriod between liveness probes60
livenessProbe.timeoutSecondsTimeout for liveness probes15

Role Mappings Configuration

The following parameters are used to configure role mappings for the application:

  • hq.sso.role.mapping.claim: Specifies the claim name in the SSO (Single Sign-On) token that contains the user's roles. In this case, it is set to roles.

  • hq.sso.role.mappings: Defines the mappings for user roles in the system. The mappings are configured as follows:

    • cthq_user: Represents regular users with standard access to the system.
    • project-manager[pm]: Represents project managers, identified with the [pm] suffix, who have elevated permissions to manage project-specific operations.
    • system-admin[sa]: Represents system administrators, identified with the [sa] suffix, who have the highest level of access, including administrative privileges across the system.

These role mappings ensure that users are assigned appropriate permissions based on their roles, as provided by the SSO service. Proper configuration of these parameters is crucial for maintaining secure and role-based access control within the application.

Creating your Kubernetes Namespace for CodeTogether HQ

It is a best practice to create a dedicated namespace for CodeTogether HQ objects. To create a namespace:

$ kubectl create namespace codetogether-hq
$ kubectl config set-context --current --namespace=codetogether-hq

TLS

To secure CodeTogether, you can add a secret that contains your TLS (Transport Layer Security) private key and certificate:

$ kubectl create secret tls codetogether-hq-tls --key <your-private-key-filename> --cert <your-certificate-filename>

Installing the Chart

To install the chart with the release name codetogether-hq:

$ helm install codetogether-hq -f codetogether-values.yaml ./codetogether-hq

You can verify the deployment using:

$ helm list
$ kubectl get all -n codetogether-hq

Updating the Chart

To upgrade CodeTogether HQ to a newer version:

$ helm repo update
$ helm upgrade codetogether-hq -f codetogether-values.yaml ./codetogether-hq

Uninstalling the Chart

To uninstall the codetogether-hq release:

$ helm uninstall codetogether-hq

Deploy codetogether-hq with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has codetogether-hq on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartcodetogether-hq is pinned at v1.4.20 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply