All pages
Powered by GitBook
1 of 1

Loading...

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.

  1. Install Seldon Enterprise Platform.

  2. Install Ingress Controller.

  3. Install Git.

Installing PostgreSQL in a Kubernetes cluster

  1. Clone the Zalando operator repository in your computer.

  2. Change to the postgres-operatordirectory.

  3. Create a namespace where you want to install PostgreSQL. For example the name space postgres:

  4. Install PostgreSQL using the Helm charts.

  1. Get the Pod that is running Seldon Enterprise Platform in the cluster and save it as $POD_NAME.

  1. You can use port-forwarding to access your application locally.

  1. Open your browser and navigate to http://127.0.0.1:8000/seldon-deploy/ to access Seldon Enterprise Platform.

You may now explore the feature in Seldon Enterprise Platform.

After a successful installation, you should see::

  • To install a minimal PostgreSQL setup in the Kubernetes cluster, execute the following:

    If you would like to install a more complex setup with additional users, databases, replicas, and others see the of Zalando operator.

  • Verify if the postgres-operator Pod is running.

  • Create the required secret using the auto-generated password:

    After a successful configuration, you should see: secret/metadata-postgres configured

  • View the password that you created to access PostgreSQL database:

  • After the PostgreSQL database and secrets with credentials are ready, add the following to your install-values.yamlfile.

  • Change to the directory that contains the install-values.yaml file and then upgrade the Seldon Enterprise Platform installation in the namespace seldon-system.

  • Check the status of the installation seldon-enterprise-seldon-deploy.

    When the installation is complete you should see this:

  • Access Seldon Enterprise Platform.

    1. Find the IP address of the Seldon Enterprise Platform instance running with Istio:

    1. Open your browser and navigate to http://$ISTIO_INGRESS/seldon-deploy/ to access Seldon Enterprise Platform. Where $ISTIO_INGRESS is the IP address of Seldon Enterprise Platform.

    git clone https://github.com/zalando/postgres-operator.git
    cd postgres-operator
    kubectl create namespace postgres || echo "namespace postgres exists"
    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}")
    kubectl port-forward $POD_NAME 8000:8000 --namespace seldon-system

    Next

    Model Catalog
    official documentation
    helm install postgres-operator ./charts/postgres-operator --namespace   postgres
    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"
    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"
    EOF
    kubectl --namespace=postgres get pods -l "app.kubernetes.io/name=postgres-operator"
    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_pass
    kubectl get secret metadata-postgres -n seldon-system -o 'jsonpath={.data.password}' | base64 -d  
    metadata:
      pg:
       enabled: true
       secret: metadata-postgres
       clientTLSSecret: "postgres-client-certs"  # Optional, only needed for SSL verification
    helm upgrade seldon-enterprise seldon-charts/seldon-deploy --namespace seldon-system -f install-values.yaml --version 2.4.0 --install
    kubectl rollout status deployment/seldon-enterprise-seldon-deploy -n seldon-system
    deployment "seldon-enterprise-seldon-deploy" successfully rolled out
    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/"