Self-hosted PostgreSQL
Installing PostgreSQL in the same Kubernetes cluster that hosts the Seldon Enterprise Platform.You can run PostgreSQL in the same Kubernetes cluster that hosts the Seldon Enterprise Platform. We recommend using the Zalando PostgreSQL operator for managing PostgreSQL installation and maintenance. Refer to their installation matrix for details about the supported PostgreSQL releases.
Install Seldon Enterprise Platform.
Install Ingress Controller.
Install Git.
Installing PostgreSQL in a Kubernetes cluster
Clone the Zalando operator repository in your computer.
git clone https://github.com/zalando/postgres-operator.gitChange to the
postgres-operatordirectory.cd postgres-operatorCreate a namespace where you want to install PostgreSQL. For example the name space
postgres:kubectl create namespace postgres || echo "namespace postgres exists"Install PostgreSQL using the Helm charts.
helm install postgres-operator ./charts/postgres-operator --namespace postgresAfter a successful installation, you should see::
NAME: postgres-operator LAST DEPLOYED: Tue Aug 13 15:22:02 2024 NAMESPACE: postgres STATUS: deployed REVISION: 1 TEST SUITE: None NOTES: To verify that postgres-operator has started, run: kubectl --namespace=postgres get pods -l "app.kubernetes.io/name=postgres-operator"To install a minimal PostgreSQL setup in the Kubernetes cluster, execute the following:
cat << EOF | kubectl apply -f - apiVersion: "acid.zalan.do/v1" kind: postgresql metadata: name: seldon-metadata-storage namespace: postgres spec: teamId: "seldon" volume: size: 5Gi numberOfInstances: 2 users: seldon: # database owner - superuser - createdb databases: metadata: seldon # dbname: owner postgresql: version: "15" EOFIf you would like to install a more complex setup with additional users, databases, replicas, and others see the official documentation of Zalando operator.
Verify if the
postgres-operatorPod is running.kubectl --namespace=postgres get pods -l "app.kubernetes.io/name=postgres-operator"Create the required secret using the auto-generated password:
kubectl get secret seldon.seldon-metadata-storage.credentials.postgresql.acid.zalan.do -n postgres -o 'jsonpath={.data.password}' | base64 -d > db_pass kubectl create secret generic -n seldon-system metadata-postgres \ --from-literal=user=seldon \ --from-file=password=./db_pass \ --from-literal=host=seldon-metadata-storage.postgres.svc.cluster.local \ --from-literal=port=5432 \ --from-literal=dbname=metadata \ --from-literal=sslmode=require \ --dry-run=client -o yaml \ | kubectl apply -n seldon-system -f - rm db_passAfter a successful configuration, you should see:
secret/metadata-postgres configuredView the password that you created to access PostgreSQL database:
kubectl get secret metadata-postgres -n seldon-system -o 'jsonpath={.data.password}' | base64 -dAfter the PostgreSQL database and secrets with credentials are ready, add the following to your
install-values.yamlfile.metadata: pg: enabled: true secret: metadata-postgres clientTLSSecret: "postgres-client-certs" # Optional, only needed for SSL verificationChange to the directory that contains the
install-values.yamlfile and then upgrade the Seldon Enterprise Platform installation in the namespaceseldon-system.helm upgrade seldon-enterprise seldon-charts/seldon-deploy --namespace seldon-system -f install-values.yaml --version 2.4.0 --installCheck the status of the installation
seldon-enterprise-seldon-deploy.kubectl rollout status deployment/seldon-enterprise-seldon-deploy -n seldon-systemWhen the installation is complete you should see this:
deployment "seldon-enterprise-seldon-deploy" successfully rolled outAccess Seldon Enterprise Platform.
Get the Pod that is running Seldon Enterprise Platform in the cluster and save it as
$POD_NAME.
export POD_NAME=$(kubectl get pods --namespace seldon-system -l "app.kubernetes.io/name=seldon-deploy,app.kubernetes.io/instance=seldon-enterprise" -o jsonpath="{.items[0].metadata.name}")You can use port-forwarding to access your application locally.
kubectl port-forward $POD_NAME 8000:8000 --namespace seldon-systemOpen your browser and navigate to
http://127.0.0.1:8000/seldon-deploy/to access Seldon Enterprise Platform.
Find the IP address of the Seldon Enterprise Platform instance running with Istio:
ISTIO_INGRESS=$(kubectl get svc -n istio-system istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
ISTIO_INGRESS+=$(kubectl get svc -n istio-system istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')
echo "Seldon Enterprise Platform: http://$ISTIO_INGRESS/seldon-deploy/"
Open your browser and navigate to
http://$ISTIO_INGRESS/seldon-deploy/to access Seldon Enterprise Platform. Where$ISTIO_INGRESSis the IP address of Seldon Enterprise Platform.
Next
You may now explore the Model Catalog feature in Seldon Enterprise Platform.
Last updated
Was this helpful?