Commit ec875ed9 authored by George Papathanail's avatar George Papathanail
Browse files

Add helm folder with charts

parent 1aa166a5
Loading
Loading
Loading
Loading
+34 −0
Original line number Diff line number Diff line
# 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/
# CI/CD
.gitlab-ci.yml
.travis.yml
.circleci/
# Documentation
README.md
CONTRIBUTING.md
LICENSE
# Test files
*_test.yaml
test/
+15 −0
Original line number Diff line number Diff line
apiVersion: v2
name: oeg
description: A Helm chart for OEG Controller with MongoDB
type: application
version: 1.0.0
appVersion: "1.0.1"
keywords:
  - oeg
  - mongodb
  - controller
maintainers:
  - name: DevOps Team
home: https://github.com/sunriseopenoperatorplatform/oeg
sources:
  - https://github.com/sunriseopenoperatorplatform/oeg
+65 −0
Original line number Diff line number Diff line
# Helm Charts for Sunrise 6G Platform

This directory contains Helm charts for deploying the Sunrise 6G platform components.

## Charts


- **oeg-chart**: Operator Edge Gateway with MongoDB

## Quick Start

### Prerequisites

- Kubernetes cluster (MicroK8s, kind, k3s, etc.)
- Helm 3.x
- kubectl configured

### Installation

#### 1. Clone the repository
```bash
git clone https://labs.etsi.org/rep/oop/code/open-exposure-gateway.git
cd open-exposure-gateway/helm-charts
```

#### 2. Prepare environment
```bash
# Create namespace
kubectl create namespace oop

# Create storage directories
sudo mkdir -p /mnt/data/mongodb_srm /mnt/data/mongodb_oeg
sudo chmod 777 /mnt/data/mongodb_srm /mnt/data/mongodb_oeg

# Create service account and get token
kubectl create serviceaccount sunrise-user -n oop
kubectl create clusterrolebinding sunrise-user-binding \
  --clusterrole=cluster-admin \
  --serviceaccount=oop:oop-user

# Get token
```bash
kubectl create token oop-user -n oop --duration=87600h



#### 3. Deploy
```bash

# Install OEG
helm install oeg ./oeg-chart -n oop
```

#### 4. Verify
```bash
kubectl get pods -n oop
kubectl get svc -n oop
```

## Configuration

See individual chart READMEs for detailed configuration:
- [SRM Chart Configuration](./srm-chart/README.md)
- [OEG Chart Configuration](./oeg-chart/README.md)
+46 −0
Original line number Diff line number Diff line
Thank you for installing {{ .Chart.Name }}!

Your release is named {{ .Release.Name }}.

To learn more about the release, try:

  $ helm status {{ .Release.Name }} -n {{ include "oeg.namespace" . }}
  $ helm get all {{ .Release.Name }} -n {{ include "oeg.namespace" . }}

{{- if .Values.oegcontroller.enabled }}

OEG Controller has been deployed successfully!

1. Get the application URL:
{{- if .Values.ingress.enabled }}
  http://{{ .Values.ingress.host }}{{ .Values.ingress.path }}
{{- else if contains "NodePort" .Values.oegcontroller.service.type }}
  export NODE_PORT=$(kubectl get --namespace {{ include "oeg.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ .Values.oegcontroller.service.name }})
  export NODE_IP=$(kubectl get nodes --namespace {{ include "oeg.namespace" . }} -o jsonpath="{.items[0].status.addresses[0].address}")
  echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.oegcontroller.service.type }}
  NOTE: It may take a few minutes for the LoadBalancer IP to be available.
        Watch the status with: kubectl get svc --namespace {{ include "oeg.namespace" . }} -w {{ .Values.oegcontroller.service.name }}
  export SERVICE_IP=$(kubectl get svc --namespace {{ include "oeg.namespace" . }} {{ .Values.oegcontroller.service.name }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
  echo http://$SERVICE_IP:{{ .Values.oegcontroller.service.port }}
{{- else if contains "ClusterIP" .Values.oegcontroller.service.type }}
  kubectl port-forward --namespace {{ include "oeg.namespace" . }} svc/{{ .Values.oegcontroller.service.name }} 8080:{{ .Values.oegcontroller.service.port }}
  echo "Visit http://127.0.0.1:8080 to access your application"
{{- end }}

2. Check the pods status:
  kubectl get pods -n {{ include "oeg.namespace" . }} -l app.kubernetes.io/instance={{ .Release.Name }}

{{- end }}

{{- if .Values.mongodb.enabled }}

3. MongoDB is running at:
  Service: {{ .Values.mongodb.name }}.{{ include "oeg.namespace" . }}.svc.cluster.local:{{ .Values.mongodb.service.port }}
  
  To connect to MongoDB from within the cluster:
  kubectl run -it --rm --image=mongo:latest --restart=Never mongo-client -- mongo {{ .Values.mongodb.name }}.{{ include "oeg.namespace" . }}.svc.cluster.local:{{ .Values.mongodb.service.port }}

{{- end }}

For more information, visit the documentation or check the project repository.
+106 −0
Original line number Diff line number Diff line
{{/*
Expand the name of the chart.
*/}}
{{- define "oeg.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
*/}}
{{- define "oeg.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 "oeg.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

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

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

{{/*
MongoDB labels
*/}}
{{- define "oeg.mongodb.labels" -}}
helm.sh/chart: {{ include "oeg.chart" . }}
{{ include "oeg.mongodb.selectorLabels" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
MongoDB selector labels
*/}}
{{- define "oeg.mongodb.selectorLabels" -}}
app.kubernetes.io/name: {{ .Values.mongodb.name }}
app.kubernetes.io/instance: {{ .Release.Name }}
io.kompose.service: {{ .Values.mongodb.name }}
{{- end }}

{{/*
OEG Controller labels
*/}}
{{- define "oeg.controller.labels" -}}
helm.sh/chart: {{ include "oeg.chart" . }}
{{ include "oeg.controller.selectorLabels" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
OEG Controller selector labels
*/}}
{{- define "oeg.controller.selectorLabels" -}}
app.kubernetes.io/name: {{ .Values.oegcontroller.name }}
app.kubernetes.io/instance: {{ .Release.Name }}
io.kompose.service: {{ .Values.oegcontroller.name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "oeg.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "oeg.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Return the proper namespace
*/}}
{{- define "oeg.namespace" -}}
{{- default .Release.Namespace .Values.global.namespace }}
{{- end }}
Loading