{"id":14987860,"url":"https://github.com/apache/incubator-seata-k8s","last_synced_at":"2026-03-12T06:02:28.765Z","repository":{"id":86561643,"uuid":"180135206","full_name":"apache/incubator-seata-k8s","owner":"apache","description":"Seata Kubernetes Operations Tool","archived":false,"fork":false,"pushed_at":"2026-02-14T03:58:20.000Z","size":284,"stargazers_count":50,"open_issues_count":2,"forks_count":19,"subscribers_count":21,"default_branch":"master","last_synced_at":"2026-02-14T10:59:35.298Z","etag":null,"topics":["at","saga","tcc","xa"],"latest_commit_sha":null,"homepage":"https://seata.apache.org/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apache.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-04-08T11:32:39.000Z","updated_at":"2026-02-14T03:58:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"2344b983-8181-4235-a002-7e7c58e71bba","html_url":"https://github.com/apache/incubator-seata-k8s","commit_stats":{"total_commits":18,"total_committers":6,"mean_commits":3.0,"dds":0.4444444444444444,"last_synced_commit":"f629513199e554027f9cc95fc3dc9c706dafcc22"},"previous_names":["apache/incubator-seata-k8s","apache/seata-k8s"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/apache/incubator-seata-k8s","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fincubator-seata-k8s","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fincubator-seata-k8s/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fincubator-seata-k8s/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fincubator-seata-k8s/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apache","download_url":"https://codeload.github.com/apache/incubator-seata-k8s/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fincubator-seata-k8s/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30416737,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T04:41:02.746Z","status":"ssl_error","status_checked_at":"2026-03-12T04:40:12.571Z","response_time":114,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["at","saga","tcc","xa"],"created_at":"2024-09-24T14:15:35.539Z","updated_at":"2026-03-12T06:02:28.760Z","avatar_url":"https://github.com/apache.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\n    Licensed to the Apache Software Foundation (ASF) under one or more\n    contributor license agreements.  See the NOTICE file distributed with\n    this work for additional information regarding copyright ownership.\n    The ASF licenses this file to You under the Apache License, Version 2.0\n    (the \"License\"); you may not use this file except in compliance with\n    the License.  You may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n    \n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n--\u003e\n\n# seata-k8s\n\n[中文文档](README.zh.md) | [English](README.md)\n\n[![build](https://github.com/apache/incubator-seata-k8s/actions/workflows/build.yml/badge.svg)](https://github.com/apache/incubator-seata-k8s/actions/workflows/build.yml)\n[![codecov](https://codecov.io/gh/apache/incubator-seata-k8s/graph/badge.svg?token=zGKxnk5bT1)](https://codecov.io/gh/apache/incubator-seata-k8s)\n\n## Overview\n\nseata-k8s is a Kubernetes operator for deploying and managing [Apache Seata](https://github.com/seata/seata) distributed transaction servers. It provides a streamlined way to deploy Seata Server clusters on Kubernetes with automatic scaling, persistence management, and operational simplicity.\n\n## Features\n\n- 🚀 **Easy Deployment**: Deploy Seata Server clusters using Kubernetes CRDs\n- 📈 **Auto Scaling**: Simple scaling through replica configuration\n- 💾 **Persistence Management**: Built-in support for persistent volumes\n- 🔐 **RBAC Support**: Comprehensive role-based access control\n- 🛠️ **Developer Friendly**: Includes debugging and development tools\n\n## Related Projects\n\n- [Apache Seata](https://github.com/seata/seata) - Distributed transaction framework\n- [Seata Samples](https://github.com/seata/seata-samples/tree/docker/springboot-dubbo-fescar) - Example implementations\n- [Seata Docker](https://github.com/seata/seata-docker) - Docker image repository\n\n## Table of Contents\n\n- [Method 1: Using Operator](#method-1-using-operator)\n  - [Usage](#usage)\n  - [CRD Reference](#crd-reference)\n  - [Development Guide](#development-guide)\n- [Method 2: Direct Kubernetes Deployment](#method-2-direct-kubernetes-deployment)\n  - [Deployment Steps](#deployment-steps)\n  - [Testing](#testing)\n\n## Method 1: Using Operator\n\n### Prerequisites\n\n- Kubernetes 1.16+ cluster\n- kubectl configured with access to your cluster\n- Make and Docker (for building images)\n\n### Usage\n\nTo deploy Seata Server using the Operator method, follow these steps:\n\n#### Step 1: Clone the Repository\n\n```shell\ngit clone https://github.com/apache/incubator-seata-k8s.git\ncd incubator-seata-k8s\n```\n\n#### Step 2: Deploy Operator to Cluster\n\nDeploy the controller, CRD, RBAC, and other required resources:\n\n```shell\nmake deploy\n```\n\nVerify the deployment:\n\n```shell\nkubectl get deployment -n seata-k8s-controller-manager\nkubectl get pods -n seata-k8s-controller-manager\n```\n\n#### Step 3: Deploy Seata Server Cluster\n\nCreate a SeataServer resource. Here's an example based on [seata-server-cluster.yaml](deploy/seata-server-cluster.yaml):\n\n```yaml\napiVersion: operator.seata.apache.org/v1alpha1\nkind: SeataServer\nmetadata:\n  name: seata-server\n  namespace: default\nspec:\n  serviceName: seata-server-cluster\n  replicas: 3\n  image: apache/seata-server:latest\n  persistence:\n    volumeReclaimPolicy: Retain\n    spec:\n      resources:\n        requests:\n          storage: 5Gi\n```\n\nApply it to your cluster:\n\n```shell\nkubectl apply -f seata-server.yaml\n```\n\nIf everything is working correctly, the operator will:\n- Create 3 StatefulSet replicas\n- Create a Headless Service named `seata-server-cluster`\n- Set up persistent volumes\n\nAccess the Seata Server cluster within your Kubernetes network:\n\n```\nseata-server-0.seata-server-cluster.default.svc\nseata-server-1.seata-server-cluster.default.svc\nseata-server-2.seata-server-cluster.default.svc\n```\n\n### CRD Reference\n\nFor complete CRD definitions, see [seataservers_crd.yaml](config/crd/bases/v1/seataservers_crd.yaml).\n\n#### Key Configuration Properties\n\n| Property | Description | Default | Example |\n|----------|-------------|---------|---------|\n| `serviceName` | Name of the Headless Service | - | `seata-server-cluster` |\n| `replicas` | Number of Seata Server replicas | 1 | `3` |\n| `image` | Seata Server container image | - | `apache/seata-server:latest` |\n| `ports.consolePort` | Console port | `7091` | `7091` |\n| `ports.servicePort` | Service port | `8091` | `8091` |\n| `ports.raftPort` | Raft consensus port | `9091` | `9091` |\n| `resources` | Container resource requests/limits | - | See example below |\n| `persistence.volumeReclaimPolicy` | Volume reclaim policy | `Retain` | `Retain` or `Delete` |\n| `persistence.spec.resources.requests.storage` | Persistent volume size | - | `5Gi` |\n| `env` | Environment variables | - | See example below |\n\n#### Environment Variables \u0026 Secrets\n\nConfigure Seata Server settings using environment variables and Kubernetes Secrets:\n\n```yaml\napiVersion: operator.seata.apache.org/v1alpha1\nkind: SeataServer\nmetadata:\n  name: seata-server\n  namespace: default\nspec:\n  image: apache/seata-server:latest\n  replicas: 1\n  persistence:\n    spec:\n      resources:\n        requests:\n          storage: 5Gi\n  env:\n  - name: console.user.username\n    value: seata\n  - name: console.user.password\n    valueFrom:\n      secretKeyRef:\n        name: seata-credentials\n        key: password\n---\napiVersion: v1\nkind: Secret\nmetadata:\n  name: seata-credentials\n  namespace: default\ntype: Opaque\nstringData:\n  password: your-secure-password\n```\n\n\n\n### Development Guide\n\nTo debug and develop this operator locally, we recommend using Minikube or a similar local Kubernetes environment.\n\n#### Option 1: Build and Deploy Docker Image\n\nModify the code and rebuild the controller image:\n\n```shell\n# Start minikube and set docker environment\nminikube start\neval $(minikube docker-env)\n\n# Build and deploy\nmake docker-build deploy\n\n# Verify deployment\nkubectl get deployment -n seata-k8s-controller-manager\n```\n\n#### Option 2: Local Debug with Telepresence\n\nUse [Telepresence](https://www.telepresence.io/) to debug locally without building container images.\n\n**Prerequisites:**\n- Install [Telepresence CLI](https://www.telepresence.io/docs/latest/quick-start/)\n- Install [Traffic Manager](https://www.getambassador.io/docs/telepresence/latest/install/manager#install-the-traffic-manager)\n\n**Steps:**\n\n1. Connect Telepresence to your cluster:\n\n```shell\ntelepresence connect\ntelepresence status  # Verify connection\n```\n\n2. Generate code resources:\n\n```shell\nmake manifests generate fmt vet\n```\n\n3. Run the controller locally using your IDE or command line:\n\n```shell\ngo run .\n```\n\nNow your local development environment has access to the Kubernetes cluster's DNS and services.\n\n   \n\n\n## Method 2: Direct Kubernetes Deployment\n\nThis method deploys Seata Server directly using Kubernetes manifests without the operator. Note that Seata Docker images currently require link-mode for container communication.\n\n### Prerequisites\n\n- MySQL database\n- Nacos registry server\n- Access to Kubernetes cluster\n\n### Deployment Steps\n\n#### Step 1: Deploy Seata and Dependencies\n\nDeploy Seata server, Nacos, and MySQL:\n\n```shell\nkubectl apply -f deploy/seata-deploy.yaml\nkubectl apply -f deploy/seata-service.yaml\n```\n\n#### Step 2: Retrieve Service Information\n\n```shell\nkubectl get service\n# Note the NodePort IPs and ports for Seata and Nacos\n```\n\n#### Step 3: Configure DNS Addressing\n\nUpdate `example/example-deploy.yaml` with the NodePort IP addresses obtained above.\n\n#### Step 4: Initialize Database\n\n```shell\n# Connect to MySQL and import Seata table schema\n# Replace CLUSTER_IP with your MySQL service IP\nmysql -h \u003cCLUSTER_IP\u003e -u root -p \u003c path/to/seata-db-schema.sql\n```\n\n#### Step 5: Deploy Example Applications\n\nDeploy the sample microservices:\n\n```shell\n# Deploy account and storage services\nkubectl apply -f example/example-deploy.yaml\nkubectl apply -f example/example-service.yaml\n\n# Deploy order service\nkubectl apply -f example/order-deploy.yaml\nkubectl apply -f example/order-service.yaml\n\n# Deploy business service\nkubectl apply -f example/business-deploy.yaml\nkubectl apply -f example/business-service.yaml\n```\n\n### Verification\n\nOpen Nacos console to verify service registration:\n\n```\nhttp://localhost:8848/nacos/\n```\n\nCheck that all services are registered:\n- account-service\n- storage-service\n- order-service\n- business-service\n\n### Testing\n\nTest the distributed transaction scenarios using the following curl commands:\n\n#### Test 1: Account Service - Deduct Amount\n\n```shell\ncurl -H \"Content-Type: application/json\" \\\n  -X POST \\\n  --data '{\"id\":1,\"userId\":\"1\",\"amount\":100}' \\\n  http://\u003cCLUSTER_IP\u003e:8102/account/dec_account\n```\n\n#### Test 2: Storage Service - Deduct Stock\n\n```shell\ncurl -H \"Content-Type: application/json\" \\\n  -X POST \\\n  --data '{\"commodityCode\":\"C201901140001\",\"count\":100}' \\\n  http://\u003cCLUSTER_IP\u003e:8100/storage/dec_storage\n```\n\n#### Test 3: Order Service - Create Order\n\n```shell\ncurl -H \"Content-Type: application/json\" \\\n  -X POST \\\n  --data '{\"userId\":\"1\",\"commodityCode\":\"C201901140001\",\"orderCount\":10,\"orderAmount\":100}' \\\n  http://\u003cCLUSTER_IP\u003e:8101/order/create_order\n```\n\n#### Test 4: Business Service - Execute Transaction\n\n```shell\ncurl -H \"Content-Type: application/json\" \\\n  -X POST \\\n  --data '{\"userId\":\"1\",\"commodityCode\":\"C201901140001\",\"count\":10,\"amount\":100}' \\\n  http://\u003cCLUSTER_IP\u003e:8104/business/dubbo/buy\n```\n\nReplace `\u003cCLUSTER_IP\u003e` with the actual NodePort IP address of your service.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fincubator-seata-k8s","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapache%2Fincubator-seata-k8s","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fincubator-seata-k8s/lists"}