Products | Versions |
---|---|
TIBCO Streaming | 10.6 and later |
In some cases, it may be desirable to deploy both your AMS server and its PostgreSQL database (which is used to persist AMS user/role/artifact details) in the same Kubernetes cluster. This can often be useful during initial testing of your AMS configuration, where you may need to repeatedly drop and re-create the PostgreSQL database between tests. Follow the steps below to configure your AMS server application to interact with your PostgreSQL database server in a Kubernetes environment.
helm install ams-db bitnami/postgresql --set auth.postgresPassword="P@ssw0rd!" --set auth.database="ams"
Database { databaseType = "${ams.Database.databaseType:-POSTGRES}" hostPort = "${ams.Database.hostPort:-ams-db-postgresql:5432}" databaseName = "${ams.Database.databaseName:-ams}" userName = "${ams.Database.userName:-postgres}" password = "${ams.Database.password:-P@ssw0rd!}" }
mvn clean install
kubectl apply -f - <<! apiVersion: apps/v1 kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: name: service-update rules: - apiGroups: [""] resources: ["services", "pods"] verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] --- apiVersion: apps/v1 kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: name: service-update subjects: - kind: User name: system:serviceaccount:default:default apiGroup: rbac.authorization.k8s.io roleRef: kind: ClusterRole name: service-update apiGroup: rbac.authorization.k8s.io --- apiVersion: apps/v1 kind: Deployment metadata: name: ams-app-deployment labels: app: ams spec: replicas: 1 selector: matchLabels: app: ams template: metadata: labels: app: ams spec: containers: - name: ams-app image: tibco/ams:1.6.4 ports: - containerPort: 2185 --- apiVersion: apps/v1 kind: Service apiVersion: v1 metadata: name: ams-service spec: selector: app: ams ports: - port: 5000 # Default port for image targetPort: 2185 !
kubectl port-forward --address 0.0.0.0 --namespace default service/ams-service 2185:5000
You may now connect to your AMS service on port 2185.
To shut down and remove the database, simply uninstall it with helm between tests:
helm uninstall ams-db