Browse Source

Merge pull request 'config file update' (#1) from dev into master

pull/9/head
devad 3 years ago
parent
commit
a86e451f96
7 changed files with 137 additions and 59 deletions
  1. +19
    -10
      adaptor/container_api_adaptor/alibaba/eci/config_eci.conf
  2. +0
    -14
      adaptor/container_api_adaptor/common/auth/aksk/aksk.conf
  3. +14
    -0
      adaptor/container_api_adaptor/common/auth/aksk/aksk_template.conf
  4. +5
    -7
      adaptor/container_api_adaptor/common/main.go
  5. +30
    -15
      adaptor/container_api_adaptor/huawei/cci/config_cci.conf
  6. +26
    -13
      adaptor/container_api_adaptor/tencent/eks/config_eks.conf
  7. +43
    -0
      go.mod

+ 19
- 10
adaptor/container_api_adaptor/alibaba/eci/config_eci.conf View File

@@ -1,17 +1,26 @@
[pod_create_conf] [pod_create_conf]
region_id=cn-hangzhou #region 对应阿里 RegionId(阿里必需)
container_group_name=pcm-test-ali-pod #容器实例名称(pod名) 对应阿里 ContainerGroupName(阿里必需)
container_image=registry-vpc.cn-hangzhou.aliyuncs.com/eci_open/nginx #镜像地址 对应阿里 Container.Image(阿里必需)
container_name=pcm-test-ali-container #容器名称 对应阿里 Container.Name(阿里必需)
region_id=cn-hangzhou
#容器实例名称(pod名) 对应阿里 ContainerGroupName(阿里必需)
container_group_name=pcm-test-ali-pod
#镜像地址 对应阿里 Container.Image(阿里必需)
container_image=registry-vpc.cn-hangzhou.aliyuncs.com/eci_open/nginx
#容器名称 对应阿里 Container.Name(阿里必需)
container_name=pcm-test-ali-container


[pod_delete_conf] [pod_delete_conf]
region_id=cn-hangzhou # 地域id
container_group_id=eci-bp1c3eqfq98nz2kbiooo #容器实例ID
# 地域id
region_id=cn-hangzhou
#容器实例ID
container_group_id=eci-bp1c3eqfq98nz2kbiooo


[pod_list_conf] [pod_list_conf]
region_id=cn-hangzhou # 地域id
# 地域id
region_id=cn-hangzhou


[pod_update_conf] [pod_update_conf]
region_id=cn-hangzhou # 地域id
container_group_id=eci-bp1c3eqfq98nz2kbiooo #容器实例ID
restart_policy=Never #可选 这里用重启策略做更新测试
# 地域id
region_id=cn-hangzhou
#容器实例ID
container_group_id=eci-bp1c3eqfq98nz2kbiooo
#可选 这里用重启策略做更新测试
restart_policy=Never

+ 0
- 14
adaptor/container_api_adaptor/common/auth/aksk/aksk.conf View File

@@ -1,14 +0,0 @@
#阿里
[alibaba]
access_key = LTAI5tSCnrhQAdbFhGyWkSL2
secret_key = KN4tqu8lalQdo47SoUQBb88qOWjzYC

#华为
[huawei]
access_key = ATQTIWUT9K66VRMMXKVY
secret_key = Wa0aixDVuhZOfDZGWvgIJQBHnyiDlGdgDn1Ai5Yy

#腾讯
[tencent]
access_key = AKIDRefQxnhmuqTU1KRWFl58wQeCE0XoAeEZ
secret_key = LUMVRmGj2kFrEahhZzA5pKvHNSMASntj

+ 14
- 0
adaptor/container_api_adaptor/common/auth/aksk/aksk_template.conf View File

@@ -0,0 +1,14 @@
#阿里
[alibaba]
access_key =
secret_key =

#华为
[huawei]
access_key =
secret_key =

#腾讯
[tencent]
access_key =
secret_key =

+ 5
- 7
adaptor/container_api_adaptor/common/main.go View File

@@ -1,13 +1,11 @@
package main package main


import "PCM/adaptor/container_api_adaptor/common/api"

func main() { func main() {


aliConfigPath := "/home/Senna/GolandProjects/PCM/adaptor/container_api_adaptor/alibaba/eci/config_eci.conf"
huaweiConfigPath := "/home/Senna/GolandProjects/PCM/adaptor/container_api_adaptor/huawei/cci/config_cci.conf"
tencentConfigPath := "/home/Senna/GolandProjects/PCM/adaptor/container_api_adaptor/tencent/eks/config_eks.conf"
akskPath := "/home/Senna/GolandProjects/PCM/adaptor/auth/aksk/aksk.conf"
aliConfigPath := "adaptor/container_api_adaptor/alibaba/eci/config_eci.conf"
huaweiConfigPath := "adaptor/container_api_adaptor/huawei/cci/config_cci.conf"
tencentConfigPath := "adaptor/container_api_adaptor/tencent/eks/config_eks.conf"
akskPath := "adaptor/container_api_adaptor/common/auth/aksk/aksk.conf"
println(aliConfigPath) println(aliConfigPath)
println(huaweiConfigPath) println(huaweiConfigPath)
println(tencentConfigPath) println(tencentConfigPath)
@@ -26,6 +24,6 @@ func main() {
//api.CreatePod("tencent", akskPath, tencentConfigPath) //api.CreatePod("tencent", akskPath, tencentConfigPath)
//api.ListPod("tencent", akskPath, tencentConfigPath) //api.ListPod("tencent", akskPath, tencentConfigPath)
//api.UpdatePod("tencent", akskPath, tencentConfigPath) //api.UpdatePod("tencent", akskPath, tencentConfigPath)
api.DeletePod("tencent", akskPath, tencentConfigPath)
//api.DeletePod("tencent", akskPath, tencentConfigPath)


} }

+ 30
- 15
adaptor/container_api_adaptor/huawei/cci/config_cci.conf View File

@@ -1,24 +1,39 @@
[pod_create_conf] [pod_create_conf]
region_id=cn-north-4 #region 对应华为 Region (华为创建Namespace必需)
namespace=test-k8s-client-namespace1 #namespace 华为CCI基于K8S namespace进行管理,需要单独提供namespace 对应Pod.ObjectMeta.Namespace (华为必需)
container_group_name=pcm-test-huawei-pod #容器实例名称(pod名) 对应华为 Pod.ObjectMeta.Name (华为必需)
container_image=library/nginx:stable-alpine-perl #镜像地址 对应华为 Pod.PodSpec.Containers.Container.Image (华为必需)
container_name=pcm-test-huawei-container #容器名称 对应华为 Pod.PodSpec.Containers.Container.Name (华为必需)
cpu_pod=500m #Pod拥有核数 对应华为 Pod.PodSpec.Containers.Container.Resources.Limits.ResourceCPU (华为必需)
memory_pod=1024Mi #Pod拥有内存大小 对应华为 Pod.PodSpec.Containers.Container.Resources.Limits.ResourceMemory (华为必需)
#region 对应华为 Region (华为创建Namespace必需)
region_id=cn-north-4
#namespace 华为CCI基于K8S namespace进行管理,需要单独提供namespace 对应Pod.ObjectMeta.Namespace (华为必需)
namespace=test-k8s-client-namespace1
#容器实例名称(pod名) 对应华为 Pod.ObjectMeta.Name (华为必需)
container_group_name=pcm-test-huawei-pod
#镜像地址 对应华为 Pod.PodSpec.Containers.Container.Image (华为必需)
container_image=library/nginx:stable-alpine-perl
#容器名称 对应华为 Pod.PodSpec.Containers.Container.Name (华为必需)
container_name=pcm-test-huawei-container
#Pod拥有核数 对应华为 Pod.PodSpec.Containers.Container.Resources.Limits.ResourceCPU (华为必需)
cpu_pod=500m
#Pod拥有内存大小 对应华为 Pod.PodSpec.Containers.Container.Resources.Limits.ResourceMemory (华为必需)
memory_pod=1024Mi


[pod_delete_conf] [pod_delete_conf]
namespace=test-k8s-client-namespace1 # 地域id
container_group_name=pcm-test-huawei-pod #容器实例名称(pod名) 对应华为 Pod.ObjectMeta.Name (华为必需)
# 地域id
namespace=test-k8s-client-namespace1
#容器实例名称(pod名) 对应华为 Pod.ObjectMeta.Name (华为必需)
container_group_name=pcm-test-huawei-pod


[pod_list_conf] [pod_list_conf]
region_id=cn-hangzhou # 地域id
# 地域id
region_id=cn-hangzhou


[pod_update_conf] [pod_update_conf]
container_group_name=pcm-test-huawei-pod #容器实例名称(pod名) 对应华为 Pod.ObjectMeta.Name (华为必需)
container_image=library/nginx:stable-alpine-perl #镜像地址 对应华为 Pod.PodSpec.Containers.Container.Image (华为必需)
container_name=pcm-test-huawei-container-new #容器名称 对应华为 Pod.PodSpec.Containers.Container.Name (华为必需)
cpu_pod=500m #Pod拥有核数 对应华为 Pod.PodSpec.Containers.Container.Resources.Limits.ResourceCPU (华为必需)
memory_pod=2048Mi #Pod拥有内存大小 对应华为 Pod.PodSpec.Containers.Container.Resources.Limits.ResourceMemory (华为必需)
#容器实例名称(pod名) 对应华为 Pod.ObjectMeta.Name (华为必需)
container_group_name=pcm-test-huawei-pod
#镜像地址 对应华为 Pod.PodSpec.Containers.Container.Image (华为必需)
container_image=library/nginx:stable-alpine-perl
#容器名称 对应华为 Pod.PodSpec.Containers.Container.Name (华为必需)
container_name=pcm-test-huawei-container-new
#Pod拥有核数 对应华为 Pod.PodSpec.Containers.Container.Resources.Limits.ResourceCPU (华为必需)
cpu_pod=500m
#Pod拥有内存大小 对应华为 Pod.PodSpec.Containers.Container.Resources.Limits.ResourceMemory (华为必需)
memory_pod=2048Mi
namespace=test-k8s-client-namespace1 namespace=test-k8s-client-namespace1
restart_policy=Always restart_policy=Always

+ 26
- 13
adaptor/container_api_adaptor/tencent/eks/config_eks.conf View File

@@ -1,21 +1,34 @@
[pod_create_conf] [pod_create_conf]
region_id=ap-beijing #区域ID
container_group_name=pcm-test-tencent-pod #容器实例名称(pod名) 对应腾讯EksCiName(腾讯必需)
container_image=library/nginx:stable-alpine-perl #镜像地址 对应腾讯 Container.Image(腾讯必需)
container_name=pcm-test-tencent-container #容器名称 对应腾讯 Container.Name(腾讯必需)
cpu_pod=1 #Pod拥有核数 对应腾讯 Cpu(腾讯必需)
memory_pod=2 #Pod拥有内存大小 对应腾讯 Memory(腾讯必需)
security_group_id=sg-owzbdinl #安全组ID 对应腾讯 SecurityGroupIds(腾讯必需)
subnet_id=subnet-n4h73049 #子网ID 对应腾讯 SubnetId(腾讯必需)
vpc_id=vpc-e8hdbla8 #VPC ID 对应腾讯 VpcId(腾讯必需)
#区域ID
region_id=ap-beijing
#容器实例名称(pod名) 对应腾讯EksCiName(腾讯必需)
container_group_name=pcm-test-tencent-pod
#镜像地址 对应腾讯 Container.Image(腾讯必需)
container_image=library/nginx:stable-alpine-perl
#容器名称 对应腾讯 Container.Name(腾讯必需)
container_name=pcm-test-tencent-container
#Pod拥有核数 对应腾讯 Cpu(腾讯必需)
cpu_pod=1
#Pod拥有内存大小 对应腾讯 Memory(腾讯必需)
memory_pod=2
#安全组ID 对应腾讯 SecurityGroupIds(腾讯必需)
security_group_id=sg-owzbdinl
#子网ID 对应腾讯 SubnetId(腾讯必需)
subnet_id=subnet-n4h73049
#VPC ID 对应腾讯 VpcId(腾讯必需)
vpc_id=vpc-e8hdbla8


[pod_list_conf] [pod_list_conf]
region_id=ap-beijing #区域ID
#区域ID
region_id=ap-beijing


[pod_update_conf] [pod_update_conf]
region_id=ap-beijing #区域ID
container_group_id=eksci-pawu7qad #容器实例ID 对应腾讯EksCiName(腾讯必需)
container_group_name=eksci-pawu7qad #容器实例名称(pod名) 对应腾讯EksCiName(腾讯必需)
#区域ID
region_id=ap-beijing
#容器实例ID 对应腾讯EksCiName(腾讯必需)
container_group_id=eksci-pawu7qad
#容器实例名称(pod名) 对应腾讯EksCiName(腾讯必需)
container_group_name=eksci-pawu7qad


[pod_delete_conf] [pod_delete_conf]
container_group_id=eksci-pawu7qad container_group_id=eksci-pawu7qad

+ 43
- 0
go.mod View File

@@ -0,0 +1,43 @@
module PCM

go 1.17

require (
github.com/Unknwon/goconfig v1.0.0
github.com/aliyun/alibaba-cloud-sdk-go v1.61.1530
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.371
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke v1.0.371
k8s.io/api v0.0.0-20190620084959-7cf5895f2711
k8s.io/apimachinery v0.0.0-20190612205821-1799e75a0719
k8s.io/client-go v0.0.0-20190620085101-78d2af792bab
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/evanphx/json-patch v0.0.0-20190203023257-5858425f7550 // indirect
github.com/gogo/protobuf v0.0.0-20171007142547-342cbe0a0415 // indirect
github.com/golang/protobuf v1.2.0 // indirect
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf // indirect
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d // indirect
github.com/imdario/mergo v0.3.5 // indirect
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af // indirect
github.com/json-iterator/go v1.1.5 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/smartystreets/goconvey v1.7.2 // indirect
github.com/spf13/pflag v1.0.1 // indirect
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 // indirect
golang.org/x/net v0.0.0-20190311183353-d8887717615a // indirect
golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a // indirect
golang.org/x/sys v0.0.0-20190312061237-fead79001313 // indirect
golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db // indirect
golang.org/x/time v0.0.0-20161028155119-f51c12702a4d // indirect
google.golang.org/appengine v1.5.0 // indirect
gopkg.in/inf.v0 v0.9.0 // indirect
gopkg.in/ini.v1 v1.66.2 // indirect
gopkg.in/yaml.v2 v2.2.1 // indirect
k8s.io/klog v0.3.1 // indirect
k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30 // indirect
k8s.io/utils v0.0.0-20190221042446-c2654d5206da // indirect
sigs.k8s.io/yaml v1.1.0 // indirect
)

Loading…
Cancel
Save