Open dhiaayachi opened 2 months ago
Thanks for reporting this issue!
Can you please provide the following information so I can help you further:
Once I have this information, I can try to find a solution based on the attached documents.
Let's break down the Temporal deployment process you described. Here's a comprehensive guide with explanations and recommendations:
Introduction
Temporal is a powerful workflow orchestration platform that helps build robust and scalable applications. The deployment process you described involves running Temporal as a standalone service with a reverse proxy for external access. This configuration provides flexibility and control over your workflow environment.
Prerequisites
Before you begin, make sure you have the following:
Obtaining the Temporal Binaries
Configuring the Temporal Binaries
Temporal Server Configuration: Create a temporal-server.yaml
file in a directory of your choice (e.g., /etc/temporal
). Here's a basic configuration that uses SQLite for persistence:
log:
stdout: true
level: info
persistence:
defaultStore: sqlite-default
visibilityStore: sqlite-visibility
numHistoryShards: 4
datastores:
sqlite-default:
sql:
pluginName: "sqlite"
databaseName: "/etc/temporal/default.db"
connectAddr: "localhost"
connectProtocol: "tcp"
connectAttributes:
cache: "private"
setup: true
sqlite-visibility:
sql:
pluginName: "sqlite"
databaseName: "/etc/temporal/visibility.db"
connectAddr: "localhost"
connectProtocol: "tcp"
connectAttributes:
cache: "private"
setup: true
global:
membership:
maxJoinDuration: 30s
broadcastAddress: "127.0.0.1"
pprof:
port: 7936
services:
frontend:
rpc:
grpcPort: 7236
membershipPort: 6933
bindOnLocalHost: true
httpPort: 7243
matching:
rpc:
grpcPort: 7235
membershipPort: 6935
bindOnLocalHost: true
history:
rpc:
grpcPort: 7234
membershipPort: 6934
bindOnLocalHost: true
worker:
rpc:
membershipPort: 6939
clusterMetadata:
enableGlobalNamespace: false
failoverVersionIncrement: 10
masterClusterName: "active"
currentClusterName: "active"
clusterInformation:
active:
enabled: true
initialFailoverVersion: 1
rpcName: "frontend"
rpcAddress: "localhost:7236"
httpAddress: "localhost:7243"
dcRedirectionPolicy:
policy: "noop"
Temporal UI Server Configuration: Create a temporal-ui-server.yaml
file in the same directory. Here's a basic configuration:
temporalGrpcAddress: 127.0.0.1:7236
host: 127.0.0.1
port: 8233
enableUi: true
cors:
allowOrigins:
- http://localhost:8233
defaultNamespace: default
Creating and Registering System Services
Temporal Server Service: Create a temporal.service
file in /etc/systemd/system/
. This file defines the Temporal server as a system service:
[Unit]
Description=Temporal Service
After=network.target
[Service]
User=temporal
Group=temporal
ExecStart=/usr/bin/temporal-server -r / -c /etc/temporal/ -e temporal-server start
[Install]
WantedBy=multi-user.target
/usr/bin/temporal-server
with the actual path where you placed the downloaded Temporal server binary.Temporal UI Server Service: Create a temporal-ui.service
file in /etc/systemd/system/
:
[Unit]
Description=Temporal UI Server
After=network.target
[Service]
User=temporal
Group=temporal
ExecStart=/usr/bin/temporal-ui-server -r / -c /etc/temporal/ -e temporal-ui-server start
[Install]
WantedBy=multi-user.target
/usr/bin/temporal-ui-server
with the actual path where you placed the downloaded UI server binary.Enable and Start Services:
sudo systemctl enable temporal
sudo systemctl start temporal
sudo systemctl enable temporal-ui
sudo systemctl start temporal-ui
Deploying an Nginx Reverse Proxy with an SSL Certificate
Install Nginx: If Nginx is not already installed, use your Linux distribution's package manager to install it. For example, on Ubuntu/Debian:
sudo apt update
sudo apt install nginx
Obtain SSL Certificates (Certbot): Use Certbot to automatically obtain and install SSL certificates from Let's Encrypt:
sudo apt install certbot
sudo certbot certonly --standalone -d YOUR_DOMAIN
YOUR_DOMAIN
with your actual domain name.Nginx Configuration (Temporal UI): Create a temporal-ui
configuration file in /etc/nginx/sites-available/
:
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name YOUR_DOMAIN www.YOUR_DOMAIN
access_log /var/log/nginx/temporal.access.log;
error_log /var/log/nginx/temporal.error.log;
location / {
proxy_pass http://127.0.0.1:8233;
proxy_http_version 1.1;
proxy_read_timeout 300;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-PORT $remote_port;
# Replace with your allowed client IPs
allow 192.168.1.100;
deny all;
}
listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/YOUR_DOMAIN/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/YOUR_DOMAIN/privkey.pem;
# Redirect non-https traffic to https
if ($scheme != "https") {
return 301 https://$host$request_uri;
}
}
192.168.1.100
with your allowed client IP address(es) or IP range. Nginx Configuration (Temporal gRPC): Create a temporal
configuration file in /etc/nginx/sites-available/
:
server {
listen 7233 http2;
listen [::]:7233 http2;
server_name YOUR_DOMAIN
http2 on;
location / {
grpc_pass localhost:7236;
# Replace with your allowed client IPs
allow 192.168.1.100;
deny all;
}
}
192.168.1.100
with your allowed client IP address(es) or IP range (same as for Temporal UI).Enable and Reload Nginx:
sudo ln -s /etc/nginx/sites-available/temporal-ui /etc/nginx/sites-enabled/temporal-ui
sudo ln -s /etc/nginx/sites-available/temporal /etc/nginx/sites-enabled/temporal
sudo systemctl reload nginx
Interacting with the Temporal Service
https://YOUR_DOMAIN
.--address your_server:7233
flag in your CLI commands.Conclusion
By following these steps, you've successfully deployed a Temporal service with an Nginx reverse proxy and SSL certificate. This configuration provides a secure and scalable environment for your workflows.
Key Points:
Feel free to ask if you have any further questions! Let me know if you'd like help with specific workflows, the Temporal CLI, or other aspects of the deployment.
This is a great starting point for a Temporal Service deployment. You've covered the essential steps and configurations for a basic Temporal deployment with an SQLite backend. Here are some additional notes and improvements:
Important Notes:
allow
statement with an IP address, a more robust security approach is highly recommended for production environments. Consider using:
Identity
feature) to control access to Temporal services.mysql
persistence plugin that is a better choice. Even better, consider a scalable database solution like PostgreSQL
.metrics
feature can be used to expose metrics for monitoring.Improvements to the Guide:
allow
statement is for demonstration and should not be used in production. Add sections emphasizing the need for authentication, authorization, and SSL.metrics
feature and connect it to monitoring tools like Prometheus. Provide examples of metrics that should be monitored and what they reveal about Temporal's health.Additional Considerations:
Example Improvements:
Security Section (Added):
## Security Considerations
Securing your Temporal service is crucial for production environments. The following best practices are recommended:
* **Authentication:** Use Temporal's built-in `Identity` feature to authenticate users connecting to Temporal. This prevents unauthorized access to workflows and data.
* **Authorization:** Implement fine-grained authorization mechanisms to restrict users to specific resources within Temporal. This ensures that users only have access to the data they need.
* **SSL:** Use SSL certificates to encrypt communication between clients and Temporal servers. This helps protect sensitive data from interception during transmission.
Persistence Section (Updated):
## Persistence
For production use, we recommend using a more robust persistence solution than SQLite. Consider these alternatives:
* **MySQL:** A popular, reliable database that Temporal supports.
* **PostgreSQL:** A highly scalable and feature-rich database that is often preferred for Temporal's persistent state.
By incorporating these recommendations and best practices, you can create a secure, scalable, and reliable Temporal service for your production needs. The Temporal community is a valuable resource for additional guidance and examples!
Web UI 404 when accessing detail of workflow id from archival
Here is the English translation of your issue:
I am using Helm to deploy to GKE with the
values.archival.gcloud.yaml
as follows:For persistence, I am using PostgreSQL with the following
values.postgresql.yaml
:Then, I forward the Web UI using Internal Ingress with the following configuration:
The archival and visibility files are already in the bucket.
and this is my version server
1.24.2