Opstella Kubernetes Integration Installation
🟢 Management
Opstella Kubernetes Integration (ok8s-integration) is a Service for Opstella to perform Licensing System and Usages Collection.
Application Dependencies
Section titled “Application Dependencies”- 📦PostgreSQL-based Datastore ; Deploy external/dedicated instance of Database
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_INGRESSCLASS_NAME,K8S_STORAGECLASS_NAMEare defined as per the Shell Variables guide.
Opstella Kubernetes Integration Datastore Preparation
Section titled “Opstella Kubernetes Integration Datastore Preparation”-
Create PostgreSQL Initial Admin Credentials with Kubernetes Secret
- Username:
postgres(Default Admin of PostgreSQL) - Password:
CHANGEME; NOTE: Only Allowed Special Characters are!-_=+?@
export OK8S_INTGR_POSTGRES_SUPERUSER_PASSWORD="CHANGEME"export OK8S_INTGR_POSTGRES_USER_PASSWORD="CHANGEME" - Username:
-
Provision PostgreSQL for Opstella Kubernetes Integration Datastore
The following manifest defines the entire PostgreSQL system using CloudNativePG, including credentials and the cluster.
Terminal window cat <<EOF > $HOME/opstella-installation/kubernetes-manifests/ok8s-integration-postgres.yaml---# Postgres Superuser (root) CredentialsapiVersion: v1kind: Secrettype: kubernetes.io/basic-authmetadata:name: ok8s-integration-postgres-superusernamespace: opstella-systemstringData:username: postgrespassword: "${OK8S_INTGR_POSTGRES_SUPERUSER_PASSWORD}"---# ok8s-integration Application User CredentialsapiVersion: v1kind: Secrettype: kubernetes.io/basic-authmetadata:name: ok8s-integration-postgres-usernamespace: opstella-systemstringData:username: ok8s_intergration_userpassword: "${OK8S_INTGR_POSTGRES_USER_PASSWORD}"---apiVersion: postgresql.cnpg.io/v1kind: Clustermetadata:name: ok8s-integration-postgresnamespace: opstella-systemlabels:app.kubernetes.io/name: ok8s-integration-postgresapp.kubernetes.io/part-of: opstella-platformspec:instances: 1# Image configuration (Postgres 15)imageName: ghcr.io/cloudnative-pg/postgresql:15# Storage Configurationstorage:size: 2GistorageClass: "${K8S_STORAGECLASS_NAME}"walStorage:size: 1GistorageClass: "${K8S_STORAGECLASS_NAME}"# Bootstrap Configurationbootstrap:initdb:database: ok8s_intergrationowner: ok8s_intergration_user# Secret containing password for the Application Usersecret:name: ok8s-integration-postgres-user# Superuser credentials (root/postgres)superuserSecret:name: ok8s-integration-postgres-superuser# Monitoring (disabled for now)monitoring:enablePodMonitor: false# Resourcesresources:requests:memory: "128Mi"cpu: "100m"limits:memory: "512Mi"cpu: "500m"EOFApply the configuration:
Terminal window kubectl apply -f ok8s-integration-postgres.yaml💡 Should return
secret/ok8s-integration-postgres-superuser,secret/ok8s-integration-postgres-user, andcluster.postgresql.cnpg.io/ok8s-integration-postgrescreated messages.
Opstella Kubernetes Integration Preparation
Section titled “Opstella Kubernetes Integration Preparation”-
Prepare Helm Values Configurations.
-
image.repository,image.tag: Set your Opstella Kubernetes Integration Container Image Location, Versionexport OPSTELLA_REGISTRY="asia-southeast1-docker.pkg.dev/opstella/platform/core-license"export OPSTELLA_REGISTRY="${HARBOR_DOMAIN}/opstella-platform/core-license"export OPSTELLA_OK8S_VERSION="vX.Y.Z" -
Datastore for Opstella Kubernetes Integration Information
(DO NOT CHANGE, unless you understand what it is.)
export OK8S_INTGR_DATASTORE_HOST="ok8s-integration-postgres-rw.opstella-system.svc"export OK8S_INTGR_DATASTORE_PORT="5432"export OK8S_INTGR_DATASTORE_DB_NAME="ok8s_intergration"export OK8S_INTGR_DATASTORE_USERNAME="ok8s_intergration_user"export OK8S_INTGR_DATASTORE_PASSWORD="${OK8S_INTGR_POSTGRES_USER_PASSWORD}" -
Opstella Core Kubernetes Namespace
(DO NOT CHANGE, unless you understand what it is.)
export OK8S_INTGR_OPSTELLA_SYSTEM_NAMESPACE="opstella-system"
-
-
Create Helm Values Configuration.
Terminal window cat <<EOF > $HOME/opstella-installation/helm-values/ok8s-integration-full-values.yamlimage:repository: ${OPSTELLA_REGISTRY}tag: ${OPSTELLA_OK8S_VERSION}pullPolicy: Alwaysresources: {}imagePullSecrets:- registry-secretpodAnnotations:dapr.io/enabled: "true"dapr.io/app-id: "core-license"dapr.io/app-port: "3000"dapr.io/enable-api-logging: "true"dapr.io/config: "config"dapr.io/sidecar-seccomp-profile-type: "RuntimeDefault"containerPort: 3000vars:INVOKE_URL: http://localhost:3500/v1.0/invoke/opstella-core.${OK8S_INTGR_OPSTELLA_SYSTEM_NAMESPACE}/methodDB_HOST: "${OK8S_INTGR_DATASTORE_HOST}"DB_PORT: "${OK8S_INTGR_DATASTORE_PORT}"DB_NAME: "${OK8S_INTGR_DATASTORE_DB_NAME}"DB_USERNAME: "${OK8S_INTGR_DATASTORE_USERNAME}"DB_PASSWORD: "${OK8S_INTGR_DATASTORE_PASSWORD}"## ReadinessProbeprobe:enabled: truepath: "/"settings:initialDelaySeconds: 10periodSeconds: 60successThreshold: 1timeoutSeconds: 3failureThreshold: 3# Before you use a liveness probe: https://srcco.de/posts/kubernetes-liveness-probes-are-dangerous.htmllivenessProbe:enabled: truepath: "/healthcheck"settings:initialDelaySeconds: 30periodSeconds: 60successThreshold: 1timeoutSeconds: 3failureThreshold: 3volumes:- name: ok8s-integration-infoexistingSecret: ok8s-integration-infopath: /app/configpodSecurityContext:fsGroup: 1000securityContext:seccompProfile:type: RuntimeDefaultcapabilities:drop: ["ALL"]runAsNonRoot: trueprivileged: falseallowPrivilegeEscalation: falserunAsGroup: 1000runAsUser: 1000EOF
Install Dapr Components CRDs
Section titled “Install Dapr Components CRDs”-
Create Cron Bindings
Terminal window kubectl apply --namespace opstella-system -f - <<EOFapiVersion: dapr.io/v1alpha1kind: Componentspec:type: bindings.cronversion: v1metadata:- name: schedulevalue: "5 * * * *"- name: routevalue: "/api/collect-data"- name: methodvalue: POSTscopes:- core-licensemetadata:name: cronjob-collect-dataEOF
Installation
Section titled “Installation”-
Install Opstella Kubernetes Integration.
Install Helm Release using
onechartHelm Chart with specific Helm Chart Version--version 0.73.0Terminal window helm upgrade --install ok8s-integration \oci://ghcr.io/gimlet-io/onechart --version 0.73.0 \--namespace opstella-system \-f $HOME/opstella-installation/helm-values/ok8s-integration-full-values.yaml
Post-Installation
Section titled “Post-Installation”Opstella Kubernetes Integration Testing
Section titled “Opstella Kubernetes Integration Testing”-
Get Pod Status - Opstella Kubernetes Integration and its Datastore Service
Terminal window kubectl get pods -n opstella-systemOpstella Kubernetes Integration and its Datastore Service should be
RunningNAME READY STATUS RESTARTS AGE... (deducted)ok8s-integration-XXXXXXX-YYYYY 1/1 Running 0 XdXhok8s-integration-postgres-1 1/1 Running 0 XdXh
Finished?
Use the below navigation to proceed