Zum Inhalt

The Developer Workspace

Prerequisites

Workspace Setup

Take the sample YAML configuration and modify it:

  • Look up the release name of your helm release and add it to use CRD as "release" under spec
  • Enter your SSH public key, email, name and the desired container image
  • Save your customized YAML configuration somewhere. Keep it for future reference.
  • Open the Kubernetes console and add the CRD

Sample YAML to create a developer workspace

apiVersion: xrow.com/v1
kind: Developer
metadata:
  name: developer01
  namespace: ibexa-test
spec:
  release: ibexa
  key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOXGvbBWWfPKoMEU8zKMaKGLocGLVMAq4K24UZMyzjmc"
  email: "bjoern@xrow.de"
  name: "Björn Dieding"
  image: 
    registry: registry.gitlab.com
    repository: xrow-shared/helm-ezplatform/ibexa-oss/dev
    tag: latest
  env:
    - name: APP_ENV
      value: dev
    - name: APP_DEBUG
      value: 1

Port Forward to your local maschine

kubectl config use-context 08.xrow.net
kubectl config set-context --current --namespace=project-test 
kubectl port-forward service/bjoern-developer 2222:2222 &
kubectl port-forward service/bjoern-developer 8080:8080 &
kubectl port-forward service/bjoern-developer 8443:8443 &
kubectl port-forward service/$(kubectl get service | grep solr | awk '{print $1}') 8983:8983 &
kubectl port-forward service/$(kubectl get service | grep mysql | awk '{print $1}') 3306:3306 &

Alternativly you can forward with a tool like kubefwd

Connect to the Pod / development environment via an SSH Agent

Linux: Connect via SSH

[root@host ~]# ssh root@127.0.0.1 -p 2222 -A
Last login: Tue Feb 18 00:37:33 2020 from 10.128.0.1
Hi Björn Dieding <bjoern@xrow.de>, you can start coding
-bash-4.2$ ssh -T git@gitlab.com
Warning: Permanently added 'gitlab.com,35.231.145.151' (ECDSA) to the list of known hosts.
Welcome to GitLab, @xrow!

Connect via VS CODE

  • Use the vscode kubernetes extension
  • Select the desired SVC or POD and select forward all

Start to code

  • Start additional tools needed for development
yarn install
$(yarn bin)/encore dev-server --host 0.0.0.0 --port 9000 --config-name ibexa --allowed-hosts 192.168.222.2 --public http://192.168.222.2:9000/
  • Modify any file and commit to git.

Letztes Update: March 2, 2023