Opstella Core (Back-end) Installation
🟢 Management
Opstella Core is a Backend Service for Opstella to centralize information and orchestrate operations.
Application Dependencies
Section titled “Application Dependencies”- 📦PostgreSQL SQL Database ; Deploy external/dedicated instance of Database
- 📦S3 API-compatible Object Storage ; i.e
MinIO - 📦Opstella Keycloak ; For Single Sign-on Functionality
Prerequisites
Section titled “Prerequisites”- 🛡️TLS Certificate for Opstella Core (Back-end)
- Opstella Core (Back-end) will be exposed through Web with HTTPS.
- 🔑 Credentials to Access S3 Bucket: Access Key, Secret Key
- These credentials should be from the ones you defined in the SeaweedFS (HA) Installation guide (specifically
SEAWEEDFS_HA_S3_OPSTELLA_PASSWORDas the secret andopstellaas the access key).
- These credentials should be from the ones you defined in the SeaweedFS (HA) Installation guide (specifically
Preparation
Section titled “Preparation”Kubernetes Cluster Preparation
Section titled “Kubernetes Cluster Preparation”-
Connect to
🟢 ManagementKubernetes Cluster ; i.e w/ Kubeconfig FileEnsure you have defined and loaded your Global Shell Variables as described in Shell Variables.
Terminal window source $HOME/opstella-installation/shell-values/kubernetes/management_cluster.vars.shTerminal window export KUBECONFIG="$HOME/opstella-installation/kubeconfigs/management_cluster.yaml" -
Prepare
🟢 ManagementKubernetes Cluster InformationEnsure
K8S_INTERNAL_DOMAIN,K8S_INGRESS_TLS_CERTIFICATE_SECRET_NAME,K8S_INGRESSCLASS_NAMEare defined as per the Shell Variables guide.
Opstella Core Preparation
Section titled “Opstella Core Preparation”-
Create a credentials for Opstella Core Configuration Admin Panel.
- Admin Username:
admin(Cannot be changed) - Admin Password:
CHANGEME
export OPSTELLA_CORE_ADMIN_PASSWORD="CHANGEME"Terminal window kubectl create secret generic opstella-core-init-credentials --namespace opstella-system \--from-literal=ADMIN_USER=admin --from-literal=ADMIN_PASSWORD=${OPSTELLA_CORE_ADMIN_PASSWORD} - Admin Username:
-
Prepare Opstella Core Initialisation Script.
Ensure
ORGANIZATION_NAMEandBASE_DOMAINare defined as per the Shell Variables guide.Set Opstella Company Admin Email
💡 It should be the same as
opstellauser from Keycloak User creation. Opstella Keycloak - Initial Configurations/Setup Opstella Administrator User AccountTerminal window export OPSTELLA_ADMIN_EMAIL="opstella-admin@${BASE_DOMAIN}" -
Create Opstella Core Initialisation Script followed to preparations.
Create a Copy of Opstella Core Initialisation Script.
Terminal window cp $HOME/opstella-installation/assets/scripts/opstella-core-init.sh $HOME/opstella-installation/opstella-configs/opstella-core-init.shEdit the copied file to put your information.
Terminal window sed -i "s#\${OPSTELLA_COMPANY_DOMAIN}#$ORGANIZATION_NAME#g" $HOME/opstella-installation/opstella-configs/opstella-core-init.shsed -i "s#\${OPSTELLA_COMPANY_SLUG}#$ORGANIZATION_NAME#g" $HOME/opstella-installation/opstella-configs/opstella-core-init.shsed -i "s#\${OPSTELLA_ADMIN_EMAIL}#$OPSTELLA_ADMIN_EMAIL#g" $HOME/opstella-installation/opstella-configs/opstella-core-init.shCreate Kubernetes ConfigMap
Terminal window kubectl create configmap opstella-core-init-script-cm --namespace opstella-system \--from-file=opstella-core-init.sh=$HOME/opstella-installation/opstella-configs/opstella-core-init.sh -
Deploy Opstella Initial License New
Create Kubernetes Secret named
opstella-core-init-licenseMake sure that data is ENCODED in Base64
Terminal window kubectl create secret generic opstella-core-init-license --namespace opstella-system \--from-literal=config.txt=$(cat $HOME/opstella-installation/opstella-configs/opstella-core-init-license.txt | base64 -w0) -
Prepare Helm Values Configurations.
Please give attention to these values:
-
Application Configurations
-
image.repository,image.tag: Set your Opstella Platform Container Image Location, Versionexport OPSTELLA_REGISTRY="asia-southeast1-docker.pkg.dev/opstella/platform/core"export OPSTELLA_REGISTRY="${HARBOR_DOMAIN}/opstella-platform/core"export OPSTELLA_CORE_VERSION="vX.Y.Z" -
CORS allowance ; Allowed though using base domain with wildcard
*.${BASE_DOMAIN}(DO NOT CHANGE, unless you understand what it is.)
export OPSTELLA_CORE_CSRF_TRUSTED_ORIGINS="https://*.${BASE_DOMAIN}" -
Access to Opstella Core with Domain
export OPSTELLA_CORE_DOMAIN="opstella-backend.${BASE_DOMAIN}"
-
-
Database Configurations ; Relate to PostgreSQL for Opstella Platform
-
Pre-populated with default assumptions (using the previously deployed PostgreSQL)
export OPSTELLA_CORE_DATABASE_PASSWORD="CHANGEME"(DO NOT CHANGE, unless you understand what it is.)
export OPSTELLA_CORE_DATABASE_HOST="opstella-postgres-rw.opstella-system.svc"export OPSTELLA_CORE_DATABASE_PORT="5432"export OPSTELLA_CORE_DATABASE_DB_NAME="opstella_platform"export OPSTELLA_CORE_DATABASE_USERNAME="opstella_platform_user"
-
-
Opstella Keycloak Service Configurations ; Relate to Keycloak
KEYCLOAK_DOMAIN: Domain for access to KeycloakKEYCLOAK_REALM: Keycloak Realm
Ensure
KEYCLOAK_DOMAIN,KEYCLOAK_REALM,BASE_DOMAINare defined as per the Shell Variables guide.-
Object Storage Configurations ; Connects to S3(-compatible) Object Storage
-
OPSTELLA_CORE_S3_DOMAIN: Connect to S3(-compatible) Object Storage API Domainexport OPSTELLA_CORE_S3_DOMAIN="seaweedfs-api.${BASE_DOMAIN}"export OPSTELLA_CORE_S3_ADDRESSING_STYLE="path"export OPSTELLA_CORE_S3_BUCKET_NAME="opstella-web"export OPSTELLA_CORE_S3_BUCKET_REGION="us-east-1"export OPSTELLA_CORE_S3_ACCESS_KEY="opstella"export OPSTELLA_CORE_S3_ACCESS_SECRET="${SEAWEEDFS_HA_S3_OPSTELLA_PASSWORD}"
-
-
Opstella License Agent Host
(DO NOT CHANGE, unless you understand what it is.)
export OPSTELLA_CORE_LICENSE_SERVICE_HOST="ok8s-integration.opstella-system.svc.${K8S_INTERNAL_DOMAIN}"
-
-
Prepare Helm Values Configurations.
Terminal window cat <<EOF > $HOME/opstella-installation/helm-values/opstella-core-full-values.yamlimage:repository: ${OPSTELLA_REGISTRY}tag: ${OPSTELLA_CORE_VERSION}pullPolicy: AlwaysnameOverride: opstella-corefullnameOverride: opstella-coreserviceAccount:name:imagePullSecrets:- name: registry-secretingress:enabled: trueclassName: ${K8S_INGRESSCLASS_NAME}annotations:nginx.ingress.kubernetes.io/proxy-body-size: 100Mhosts:- host: ${OPSTELLA_CORE_DOMAIN}paths:- path: /pathType: Prefixbackend:servicePort: 8000tls:- hosts:- ${OPSTELLA_CORE_DOMAIN}secretName: ${K8S_INGRESS_TLS_CERTIFICATE_SECRET_NAME}containerPorts: 8000healthCheck:enabled: trueliveness:httpGet:path: "/healthcheck"port: 8000initialDelaySeconds: 180periodSeconds: 30readiness:httpGet:path: "/"port: 8000initialDelaySeconds: 20periodSeconds: 10service:port: 8000env:# License System- name: LS_URLvalue: http://${OPSTELLA_CORE_LICENSE_SERVICE_HOST}:3000- name: LS_NSvalue: opstella-system# Django Configurations- name: CREATE_OTHER_USER_WITHOUT_OPSTELLAvalue: "true"- name: CSRF_TRUSTED_ORIGINSvalue: "${OPSTELLA_CORE_CSRF_TRUSTED_ORIGINS}"# PostgreSQL Database- name: POSTGRES_HOSTvalue: ${OPSTELLA_CORE_DATABASE_HOST}- name: POSTGRES_PORTvalue: "${OPSTELLA_CORE_DATABASE_PORT}"- name: POSTGRES_NAMEvalue: ${OPSTELLA_CORE_DATABASE_DB_NAME}- name: POSTGRES_USERvalue: ${OPSTELLA_CORE_DATABASE_USERNAME}- name: POSTGRES_PASSWORDvalue: ${OPSTELLA_CORE_DATABASE_PASSWORD}# S3(-compatible/MinIO) Object Storage- name: AWS_S3_ENDPOINT_URLvalue: https://${OPSTELLA_CORE_S3_DOMAIN}- name: AWS_S3_ADDRESSING_STYLEvalue: ${OPSTELLA_CORE_S3_ADDRESSING_STYLE}- name: AWS_STORAGE_BUCKET_NAMEvalue: ${OPSTELLA_CORE_S3_BUCKET_NAME}- name: AWS_S3_REGION_NAMEvalue: ${OPSTELLA_CORE_S3_BUCKET_REGION}- name: AWS_ACCESS_KEY_IDvalue: ${OPSTELLA_CORE_S3_ACCESS_KEY}- name: AWS_SECRET_ACCESS_KEYvalue: ${OPSTELLA_CORE_S3_ACCESS_SECRET}# Identity Service- name: KEYCLOAK_SERVER_URLvalue: https://${KEYCLOAK_DOMAIN}/- name: KEYCLOAK_REALMvalue: ${KEYCLOAK_REALM}podAnnotations:dapr.io/enabled: "true"dapr.io/app-id: "opstella-core"dapr.io/app-port: "8000"dapr.io/enable-api-logging: "true"dapr.io/config: "config"dapr.io/sidecar-seccomp-profile-type: "RuntimeDefault"volumes: truevolumesConfigMap:- name: init-scriptconfigMap:name: opstella-core-init-script-cmdefaultMode: "0770"- name: gitlab-configsconfigMap:name: opstella-core-gitlab-configsdefaultMode: "0770"volumesSecret:- name: opstella-core-init-licensesecret:secretName: opstella-core-init-licenseoptional: truevolumeMounts:- name: opstella-core-init-licensemountPath: /usr/src/app/config/config.txtsubPath: config.txt- name: init-scriptmountPath: /docker-entrypoint.d- name: gitlab-configsmountPath: /usr/src/config/envFrom:secrets:- opstella-core-init-credentialscommand:- /bin/sh- -c- /docker-entrypoint.d/opstella-core-init.sh && gunicorn opstella.wsgi -b 0.0.0.0:8000 --workers=3 --threads=2 --timeout=300podSecurityContext:fsGroup: 1000securityContext:seccompProfile:type: RuntimeDefaultcapabilities:drop: ["ALL"]runAsNonRoot: trueprivileged: falseallowPrivilegeEscalation: falserunAsGroup: 1000runAsUser: 1000EOF
Installation
Section titled “Installation”-
Install Opstella Core.
Install Helm Release using local
opstella-platformHelm ChartTerminal window helm upgrade --install opstella-core \$HOME/opstella-installation/helm-charts/opstella-platform-chart \--namespace opstella-system \-f $HOME/opstella-installation/helm-values/opstella-core-full-values.yaml
Post-Installation
Section titled “Post-Installation”Opstella Core Testing
Section titled “Opstella Core Testing”-
Get Pod Status - Opstella Core
Terminal window kubectl get pods -n opstella-systemOpstella Core should be
RunningNAME READY STATUS RESTARTS AGE... (deducted)opstella-core-XXXXXXX-YYYYY 1/1 Running 0 XdXh
Finished?
Use the below navigation to proceed