| | |
| | | Client *kubernetes.Clientset // Kubernetes 客户端 |
| | | Image string // 镜像名称 |
| | | DBHost string // 数据库地址 |
| | | DBName string //数据库名称 |
| | | HttpPort int32 // HTTP 端口 |
| | | RpcPort int32 // RPC 端口 |
| | | NameSpace string // Namespace |
| | |
| | | return nil |
| | | } |
| | | |
| | | // createNamespace 创建指定的 Namespace |
| | | func createNamespace(clientset *kubernetes.Clientset, namespace string) error { |
| | | // CreateNamespace 创建指定的 Namespace |
| | | func CreateNamespace(clientset *kubernetes.Clientset, namespace string) error { |
| | | log.Printf("Creating Namespace: %s\n", namespace) |
| | | |
| | | ns := &apiv1.Namespace{ |
| | |
| | | }, |
| | | { |
| | | Name: "DB_NAME", |
| | | Value: config.NameSpace, |
| | | Value: config.DBName, |
| | | }, |
| | | { |
| | | Name: "DB_PORT", |