Skip to content

Commit

Permalink
修改helm部署方式
Browse files Browse the repository at this point in the history
  • Loading branch information
yehan committed Aug 9, 2024
1 parent 9ef602f commit c4d0c21
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .computenest/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Service:
ArtifactId: ${Artifact.Artifact_1.ArtifactId}
ArtifactVersion: ${Artifact.Artifact_1.ArtifactVersion}
HelmChartArtifactRelation:
'{{ computenest::helmpull::springBoot }}':
'{{ computenest::helmchart::springBoot }}':
ArtifactId: ${Artifact.Artifact_2.ArtifactId}
ArtifactVersion: ${Artifact.Artifact_2.ArtifactVersion}
TemplateConfigs:
Expand Down
35 changes: 19 additions & 16 deletions .computenest/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ Parameters:
Default: 172.16.0.0/16
```

2.Resources定义需要开的资源,包括新开的vpc、loadBalancer、ack集群。MODULE::ACS::ComputeNest::ClusterHelmApplication资源类型会将helm部署物部署到ACK集群中,其中{{ computenest::helmpull::springBoot }}是helm部署物占位符,会替换为对应的helm部署物的下载方式。chartValues中还有镜像容器部署物相关的占位符,{{ computenest::acr::dockerconfigjson }}是下载docker所需secret的占位符,计算巢服务会在部署时替换为对应的下载秘钥。{{ computenest::acrimage::demo }} 是容器镜像仓库的占位符,计算巢服务会替换成对应的镜像仓库地址。
2.Resources定义需要开的资源,包括新开的vpc、loadBalancer、ack集群。MODULE::ACS::ComputeNest::FluxOciHelmDeploy资源类型会将helm部署物部署到ACK集群中,其中{{ computenest::helmchart::springBoot }}是helm部署物占位符,会替换为对应的helm chart仓库地址。chartValues中还有镜像容器部署物相关的占位符,{{ computenest::acr::dockerconfigjson }}是下载docker所需secret的占位符,计算巢服务会在部署时替换为对应的下载秘钥。{{ computenest::acrimage::demo }} 是容器镜像仓库的占位符,计算巢服务会替换成对应的镜像仓库地址。
```
Resources:
EcsVpc:
Expand Down Expand Up @@ -462,17 +462,18 @@ Resources:
Addons:
- Name: flannel
Config: ''
ComputenestHelmApplication:
Type: MODULE::ACS::ComputeNest::ClusterHelmApplication
Version: v2
ComputenestHelmApplication:
Type: MODULE::ACS::ComputeNest::FluxOciHelmDeploy
Version: v1
DependsOn:
- ManagedKubernetesCluster
Properties:
ClusterId:
Fn::GetAtt:
- ManagedKubernetesCluster
- ClusterId
ChartIdentifier: '{{ computenest::helmpull::springBoot }}'
HelmChartUrl: '{{ computenest::helmchart::springBoot }}'
DockerConfigJson: '{{ computenest::helm::dockerconfigjson }}'
ChartValues:
image:
fullname: '{{ computenest::acrimage::springBootDemo }}'
Expand All @@ -483,23 +484,25 @@ Resources:
Namespace:
Ref: ALIYUN::StackName
ReleaseName: spring-boot-chart
# 睡眠1分钟,以便于获取资源时可以拿到
HelmSleep:
Type: ALIYUN::ROS::Sleep
DependsOn:
- ComputenestHelmApplication
Properties:
CreateDuration: 60
WaitUntil:
- Kind: Service
Name: spring-boot-chart
Namespace:
Ref: ALIYUN::StackName
JsonPath: $.status.loadBalancer.ingress[0].ip
Operator: NotEmpty
FirstMatch: true
Timeout: 300
# 获取service信息,输出到output中
ClusterApplicationResources:
Type: DATASOURCE::CS::ClusterApplicationResources
DependsOn:
- HelmSleep
- ComputenestHelmApplication
Properties:
ClusterId:
Fn::GetAtt:
- ManagedKubernetesCluster
- ClusterId
Fn::GetAtt:
- ManagedKubernetesCluster
- ClusterId
Kind: Service
Name: spring-boot-chart
Namespace:
Expand Down
25 changes: 14 additions & 11 deletions .computenest/ros_templates/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -245,16 +245,17 @@ Resources:
- Name: flannel
Config: ''
ComputenestHelmApplication:
Type: MODULE::ACS::ComputeNest::ClusterHelmApplication
Version: v2
Type: MODULE::ACS::ComputeNest::FluxOciHelmDeploy
Version: v1
DependsOn:
- ManagedKubernetesCluster
Properties:
ClusterId:
Fn::GetAtt:
- ManagedKubernetesCluster
- ClusterId
ChartIdentifier: '{{ computenest::helmpull::springBoot }}'
HelmChartUrl: '{{ computenest::helmchart::springBoot }}'
DockerConfigJson: '{{ computenest::helm::dockerconfigjson }}'
ChartValues:
image:
fullname: '{{ computenest::acrimage::springBootDemo }}'
Expand All @@ -265,18 +266,20 @@ Resources:
Namespace:
Ref: ALIYUN::StackName
ReleaseName: spring-boot-chart
# 睡眠1分钟,以便于获取资源时可以拿到
HelmSleep:
Type: ALIYUN::ROS::Sleep
DependsOn:
- ComputenestHelmApplication
Properties:
CreateDuration: 60
WaitUntil:
- Kind: Service
Name: spring-boot-chart
Namespace:
Ref: ALIYUN::StackName
JsonPath: $.status.loadBalancer.ingress[0].ip
Operator: NotEmpty
FirstMatch: true
Timeout: 300
# 获取service信息,输出到output中
ClusterApplicationResources:
Type: DATASOURCE::CS::ClusterApplicationResources
DependsOn:
- HelmSleep
- ComputenestHelmApplication
Properties:
ClusterId:
Fn::GetAtt:
Expand Down

0 comments on commit c4d0c21

Please sign in to comment.