This commit is contained in:
zeaslity
2024-10-30 16:30:51 +08:00
commit 437acbeb63
3363 changed files with 653948 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
{
"description":"",
"directory":"~.fastRequest~collections~Root~Default Group",
"filePath":"~.fastRequest~collections~Root~Default Group~",
"groupId":"1",
"id":"1",
"name":"Default Group",
"type":1
}

View File

@@ -0,0 +1,9 @@
{
"description":"",
"directory":"~.fastRequest~collections~Root",
"filePath":"~.fastRequest~collections~Root~",
"groupId":"-1",
"id":"0",
"name":"Root",
"type":1
}

View File

@@ -0,0 +1,23 @@
{
"dataList":[],
"envList":[],
"headerList":[],
"postScript":"",
"preScript":"",
"projectList":[],
"syncModel":{
"branch":"master",
"domain":"https://github.com",
"enabled":false,
"namingPolicy":"byDoc",
"owner":"",
"repo":"",
"repoUrl":"",
"syncAfterRun":false,
"token":"",
"type":"github"
},
"urlEncodedKeyValueList":[],
"urlParamsKeyValueList":[],
"urlSuffix":""
}

8
.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,8 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 数据源本地存储已忽略文件
/../../../../../../:\Users\wdd\Desktop\希腊项目-阿里云-德国\.idea/dataSources/
/dataSources.local.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="Go" enabled="true" />
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

12
.idea/dataSources.xml generated Normal file
View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="cmii@192.168.35.248" uuid="da65c4ab-9761-4932-8d77-09c9606d9b3e">
<driver-ref>mysql.8</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
<jdbc-url>jdbc:mysql://192.168.35.248:3306/cmii</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
</component>
</project>

6
.idea/encodings.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/16-重庆公安/9-back.yaml" charset="GB18030" />
</component>
</project>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="fastRequestCollection">
<option name="detail">
<CollectionDetail>
<option name="childList">
<list>
<CollectionDetail>
<option name="groupId" value="1" />
<option name="id" value="1" />
<option name="name" value="Default Group" />
<option name="type" value="1" />
</CollectionDetail>
</list>
</option>
<option name="groupId" value="-1" />
<option name="id" value="0" />
<option name="name" value="Root" />
<option name="type" value="1" />
</CollectionDetail>
</option>
</component>
</project>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="fastRequestCurrentProjectConfig">
<option name="domain" value="http://localhost:8000" />
<option name="enableEnv" value="agent" />
<option name="enableProject" value="ProjectOctopus" />
</component>
</project>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="fastRequestCurrentProjectLocalConfig">
<option name="domain" value="http://localhost:8000" />
<option name="enableEnv" value="agent" />
<option name="enableProject" value="ProjectOctopus" />
<option name="initFlag" value="1" />
</component>
</project>

23
.idea/fastRequestCollection.xml generated Normal file
View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="fastRequestCollection">
<option name="detail">
<CollectionDetail>
<option name="childList">
<list>
<CollectionDetail>
<option name="groupId" value="1" />
<option name="id" value="1" />
<option name="name" value="Default Group" />
<option name="type" value="1" />
</CollectionDetail>
</list>
</option>
<option name="groupId" value="-1" />
<option name="id" value="0" />
<option name="name" value="Root" />
<option name="type" value="1" />
</CollectionDetail>
</option>
</component>
</project>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="fastRequestCurrentProjectConfig">
<option name="domain" value="http://localhost:8000" />
<option name="enableEnv" value="agent" />
<option name="enableProject" value="ProjectOctopus" />
</component>
</project>

View File

@@ -0,0 +1,8 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="ShellCheck" enabled="true" level="ERROR" enabled_by_default="true">
<shellcheck_settings value="SC2129" />
</inspection_tool>
</profile>
</component>

204
.idea/intellij-javadocs-4.0.1.xml generated Normal file
View File

@@ -0,0 +1,204 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaDocConfiguration">
<GENERAL>
<MODE>UPDATE</MODE>
<OVERRIDDEN_METHODS>false</OVERRIDDEN_METHODS>
<SPLITTED_CLASS_NAME>true</SPLITTED_CLASS_NAME>
<LEVELS>
<LEVEL>TYPE</LEVEL>
<LEVEL>METHOD</LEVEL>
<LEVEL>FIELD</LEVEL>
</LEVELS>
<VISIBILITIES>
<VISIBILITY>PUBLIC</VISIBILITY>
<VISIBILITY>DEFAULT</VISIBILITY>
<VISIBILITY>PROTECTED</VISIBILITY>
</VISIBILITIES>
</GENERAL>
<TEMPLATES>
<CLASSES>
<CLASS>
<KEY>^.*(public|protected|private)*.+interface\s+\w+.*</KEY>
<VALUE>/**\n
* The interface ${name}.\n
&lt;#if element.typeParameters?has_content&gt; * \n
&lt;/#if&gt;
&lt;#list element.typeParameters as typeParameter&gt;
* @param &lt;${typeParameter.name}&gt; the type parameter\n
&lt;/#list&gt;
*/</VALUE>
</CLASS>
<CLASS>
<KEY>^.*(public|protected|private)*.+enum\s+\w+.*</KEY>
<VALUE>/**\n
* The enum ${name}.\n
*/</VALUE>
</CLASS>
<CLASS>
<KEY>^.*(public|protected|private)*.+class\s+\w+.*</KEY>
<VALUE>/**\n
* The type ${name}.\n
&lt;#if element.typeParameters?has_content&gt; * \n
&lt;/#if&gt;
&lt;#list element.typeParameters as typeParameter&gt;
* @param &lt;${typeParameter.name}&gt; the type parameter\n
&lt;/#list&gt;
*/</VALUE>
</CLASS>
<CLASS>
<KEY>.+</KEY>
<VALUE>/**\n
* The type ${name}.\n
*/</VALUE>
</CLASS>
</CLASSES>
<CONSTRUCTORS>
<CONSTRUCTOR>
<KEY>.+</KEY>
<VALUE>/**\n
* Instantiates a new ${name}.\n
&lt;#if element.parameterList.parameters?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.parameterList.parameters as parameter&gt;
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
&lt;/#list&gt;
&lt;#if element.throwsList.referenceElements?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.throwsList.referenceElements as exception&gt;
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
&lt;/#list&gt;
*/</VALUE>
</CONSTRUCTOR>
</CONSTRUCTORS>
<METHODS>
<METHOD>
<KEY>^.*(public|protected|private)*\s*.*(\w(\s*&lt;.+&gt;)*)+\s+get\w+\s*\(.*\).+</KEY>
<VALUE>/**\n
* Gets ${partName}.\n
&lt;#if element.typeParameters?has_content&gt; * \n
&lt;/#if&gt;
&lt;#list element.typeParameters as typeParameter&gt;
* @param &lt;${typeParameter.name}&gt; the type parameter\n
&lt;/#list&gt;
&lt;#if element.parameterList.parameters?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.parameterList.parameters as parameter&gt;
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
&lt;/#list&gt;
&lt;#if isNotVoid&gt;
*\n
* @return the ${partName}\n
&lt;/#if&gt;
&lt;#if element.throwsList.referenceElements?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.throwsList.referenceElements as exception&gt;
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
&lt;/#list&gt;
*/</VALUE>
</METHOD>
<METHOD>
<KEY>^.*(public|protected|private)*\s*.*(void|\w(\s*&lt;.+&gt;)*)+\s+set\w+\s*\(.*\).+</KEY>
<VALUE>/**\n
* Sets ${partName}.\n
&lt;#if element.typeParameters?has_content&gt; * \n
&lt;/#if&gt;
&lt;#list element.typeParameters as typeParameter&gt;
* @param &lt;${typeParameter.name}&gt; the type parameter\n
&lt;/#list&gt;
&lt;#if element.parameterList.parameters?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.parameterList.parameters as parameter&gt;
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
&lt;/#list&gt;
&lt;#if isNotVoid&gt;
*\n
* @return the ${partName}\n
&lt;/#if&gt;
&lt;#if element.throwsList.referenceElements?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.throwsList.referenceElements as exception&gt;
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
&lt;/#list&gt;
*/</VALUE>
</METHOD>
<METHOD>
<KEY>^.*((public\s+static)|(static\s+public))\s+void\s+main\s*\(\s*String\s*(\[\s*\]|\.\.\.)\s+\w+\s*\).+</KEY>
<VALUE>/**\n
* The entry point of application.\n
&lt;#if element.parameterList.parameters?has_content&gt;
*\n
&lt;/#if&gt;
* @param ${element.parameterList.parameters[0].name} the input arguments\n
&lt;#if element.throwsList.referenceElements?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.throwsList.referenceElements as exception&gt;
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
&lt;/#list&gt;
*/</VALUE>
</METHOD>
<METHOD>
<KEY>.+</KEY>
<VALUE>/**\n
* ${name}&lt;#if isNotVoid&gt; ${return}&lt;/#if&gt;.\n
&lt;#if element.typeParameters?has_content&gt; * \n
&lt;/#if&gt;
&lt;#list element.typeParameters as typeParameter&gt;
* @param &lt;${typeParameter.name}&gt; the type parameter\n
&lt;/#list&gt;
&lt;#if element.parameterList.parameters?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.parameterList.parameters as parameter&gt;
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
&lt;/#list&gt;
&lt;#if isNotVoid&gt;
*\n
* @return the ${return}\n
&lt;/#if&gt;
&lt;#if element.throwsList.referenceElements?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.throwsList.referenceElements as exception&gt;
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
&lt;/#list&gt;
*/</VALUE>
</METHOD>
</METHODS>
<FIELDS>
<FIELD>
<KEY>^.*(public|protected|private)*.+static.*(\w\s\w)+.+</KEY>
<VALUE>/**\n
* The constant ${element.getName()}.\n
*/</VALUE>
</FIELD>
<FIELD>
<KEY>^.*(public|protected|private)*.*(\w\s\w)+.+</KEY>
<VALUE>/**\n
&lt;#if element.parent.isInterface()&gt;
* The constant ${element.getName()}.\n
&lt;#else&gt;
* The ${name}.\n
&lt;/#if&gt; */</VALUE>
</FIELD>
<FIELD>
<KEY>.+</KEY>
<VALUE>/**\n
&lt;#if element.parent.isEnum()&gt;
*${name} ${typeName}.\n
&lt;#else&gt;
* The ${name}.\n
&lt;/#if&gt;*/</VALUE>
</FIELD>
</FIELDS>
</TEMPLATES>
</component>
</project>

5
.idea/misc.xml generated Normal file
View File

@@ -0,0 +1,5 @@
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="11" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

8
.idea/modules.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/22.希腊项目-阿里云-德国.iml" filepath="$PROJECT_DIR$/.idea/22.希腊项目-阿里云-德国.iml" />
</modules>
</component>
</project>

83
.idea/remote-targets.xml generated Normal file
View File

@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteTargetsManager">
<option name="projectDefaultTargetUuid" value="51624e4c-80a9-4a06-9313-56dab7118e52" />
<targets>
<target name="uav-core-test-1" type="ssh/sftp" uuid="2b521e8a-5592-48ea-a85b-c8de45124db5">
<config>
<option name="projectRootOnTarget" value="/root/wdd/" />
<option name="serverName" value="root@192.168.34.251:22 password" />
</config>
<ContributedStateBase type="BashSupportLanguageRuntime">
<config />
</ContributedStateBase>
</target>
<target name="uav-dev-01" type="ssh/sftp" uuid="a43dc362-6ebf-46cd-9ad3-382918a7c3a6">
<config>
<option name="projectRootOnTarget" value="/root/wdd/" />
<option name="serverName" value="root@192.168.11.170:22 password" />
</config>
<ContributedStateBase type="BashSupportLanguageRuntime">
<config />
</ContributedStateBase>
</target>
<target name="uav-ops-4" type="ssh/sftp" uuid="84e27999-efe5-4d80-aaa2-29a68c258adb">
<config>
<option name="projectRootOnTarget" value="/root/22.希腊项目-阿里云-德国" />
<option name="serverName" value="root@192.168.34.40:22 password" />
</config>
<ContributedStateBase type="BashSupportLanguageRuntime">
<config />
</ContributedStateBase>
</target>
<target name="euler-test-server" type="ssh/sftp" uuid="51624e4c-80a9-4a06-9313-56dab7118e52">
<config>
<option name="projectRootOnTarget" value="/root/octopus/" />
<option name="serverName" value="root@10.250.0.60:22 password" />
</config>
<ContributedStateBase type="BashSupportLanguageRuntime">
<config />
</ContributedStateBase>
</target>
<target name="LapPro-Ubuntu" type="ssh/sftp" uuid="ac4e16bb-33e8-4d2a-8c3f-55ed459a9e82">
<config>
<option name="projectRootOnTarget" value="/root/wdd/shell/" />
<option name="serverName" value="root@10.250.0.100:22 password" />
<option name="useRsync" value="true" />
</config>
<ContributedStateBase type="BashSupportLanguageRuntime">
<config />
</ContributedStateBase>
</target>
<target name="重庆林业局" type="ssh/sftp" uuid="30bb2030-7d69-4023-90e7-82aa867fe2df">
<config>
<option name="projectRootOnTarget" value="/root/wdd/remote/" />
<option name="serverName" value="root@36.134.28.60:22 password" />
<option name="useRsync" value="true" />
</config>
<ContributedStateBase type="BashSupportLanguageRuntime">
<config />
</ContributedStateBase>
</target>
<target name="35-71" type="ssh/sftp" uuid="77aa8fb3-ebc4-46fb-b1da-df2dcbe32be5">
<config>
<option name="projectRootOnTarget" value="/root/test" />
<option name="serverName" value="root@192.168.35.71:22 agent" />
<option name="useRsync" value="true" />
</config>
<ContributedStateBase type="BashSupportLanguageRuntime">
<config />
</ContributedStateBase>
</target>
<target name="WSL - Ubuntu" type="wsl" uuid="26027ea5-f011-4fd5-8604-885011e3554e">
<config>
<option name="distributionMsId" value="Ubuntu" />
<option name="projectRootOnTarget" value="{exitCode=0, timeout=false, cancelled=false, stdout=/tmp/tmp.se9bQXBPo2&#10;, stderr=}/22.希腊项目-阿里云-德国" />
</config>
<ContributedStateBase type="BashSupportLanguageRuntime">
<config />
</ContributedStateBase>
</target>
</targets>
</component>
</project>

8
.idea/runConfigurations/Pod_Core.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="删除状态为异常的Pod-Core" type="BashProRunConfiguration" singleton="false">
<target name="uav-core-test-1" />
<option name="scriptPath" value="$PROJECT_DIR$/../0-常用脚本/uavcloud-被cmii_operator替代/uavcloud-删除状态为异常的Pod.sh" />
<RunnerSettings bashdbVersion="Automatic" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2" />
</configuration>
</component>

10
.idea/runConfigurations/Pod_dev.xml generated Normal file
View File

@@ -0,0 +1,10 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="删除状态为异常的Pod-dev" type="BashProRunConfiguration" singleton="false">
<target name="uav-dev-01" />
<option name="scriptPath" value="$PROJECT_DIR$/../0-常用脚本/uavcloud-被cmii_operator替代/uavcloud-删除状态为异常的Pod.sh" />
<RunnerSettings bashdbVersion="Automatic" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2">
<option name="RunConfigurationTask" enabled="true" run_configuration_name="删除状态为异常的Pod-Core" run_configuration_type="BashProRunConfiguration" />
</method>
</configuration>
</component>

883
.idea/workspace_1.xml generated Normal file
View File

@@ -0,0 +1,883 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="536ce587-a268-4c42-86be-a9a7ea406a07" name="默认变更列表" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="BashSupport Pro Bash" />
</list>
</option>
</component>
<component name="GOROOT" url="file://$PROJECT_DIR$/../../../../../../../Program Files/Go" />
<component name="GitSEFilterConfiguration">
<file-type-list>
<filtered-out-file-type name="LOCAL_BRANCH" />
<filtered-out-file-type name="REMOTE_BRANCH" />
<filtered-out-file-type name="TAG" />
<filtered-out-file-type name="COMMIT_BY_MESSAGE" />
</file-type-list>
</component>
<component name="GoLibraries">
<option name="indexEntireGoPath" value="true" />
</component>
<component name="KubernetesApiProvider">{
&quot;isMigrated&quot;: true
}</component>
<component name="KubernetesSettings">
<option name="contextName" value="rke-cluster" />
</component>
<component name="MarkdownSettingsMigration">
<option name="stateVersion" value="1" />
</component>
<component name="ProjectColorInfo">{
&quot;customColor&quot;: &quot;&quot;,
&quot;associatedIndex&quot;: 2
}</component>
<component name="ProjectId" id="29YRFevtS0e3ceP6bRic8yRRUAg" />
<component name="ProjectViewState">
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"BashSupport Pro.00-install-all-demand-softwares.sh.executor": "Run",
"BashSupport Pro.deploy-nfs-server.sh.executor": "Run",
"BashSupport Pro.k8s-ssl-CVE-2016-2183-漏洞修复.sh.executor": "Run",
"BashSupport Pro.lap从35-71同步所有得离线镜像.sh.executor": "Run",
"BashSupport Pro.uavcloud-回复副本为0的deployment.sh.executor": "Run",
"BashSupport Pro.uavcloud-查看命名空间中所有configmap内容.sh.executor": "Run",
"BashSupport Pro.uavcloud-消灭重启次数过多的应用.sh.executor": "Run",
"BashSupport Pro.uavcloud-调整副本从0到2.sh.executor": "Run",
"BashSupport Pro.uavcloud-重启全部的应用.sh.executor": "Run",
"BashSupport Pro.uavcloud-重启特定的应用.sh.executor": "Run",
"BashSupport Pro.uavcloud-重启过多置0-CORE.executor": "Run",
"BashSupport Pro.uavcloud-重启过多置0-DEV.executor": "Run",
"BashSupport Pro.下载离线安装包.sh.executor": "Run",
"BashSupport Pro.删除状态为异常的Pod-Core.executor": "Run",
"BashSupport Pro.删除状态为异常的Pod-dev.executor": "Run",
"BashSupport Pro.删除状态为异常的Pod.sh.executor": "Run",
"BashSupport Pro.批量命令.sh.executor": "Run",
"BashSupport Pro.更改所有deployment的版本号.sh.executor": "Run",
"BashSupport Pro.清除3571上错误的tag.sh.executor": "Run",
"BashSupport Pro.离线更新脚本.sh.executor": "Run",
"PowerShell.1-proxy-setup.ps1.executor": "Run",
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"RunOnceActivity.go.format.on.save.advertiser.fired": "true",
"RunOnceActivity.go.formatter.settings.were.checked": "true",
"RunOnceActivity.go.migrated.go.modules.settings": "true",
"WebServerToolWindowFactoryState": "false",
"com.google.cloudcode.ide_session_index": "20221216_0001",
"go.import.settings.migrated": "true",
"go.sdk.automatically.set": "true",
"ignore.virus.scanning.warn.message": "true",
"jdk.selected.JAVA_MODULE": "semeru-17",
"kotlin-language-version-configured": "true",
"last_opened_file_path": "D:/NextCloudData/MasterLoad/Work/UAV Cloud/22.希腊项目-阿里云-德国/27-深圳政数局",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
"project.structure.last.edited": "SDKs",
"project.structure.proportion": "0.15",
"project.structure.side.proportion": "0.2",
"run.code.analysis.last.selected.profile": "pProject Default",
"settings.editor.selected.configurable": "preferences.lookFeel",
"vue.rearranger.settings.migration": "true"
}
}]]></component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="D:\NextCloudData\MasterLoad\Work\UAV Cloud\22.希腊项目-阿里云-德国\27-深圳政数局" />
<recent name="D:\NextCloudData\MasterLoad\Work\UAV Cloud\22.希腊项目-阿里云-德国\29-重庆三化" />
<recent name="D:\NextCloudData\MasterLoad\Work\UAV Cloud\22.希腊项目-阿里云-德国\28-生产环境hw" />
<recent name="D:\NextCloudData\MasterLoad\Work\UAV Cloud\22.希腊项目-阿里云-德国\998-常用脚本\容器镜像ARM" />
<recent name="D:\NextCloudData\MasterLoad\Work\UAV Cloud\22.希腊项目-阿里云-德国\999-数据库脚本" />
</key>
<key name="MoveFile.RECENT_KEYS">
<recent name="D:\NextCloudData\MasterLoad\Work\UAV Cloud\22.希腊项目-阿里云-德国\998-常用脚本\镜像同步" />
<recent name="D:\NextCloudData\MasterLoad\Work\UAV Cloud\22.希腊项目-阿里云-德国" />
<recent name="D:\NextCloudData\MasterLoad\Work\UAV Cloud\22.希腊项目-阿里云-德国\998-常用脚本\部署脚本" />
<recent name="D:\NextCloudData\MasterLoad\Work\UAV Cloud\22.希腊项目-阿里云-德国\999-数据库脚本\5.5.0" />
<recent name="C:\Users\wddsh\Nextcloud\MasterLoad\Work\UAV Cloud\22.希腊项目-阿里云-德国\6-厦门移动-4.1.0" />
</key>
</component>
<component name="RunManager">
<configuration default="true" type="DjangoTestsConfigurationType">
<module name="希腊项目-阿里云-德国" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="TARGET" value="" />
<option name="SETTINGS_FILE" value="" />
<option name="CUSTOM_SETTINGS" value="false" />
<option name="USE_OPTIONS" value="false" />
<option name="OPTIONS" value="" />
<method v="2" />
</configuration>
<configuration default="true" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="希腊项目-阿里云-德国" />
<working_directory value="$PROJECT_DIR$" />
<go_parameters value="-i" />
<kind value="FILE" />
<directory value="$PROJECT_DIR$" />
<filePath value="$PROJECT_DIR$" />
<method v="2" />
</configuration>
<configuration default="true" type="GoTestRunConfiguration" factoryName="Go Test">
<module name="希腊项目-阿里云-德国" />
<working_directory value="$PROJECT_DIR$" />
<go_parameters value="-i" />
<kind value="DIRECTORY" />
<directory value="$PROJECT_DIR$" />
<filePath value="$PROJECT_DIR$" />
<framework value="gotest" />
<method v="2" />
</configuration>
<configuration default="true" type="PythonConfigurationType" factoryName="Python">
<module name="希腊项目-阿里云-德国" />
<option name="ENV_FILES" value="" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration default="true" type="PythonConfigurationType" factoryName="Python">
<module name="希腊项目-阿里云-德国" />
<option name="ENV_FILES" value="" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration default="true" type="Python.FlaskServer">
<module name="希腊项目-阿里云-德国" />
<option name="ENV_FILES" value="" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="launchJavascriptDebuger" value="false" />
<method v="2" />
</configuration>
<configuration default="true" type="Python.FlaskServer">
<module name="希腊项目-阿里云-德国" />
<option name="ENV_FILES" value="" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="launchJavascriptDebuger" value="false" />
<method v="2" />
</configuration>
<configuration default="true" type="Tox" factoryName="Tox">
<module name="希腊项目-阿里云-德国" />
<option name="ENV_FILES" value="" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<method v="2" />
</configuration>
<configuration default="true" type="Tox" factoryName="Tox">
<module name="希腊项目-阿里云-德国" />
<option name="ENV_FILES" value="" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<method v="2" />
</configuration>
<configuration name="00-install-all-demand-softwares.sh" type="BashProRunConfiguration">
<option name="outputCharset" value="UTF-8" />
<target name="重庆林业局" />
<option name="scriptPath" value="$PROJECT_DIR$/17-重庆林业局/00-install-all-demand-softwares.sh" />
<RunnerSettings bashdbVersion="Automatic" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2" />
</configuration>
<configuration name="00-install-all-demand-softwares.sh" type="BashProRunConfiguration">
<option name="outputCharset" value="UTF-8" />
<target name="重庆林业局" />
<option name="scriptPath" value="$PROJECT_DIR$/17-重庆林业局/00-install-all-demand-softwares.sh" />
<RunnerSettings bashdbVersion="Automatic" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2" />
</configuration>
<configuration name="清除3571上错误的tag.sh" type="BashProRunConfiguration">
<target name="35-71" />
<option name="scriptPath" value="$PROJECT_DIR$/0-常用脚本/清除3571上错误的tag.sh" />
<RunnerSettings bashdbVersion="Automatic" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2" />
</configuration>
<configuration name="清除3571上错误的tag.sh" type="BashProRunConfiguration">
<target name="35-71" />
<option name="scriptPath" value="$PROJECT_DIR$/0-常用脚本/清除3571上错误的tag.sh" />
<RunnerSettings bashdbVersion="Automatic" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2" />
</configuration>
<configuration name="下载离线安装包.sh" type="BashProRunConfiguration">
<target name="重庆林业局" />
<option name="scriptPath" value="$PROJECT_DIR$/0-常用脚本/工具脚本/centos下载离线安装包.sh" />
<RunnerSettings bashdbVersion="Automatic" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2" />
</configuration>
<configuration name="批量命令.sh" type="BashProRunConfiguration">
<target name="uav-ops-4" />
<option name="scriptPath" value="$PROJECT_DIR$/26-开发高可用集群/批量命令.sh" />
<RunnerSettings bashdbVersion="Automatic" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2" />
</configuration>
<configuration name="批量命令.sh" type="BashProRunConfiguration" temporary="true">
<target name="uav-ops-4" />
<option name="scriptPath" value="$PROJECT_DIR$/26-开发高可用集群/批量命令.sh" />
<RunnerSettings bashdbVersion="Automatic" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2" />
</configuration>
<configuration name="批量命令.sh" type="BashProRunConfiguration" temporary="true">
<target name="uav-ops-4" />
<option name="scriptPath" value="$PROJECT_DIR$/26-开发高可用集群/批量命令.sh" />
<RunnerSettings bashdbVersion="Automatic" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2" />
</configuration>
<configuration name="批量命令.sh" type="BashProRunConfiguration">
<target name="uav-ops-4" />
<option name="scriptPath" value="$PROJECT_DIR$/26-开发高可用集群/批量命令.sh" />
<RunnerSettings bashdbVersion="Automatic" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2" />
</configuration>
<configuration name="批量命令.sh" type="BashProRunConfiguration" temporary="true">
<target name="uav-ops-4" />
<option name="scriptPath" value="$PROJECT_DIR$/26-开发高可用集群/批量命令.sh" />
<RunnerSettings bashdbVersion="Automatic" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2" />
</configuration>
<configuration name="批量命令.sh" type="BashProRunConfiguration">
<target name="uav-ops-4" />
<option name="scriptPath" value="$PROJECT_DIR$/26-开发高可用集群/批量命令.sh" />
<RunnerSettings bashdbVersion="Automatic" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2" />
</configuration>
<configuration name="下载离线安装包.sh" type="BashProRunConfiguration">
<target name="重庆林业局" />
<option name="scriptPath" value="$PROJECT_DIR$/0-常用脚本/工具脚本/centos下载离线安装包.sh" />
<RunnerSettings bashdbVersion="Automatic" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2" />
</configuration>
<configuration name="离线更新脚本.sh" type="BashProRunConfiguration">
<target name="root@192.168.35.71:22" />
<option name="scriptParameters" value="cmii-uav-surveillance=5.2.0-27031-cqga=2024-03-04=573.tar.gz" />
<option name="scriptPath" value="$PROJECT_DIR$/16-重庆公安/离线更新脚本.sh" />
<RunnerSettings bashdbVersion="Automatic" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2" />
</configuration>
<configuration name="deploy-nfs-server.sh" type="BashProRunConfiguration">
<target name="重庆林业局" />
<option name="scriptPath" value="$PROJECT_DIR$/0-常用脚本/部署脚本/deploy-nfs-server.sh" />
<RunnerSettings bashdbVersion="Automatic" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2" />
</configuration>
<configuration name="deploy-nfs-server.sh" type="BashProRunConfiguration">
<target name="重庆林业局" />
<option name="scriptPath" value="$PROJECT_DIR$/0-常用脚本/部署脚本/deploy-nfs-server.sh" />
<RunnerSettings bashdbVersion="Automatic" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2" />
</configuration>
<configuration name="更改所有deployment的版本号.sh" type="BashProRunConfiguration">
<option name="outputCharset" value="UTF-8" />
<target name="root@192.168.34.251:22" />
<option name="scriptPath" value="$PROJECT_DIR$/14-UAT-CHBN/更改所有deployment的版本号.sh" />
<RunnerSettings bashdbVersion="BashV4" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2" />
</configuration>
<configuration name="更改所有deployment的版本号.sh" type="BashProRunConfiguration">
<option name="outputCharset" value="UTF-8" />
<target name="root@192.168.34.251:22" />
<option name="scriptPath" value="$PROJECT_DIR$/14-UAT-CHBN/更改所有deployment的版本号.sh" />
<RunnerSettings bashdbVersion="BashV4" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2" />
</configuration>
<configuration name="k8s-ssl-CVE-2016-2183-漏洞修复.sh" type="BashProRunConfiguration">
<target name="uav-ops-4" />
<option name="scriptPath" value="$PROJECT_DIR$/15-漏洞修复/demo环境漏洞修复/k8s-ssl-CVE-2016-2183-漏洞修复.sh" />
<RunnerSettings bashdbVersion="Automatic" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2" />
</configuration>
<configuration name="k8s-ssl-CVE-2016-2183-漏洞修复.sh" type="BashProRunConfiguration">
<target name="uav-ops-4" />
<option name="scriptPath" value="$PROJECT_DIR$/15-漏洞修复/demo环境漏洞修复/k8s-ssl-CVE-2016-2183-漏洞修复.sh" />
<RunnerSettings bashdbVersion="Automatic" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2" />
</configuration>
<configuration name="lap从35-71同步所有得离线镜像.sh" type="BashProRunConfiguration">
<target name="LapPro-Ubuntu" />
<option name="scriptPath" value="$PROJECT_DIR$/0-常用脚本/工具脚本/lap从35-71同步所有得离线镜像.sh" />
<RunnerSettings bashdbVersion="Automatic" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2" />
</configuration>
<configuration name="lap从35-71同步所有得离线镜像.sh" type="BashProRunConfiguration">
<target name="LapPro-Ubuntu" />
<option name="scriptPath" value="$PROJECT_DIR$/0-常用脚本/工具脚本/lap从35-71同步所有得离线镜像.sh" />
<RunnerSettings bashdbVersion="Automatic" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2" />
</configuration>
<configuration name="uavcloud-重启过多置0-CORE" type="BashProRunConfiguration">
<option name="outputCharset" value="ISO-8859-1" />
<target name="uav-core-test-1" />
<option name="scriptPath" value="$PROJECT_DIR$/0-常用脚本/uavcloud-被cmii_operator替代/uavcloud-消灭重启次数过多的应用.sh" />
<RunnerSettings bashdbVersion="BashV5" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2">
<option name="RunConfigurationTask" enabled="true" run_configuration_name="uavcloud-重启过多置0-DEV" run_configuration_type="BashProRunConfiguration" />
</method>
</configuration>
<configuration name="uavcloud-重启过多置0-CORE" type="BashProRunConfiguration">
<option name="outputCharset" value="ISO-8859-1" />
<target name="uav-core-test-1" />
<option name="scriptPath" value="$PROJECT_DIR$/0-常用脚本/uavcloud-被cmii_operator替代/uavcloud-消灭重启次数过多的应用.sh" />
<RunnerSettings bashdbVersion="BashV5" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2">
<option name="RunConfigurationTask" enabled="true" run_configuration_name="uavcloud-重启过多置0-DEV" run_configuration_type="BashProRunConfiguration" />
</method>
</configuration>
<configuration name="uavcloud-重启过多置0-DEV" type="BashProRunConfiguration">
<option name="outputCharset" value="ISO-8859-1" />
<target name="uav-dev-01" />
<option name="scriptPath" value="$PROJECT_DIR$/0-常用脚本/uavcloud-被cmii_operator替代/uavcloud-消灭重启次数过多的应用.sh" />
<RunnerSettings bashdbVersion="BashV5" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2" />
</configuration>
<configuration name="uavcloud-重启过多置0-DEV" type="BashProRunConfiguration">
<option name="outputCharset" value="ISO-8859-1" />
<target name="uav-dev-01" />
<option name="scriptPath" value="$PROJECT_DIR$/0-常用脚本/uavcloud-被cmii_operator替代/uavcloud-消灭重启次数过多的应用.sh" />
<RunnerSettings bashdbVersion="BashV5" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2" />
</configuration>
<configuration name="uavcloud-调整副本从0到2.sh" type="BashProRunConfiguration">
<option name="scriptPath" value="$PROJECT_DIR$/12-连云港公安-5.1.0/common-usage/uavcloud-调整副本数量.sh" />
<RunnerSettings bashdbVersion="Automatic" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2" />
</configuration>
<configuration name="uavcloud-调整副本从0到2.sh" type="BashProRunConfiguration">
<option name="scriptPath" value="$PROJECT_DIR$/12-连云港公安-5.1.0/common-usage/uavcloud-调整副本数量.sh" />
<RunnerSettings bashdbVersion="Automatic" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2" />
</configuration>
<configuration name="uavcloud-回复副本为0的deployment.sh" type="BashProRunConfiguration">
<target name="uav-dev-01" />
<option name="scriptPath" value="$PROJECT_DIR$/0-常用脚本/uavcloud-被cmii_operator替代/uavcloud-回复副本为0的deployment.sh" />
<RunnerSettings bashdbVersion="Automatic" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2" />
</configuration>
<configuration name="uavcloud-回复副本为0的deployment.sh" type="BashProRunConfiguration">
<target name="uav-dev-01" />
<option name="scriptPath" value="$PROJECT_DIR$/0-常用脚本/uavcloud-被cmii_operator替代/uavcloud-回复副本为0的deployment.sh" />
<RunnerSettings bashdbVersion="Automatic" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2" />
</configuration>
<configuration name="uavcloud-重启全部的应用.sh" type="BashProRunConfiguration" temporary="true">
<option name="scriptPath" value="$PROJECT_DIR$/12-连云港公安-5.1.0/common-usage/uavcloud-重启全部的应用.sh" />
<method v="2" />
</configuration>
<configuration name="uavcloud-重启全部的应用.sh" type="BashProRunConfiguration" temporary="true">
<option name="scriptPath" value="$PROJECT_DIR$/12-连云港公安-5.1.0/common-usage/uavcloud-重启全部的应用.sh" />
<method v="2" />
</configuration>
<configuration name="uavcloud-重启特定的应用.sh" type="BashProRunConfiguration" temporary="true">
<option name="scriptPath" value="$PROJECT_DIR$/12-连云港公安-5.1.0/common-usage/uavcloud-重启-副本数量.sh" />
<method v="2" />
</configuration>
<configuration name="uavcloud-查看命名空间中所有configmap内容.sh" type="BashProRunConfiguration">
<target name="uav-core-test-1" />
<option name="scriptPath" value="$PROJECT_DIR$/0-常用脚本/uavcloud-被cmii_operator替代/uavcloud-查看命名空间中所有configmap内容.sh" />
<RunnerSettings bashdbVersion="Automatic" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2" />
</configuration>
<configuration name="uavcloud-查看命名空间中所有configmap内容.sh" type="BashProRunConfiguration">
<target name="uav-core-test-1" />
<option name="scriptPath" value="$PROJECT_DIR$/0-常用脚本/uavcloud-被cmii_operator替代/uavcloud-查看命名空间中所有configmap内容.sh" />
<RunnerSettings bashdbVersion="Automatic" bashPathMapper="Automatic" RunnerId="pro.bashsupport.shDebugRunner" />
<method v="2" />
</configuration>
<configuration default="true" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="希腊项目-阿里云-德国" />
<working_directory value="$PROJECT_DIR$" />
<go_parameters value="-i" />
<kind value="FILE" />
<directory value="$PROJECT_DIR$" />
<filePath value="$PROJECT_DIR$" />
<method v="2" />
</configuration>
<configuration default="true" type="GoTestRunConfiguration" factoryName="Go Test">
<module name="希腊项目-阿里云-德国" />
<working_directory value="$PROJECT_DIR$" />
<go_parameters value="-i" />
<kind value="DIRECTORY" />
<directory value="$PROJECT_DIR$" />
<filePath value="$PROJECT_DIR$" />
<framework value="gotest" />
<method v="2" />
</configuration>
<configuration name="1-proxy-setup.ps1" type="PowerShellRunType" factoryName="PowerShell" temporary="true" scriptUrl="$PROJECT_DIR$/19-上海雷视/1-proxy-setup.ps1" workingDirectory="C:\Users\wddsh" executablePath="$PROJECT_DIR$/../../../../../../../Windows/System32/WindowsPowerShell/v1.0/powershell.exe">
<envs />
<method v="2" />
</configuration>
<configuration name="1-proxy-setup.ps1" type="PowerShellRunType" factoryName="PowerShell" temporary="true" scriptUrl="$PROJECT_DIR$/19-上海雷视/1-proxy-setup.ps1" workingDirectory="C:\Users\wddsh" executablePath="$PROJECT_DIR$/../../../../../../../Windows/System32/WindowsPowerShell/v1.0/powershell.exe">
<envs />
<method v="2" />
</configuration>
</component>
<component name="SharedIndexes">
<attachedChunks>
<set>
<option value="bundled-jdk-9823dce3aa75-b114ca120d71-intellij.indexing.shared.core-IU-242.20224.419" />
</set>
</attachedChunks>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="默认任务">
<changelist id="536ce587-a268-4c42-86be-a9a7ea406a07" name="默认变更列表" comment="" />
<created>1653287930427</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1653287930427</updated>
<workItem from="1653287931662" duration="7481000" />
<workItem from="1653458002388" duration="5154000" />
<workItem from="1653630320928" duration="4308000" />
<workItem from="1653873520244" duration="284000" />
<workItem from="1653875140037" duration="15368000" />
<workItem from="1653966593588" duration="1123000" />
<workItem from="1653976264777" duration="25090000" />
<workItem from="1654479875116" duration="5119000" />
<workItem from="1659412035614" duration="9962000" />
<workItem from="1659494508062" duration="1292000" />
<workItem from="1659923625074" duration="4996000" />
<workItem from="1659943895997" duration="16600000" />
<workItem from="1660034833244" duration="1613000" />
<workItem from="1660095207100" duration="6485000" />
<workItem from="1660114711677" duration="4932000" />
<workItem from="1660198379225" duration="12136000" />
<workItem from="1660525792807" duration="48209000" />
<workItem from="1661409375146" duration="16384000" />
<workItem from="1661757807739" duration="6539000" />
<workItem from="1661839830177" duration="22997000" />
<workItem from="1662692074205" duration="8022000" />
<workItem from="1663036095769" duration="1610000" />
<workItem from="1663319412391" duration="87000" />
<workItem from="1663319512826" duration="2174000" />
<workItem from="1663554896267" duration="8799000" />
<workItem from="1663659433000" duration="10515000" />
<workItem from="1664156538751" duration="344000" />
<workItem from="1664157258461" duration="1251000" />
<workItem from="1664433171017" duration="511000" />
<workItem from="1664433760386" duration="3603000" />
<workItem from="1665299351894" duration="2661000" />
<workItem from="1665373258253" duration="18000" />
<workItem from="1665457759742" duration="2378000" />
<workItem from="1665987986296" duration="1079000" />
<workItem from="1666169070993" duration="740000" />
<workItem from="1666678025967" duration="4055000" />
<workItem from="1666765127900" duration="619000" />
<workItem from="1666772921175" duration="1054000" />
<workItem from="1667196457858" duration="1641000" />
<workItem from="1667202590505" duration="4655000" />
<workItem from="1667284710404" duration="1353000" />
<workItem from="1667286891937" duration="18889000" />
<workItem from="1667445065742" duration="11000" />
<workItem from="1667456961956" duration="7631000" />
<workItem from="1668650197491" duration="6154000" />
<workItem from="1668680514776" duration="597000" />
<workItem from="1668755744752" duration="776000" />
<workItem from="1669099167300" duration="1553000" />
<workItem from="1669101055728" duration="2856000" />
<workItem from="1669173565133" duration="1318000" />
<workItem from="1669178158575" duration="3994000" />
<workItem from="1669707860073" duration="713000" />
<workItem from="1669789170654" duration="8878000" />
<workItem from="1669873612650" duration="53000" />
<workItem from="1669876511419" duration="2486000" />
<workItem from="1669948157161" duration="4165000" />
<workItem from="1669960369768" duration="2010000" />
<workItem from="1669965620429" duration="1950000" />
<workItem from="1669972051865" duration="442000" />
<workItem from="1670205899738" duration="8235000" />
<workItem from="1670233201081" duration="133000" />
<workItem from="1670233549976" duration="939000" />
<workItem from="1670463109495" duration="3158000" />
<workItem from="1670479679445" duration="4841000" />
<workItem from="1670566318209" duration="10845000" />
<workItem from="1670581006494" duration="71000" />
<workItem from="1670826567737" duration="4225000" />
<workItem from="1671178524516" duration="97071000" />
<workItem from="1673942094864" duration="231000" />
<workItem from="1676267908435" duration="861000" />
<workItem from="1676272980272" duration="412000" />
<workItem from="1676274246861" duration="1809000" />
<workItem from="1677045275225" duration="659000" />
<workItem from="1677728040197" duration="826000" />
<workItem from="1677736045109" duration="599000" />
<workItem from="1681450974797" duration="1130000" />
<workItem from="1685324368525" duration="17269000" />
<workItem from="1685409909814" duration="35231000" />
<workItem from="1685583422804" duration="6399000" />
<workItem from="1685668978991" duration="5578000" />
<workItem from="1685930656147" duration="11618000" />
<workItem from="1686117656483" duration="25406000" />
<workItem from="1686532873695" duration="595000" />
<workItem from="1686643358477" duration="7265000" />
<workItem from="1686878873283" duration="596000" />
<workItem from="1687143305269" duration="416000" />
<workItem from="1687143826364" duration="28000" />
<workItem from="1687143867025" duration="596000" />
<workItem from="1687226741026" duration="10214000" />
<workItem from="1687656264704" duration="647000" />
<workItem from="1687657264242" duration="1239000" />
<workItem from="1687742403817" duration="1321000" />
<workItem from="1689318904585" duration="2294000" />
<workItem from="1689580814640" duration="1747000" />
<workItem from="1689645288377" duration="31000" />
<workItem from="1689648084973" duration="7422000" />
<workItem from="1689922360667" duration="15756000" />
<workItem from="1690163346505" duration="29745000" />
<workItem from="1690421328158" duration="352000" />
<workItem from="1690854596224" duration="2157000" />
<workItem from="1690944047626" duration="992000" />
<workItem from="1690955243056" duration="3207000" />
<workItem from="1691026106746" duration="142000" />
<workItem from="1691563406506" duration="2598000" />
<workItem from="1691996825411" duration="4088000" />
<workItem from="1692069071411" duration="34000" />
<workItem from="1692861655714" duration="24709000" />
<workItem from="1693186957967" duration="4719000" />
<workItem from="1693192626727" duration="11695000" />
<workItem from="1693280575699" duration="610000" />
<workItem from="1693295450063" duration="6000" />
<workItem from="1693363361254" duration="786000" />
<workItem from="1693460588621" duration="5525000" />
<workItem from="1693534366828" duration="57000" />
<workItem from="1693535004514" duration="6001000" />
<workItem from="1694397421236" duration="16778000" />
<workItem from="1694498478218" duration="6000" />
<workItem from="1694500439349" duration="66000" />
<workItem from="1694571951196" duration="3000" />
<workItem from="1694588953618" duration="1978000" />
<workItem from="1694698028699" duration="599000" />
<workItem from="1694740686013" duration="2205000" />
<workItem from="1694746011845" duration="559000" />
<workItem from="1695003648967" duration="50151000" />
<workItem from="1695201136366" duration="2000000" />
<workItem from="1695203281423" duration="4420000" />
<workItem from="1695611357919" duration="7264000" />
<workItem from="1695691085873" duration="1156000" />
<workItem from="1695716411140" duration="3387000" />
<workItem from="1695784691052" duration="10555000" />
<workItem from="1696126268621" duration="5000" />
<workItem from="1696646933578" duration="6353000" />
<workItem from="1696667084493" duration="1224000" />
<workItem from="1697078008958" duration="3048000" />
<workItem from="1697096600174" duration="5937000" />
<workItem from="1698461230584" duration="2056000" />
<workItem from="1698475606618" duration="8295000" />
<workItem from="1698631647202" duration="1214000" />
<workItem from="1698633643184" duration="5452000" />
<workItem from="1698646395101" duration="6390000" />
<workItem from="1698715555654" duration="5813000" />
<workItem from="1698736019149" duration="4599000" />
<workItem from="1699424693797" duration="845000" />
<workItem from="1699430324617" duration="1448000" />
<workItem from="1699432788105" duration="498000" />
<workItem from="1699508854963" duration="789000" />
<workItem from="1699513519934" duration="3002000" />
<workItem from="1699840654297" duration="1261000" />
<workItem from="1699931994159" duration="2773000" />
<workItem from="1700039208825" duration="801000" />
<workItem from="1700099993929" duration="601000" />
<workItem from="1700116483859" duration="2028000" />
<workItem from="1700188115850" duration="227000" />
<workItem from="1700188410662" duration="599000" />
<workItem from="1700443128353" duration="7155000" />
<workItem from="1700536168822" duration="15536000" />
<workItem from="1700644680217" duration="32000" />
<workItem from="1701912403161" duration="8255000" />
<workItem from="1701928017473" duration="724000" />
<workItem from="1701929782158" duration="4771000" />
<workItem from="1701935344261" duration="21383000" />
<workItem from="1702257698369" duration="4139000" />
<workItem from="1702262445711" duration="7707000" />
<workItem from="1702284646665" duration="15118000" />
<workItem from="1702430735936" duration="442000" />
<workItem from="1702434796604" duration="3310000" />
<workItem from="1702455900324" duration="14000" />
<workItem from="1702456028103" duration="699000" />
<workItem from="1702612128694" duration="3727000" />
<workItem from="1702867689253" duration="2503000" />
<workItem from="1703147857035" duration="1161000" />
<workItem from="1703556095950" duration="18580000" />
<workItem from="1703645719814" duration="13848000" />
<workItem from="1703728974537" duration="70000" />
<workItem from="1703729085882" duration="3786000" />
<workItem from="1703745329152" duration="5511000" />
<workItem from="1703813282513" duration="1084000" />
<workItem from="1703831007882" duration="2054000" />
<workItem from="1704158054927" duration="54420000" />
<workItem from="1704676540705" duration="3458000" />
<workItem from="1704787095969" duration="5673000" />
<workItem from="1705305128006" duration="14000" />
<workItem from="1705306023607" duration="626000" />
<workItem from="1705386066840" duration="236000" />
<workItem from="1705477361614" duration="207000" />
<workItem from="1705480630088" duration="3459000" />
<workItem from="1705635357723" duration="7443000" />
<workItem from="1705911369234" duration="2690000" />
<workItem from="1705980729319" duration="96000" />
<workItem from="1705989475640" duration="3068000" />
<workItem from="1706060227378" duration="5389000" />
<workItem from="1706084688214" duration="1700000" />
<workItem from="1706163958578" duration="396000" />
<workItem from="1706164366170" duration="10556000" />
<workItem from="1706239417150" duration="689000" />
<workItem from="1706325146302" duration="1702000" />
<workItem from="1706327396142" duration="122000" />
<workItem from="1706327530973" duration="599000" />
<workItem from="1706409791139" duration="791000" />
<workItem from="1706415398503" duration="1243000" />
<workItem from="1706494810488" duration="4557000" />
<workItem from="1706503169073" duration="14451000" />
<workItem from="1706603560897" duration="11539000" />
<workItem from="1706695523259" duration="186000" />
<workItem from="1706696594896" duration="358000" />
<workItem from="1706755060128" duration="6281000" />
<workItem from="1706775432807" duration="160000" />
<workItem from="1709006527546" duration="829000" />
<workItem from="1709192114682" duration="628000" />
<workItem from="1709282311726" duration="682000" />
<workItem from="1709516344330" duration="3082000" />
<workItem from="1709533543118" duration="2395000" />
<workItem from="1709537593943" duration="2246000" />
<workItem from="1709540251395" duration="21513000" />
<workItem from="1709705339864" duration="9091000" />
<workItem from="1709797787731" duration="10565000" />
<workItem from="1709877638906" duration="969000" />
<workItem from="1709879057541" duration="4000" />
<workItem from="1709884678798" duration="4290000" />
<workItem from="1709891341438" duration="3117000" />
<workItem from="1710126952853" duration="3000" />
<workItem from="1710207504828" duration="4359000" />
<workItem from="1710293074549" duration="597000" />
<workItem from="1710312890547" duration="678000" />
<workItem from="1710402161605" duration="8133000" />
<workItem from="1710724106186" duration="1109000" />
<workItem from="1710828922408" duration="2229000" />
<workItem from="1710896466404" duration="1012000" />
<workItem from="1710898563824" duration="3232000" />
<workItem from="1711003476122" duration="34000" />
<workItem from="1711070662404" duration="718000" />
<workItem from="1711075396957" duration="3865000" />
<workItem from="1711088503642" duration="1783000" />
<workItem from="1711329683458" duration="3908000" />
<workItem from="1711345666193" duration="3291000" />
<workItem from="1711353831911" duration="2645000" />
<workItem from="1711421081061" duration="2365000" />
<workItem from="1711435256183" duration="613000" />
<workItem from="1711593432421" duration="2271000" />
<workItem from="1711608498753" duration="612000" />
<workItem from="1711611828628" duration="801000" />
<workItem from="1711617026309" duration="1140000" />
<workItem from="1711676055330" duration="2320000" />
<workItem from="1712455426402" duration="13000" />
<workItem from="1712473761506" duration="91000" />
<workItem from="1712474204716" duration="73000" />
<workItem from="1712474286055" duration="1484000" />
<workItem from="1712475915381" duration="9000" />
<workItem from="1712475931313" duration="2001000" />
<workItem from="1712540257716" duration="500000" />
<workItem from="1712541535910" duration="7842000" />
<workItem from="1712567513291" duration="447000" />
<workItem from="1712643096324" duration="1466000" />
<workItem from="1712646418805" duration="655000" />
<workItem from="1712906213006" duration="22000" />
<workItem from="1712907960003" duration="3490000" />
<workItem from="1712913030784" duration="1030000" />
<workItem from="1712999253993" duration="3310000" />
<workItem from="1713056026159" duration="2423000" />
<workItem from="1713067664110" duration="2534000" />
<workItem from="1713150627880" duration="9000" />
<workItem from="1713150641260" duration="2384000" />
<workItem from="1713161764325" duration="1794000" />
<workItem from="1713166484744" duration="4348000" />
<workItem from="1713322933139" duration="809000" />
<workItem from="1713324030118" duration="203000" />
<workItem from="1713343472998" duration="718000" />
<workItem from="1713404365084" duration="1322000" />
<workItem from="1713408099081" duration="6393000" />
<workItem from="1713513373225" duration="1421000" />
<workItem from="1713923654098" duration="1066000" />
<workItem from="1713928529313" duration="223000" />
<workItem from="1713929588086" duration="477000" />
<workItem from="1713931002835" duration="774000" />
<workItem from="1713937645573" duration="10001000" />
<workItem from="1714007428939" duration="605000" />
<workItem from="1714008828846" duration="232000" />
<workItem from="1714009071584" duration="4998000" />
<workItem from="1714034778723" duration="434000" />
<workItem from="1714095098840" duration="1141000" />
<workItem from="1714101454736" duration="647000" />
<workItem from="1714102616602" duration="544000" />
<workItem from="1714110371171" duration="4118000" />
<workItem from="1714116995463" duration="1552000" />
<workItem from="1714119949315" duration="560000" />
<workItem from="1715052013546" duration="877000" />
<workItem from="1715131554795" duration="8125000" />
<workItem from="1715305489843" duration="4405000" />
<workItem from="1715995123969" duration="3000" />
<workItem from="1715995333597" duration="133000" />
<workItem from="1715999224873" duration="361000" />
<workItem from="1716000131458" duration="95000" />
<workItem from="1716000521744" duration="1206000" />
<workItem from="1716002779594" duration="1044000" />
<workItem from="1716172101314" duration="2663000" />
<workItem from="1716187202674" duration="249000" />
<workItem from="1716191241250" duration="612000" />
<workItem from="1716947679768" duration="1470000" />
<workItem from="1716950698186" duration="62000" />
<workItem from="1716966421467" duration="625000" />
<workItem from="1717052009930" duration="879000" />
<workItem from="1717053868354" duration="1493000" />
<workItem from="1717124638091" duration="3232000" />
<workItem from="1717143011491" duration="3957000" />
<workItem from="1717397171731" duration="4000" />
<workItem from="1717408527596" duration="844000" />
<workItem from="1717465478936" duration="62000" />
<workItem from="1717465595262" duration="7202000" />
<workItem from="1717482055924" duration="5417000" />
<workItem from="1717555274601" duration="14797000" />
<workItem from="1717641170034" duration="1196000" />
<workItem from="1717653843514" duration="2842000" />
<workItem from="1717661366080" duration="929000" />
<workItem from="1718158879686" duration="260000" />
<workItem from="1718161581302" duration="2271000" />
<workItem from="1718175087066" duration="2395000" />
<workItem from="1718241465057" duration="1147000" />
<workItem from="1718265870498" duration="1300000" />
<workItem from="1718328051232" duration="2694000" />
<workItem from="1718592143491" duration="342000" />
<workItem from="1718592578226" duration="3312000" />
<workItem from="1718611431443" duration="1329000" />
<workItem from="1718677299457" duration="1527000" />
<workItem from="1718695127174" duration="3336000" />
<workItem from="1718702888894" duration="937000" />
<workItem from="1718767213721" duration="220000" />
<workItem from="1718778857059" duration="2208000" />
<workItem from="1718864356266" duration="133000" />
<workItem from="1718932091196" duration="11000" />
<workItem from="1718937754956" duration="6997000" />
<workItem from="1718961213073" duration="720000" />
<workItem from="1718961946908" duration="384000" />
<workItem from="1718962559454" duration="147000" />
<workItem from="1719208711688" duration="1035000" />
<workItem from="1719277104901" duration="610000" />
<workItem from="1719295000891" duration="2407000" />
<workItem from="1719364649872" duration="2680000" />
<workItem from="1719473456780" duration="3632000" />
<workItem from="1719538000388" duration="4208000" />
<workItem from="1719798250389" duration="5085000" />
<workItem from="1719823536035" duration="1515000" />
<workItem from="1719883199962" duration="3534000" />
<workItem from="1719991600192" duration="691000" />
<workItem from="1719996584816" duration="5851000" />
<workItem from="1720574415014" duration="5468000" />
<workItem from="1720661239359" duration="2658000" />
<workItem from="1720682974164" duration="4659000" />
<workItem from="1720747205733" duration="3146000" />
<workItem from="1721114555665" duration="861000" />
<workItem from="1721115555542" duration="3818000" />
<workItem from="1721181583375" duration="5437000" />
<workItem from="1721208006372" duration="869000" />
<workItem from="1721265450939" duration="8539000" />
<workItem from="1721291308438" duration="757000" />
<workItem from="1721356537885" duration="2299000" />
<workItem from="1724117335015" duration="395000" />
<workItem from="1724119223765" duration="308000" />
<workItem from="1724308384728" duration="1020000" />
<workItem from="1724309716182" duration="686000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="UnknownFeatures">
<option featureType="com.intellij.fileTypeFactory" implementationName="*.conf" />
<option featureType="com.intellij.fileTypeFactory" implementationName="*.service" />
</component>
<component name="VgoProject">
<integration-enabled>false</integration-enabled>
<settings-migrated>true</settings-migrated>
</component>
<component name="XSLT-Support.FileAssociations.UIState">
<expand />
<select />
</component>
</project>

9
.idea/希腊项目-阿里云-德国.iml generated Normal file
View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@@ -0,0 +1,24 @@
#!/usr/bin/env bash
# 需要在所有的节点执行
hostnamectl set-hostname storage-1
# sed -i "/search/ a nameserver 223.5.5.5" /etc/resolv.conf
echo "AllowTcpForwarding yes" >> /etc/ssh/sshd_config
systemctl restart sshd
cat >> /etc/hosts << EOF
192.168.8.65 master-node
192.168.8.66 worker-1
192.168.8.67 worker-2
192.168.8.68 storage-1
EOF
bash <(curl -L -s https://cdn.jsdelivr.net/gh/teddysun/across/bbr.sh)

View File

@@ -0,0 +1,80 @@
#! /bin/bash
## 关闭虚拟缓存
#swapoff -a
#cp -f /etc/fstab /etc/fstab_bak
#cat /etc/fstab_bak | grep -v swap >/etc/fstab
# echo "-----------------------------------------------------------------------"
# RootVolumeSizeBefore=$(df -TH | grep -w "/dev/mapper/centos-root" | awk '{print $3}')
# echo "扩容之前的root目录的容量为${RootVolumeSizeBefore}"
# echo "y
# " | lvremove /dev/mapper/centos-swap
# freepesize=$(vgdisplay centos | grep 'Free PE' | awk '{print $5}')
# lvextend -l+${freepesize} /dev/mapper/centos-root
# ## #自动扩展XFS文件系统到最大的可用大小
# xfs_growfs /dev/mapper/centos-root
# df -TH | grep -w "/dev/mapper/centos-root" | awk '{print $3}'
# echo "-----------------------------------------------------------------------"
# RootVolumeSizeAfter=$(df -TH | grep -w "/dev/mapper/centos-root" | awk '{print $3}')
# echo "扩容之后的root目录的容量为${RootVolumeSizeAfter}"
# RootVolumeSizeBeforeNum=$(echo $RootVolumeSizeBefore | cut -d "G" -f1)
# RootVolumeSizeAfterNum=$(echo $RootVolumeSizeAfter | cut -d "G" -f1)
# echo "恭喜您的root目录容量增加了+++++++$(( ${RootVolumeSizeAfterNum}-${RootVolumeSizeBeforeNum} ))GB+++++"
echo ""
echo ""
echo ""
echo "-----------------------------------------------------------------------"
VG_NAME=datavg
echo "n
p
t
8e
w
" | fdisk /dev/vdb
partprobe
# 如果已经存在卷组,直接进行添加
# vgextend /dev/mapper/centos /dev/vda3
vgcreate ${VG_NAME} /dev/vdb1
selfpesize=$(vgdisplay ${VG_NAME} | grep 'Total PE' | awk '{print $3}')
# 大小根据实际情况调整
lvcreate -l ${selfpesize} -n lvdata ${VG_NAME}
mkfs.xfs /dev/mapper/${VG_NAME}-lvdata
mkdir -p /data
selffstab="/dev/mapper/${VG_NAME}-lvdata /data xfs defaults 0 0"
echo "${selffstab}" >> /etc/fstab
mount -a
echo ""
echo ""
echo ""
df -TH
echo "-----------------------------------------------------------------------"
# 扩容根目录,${VG_NAME}-root 通过df -Th获取需要扩容的文件系统
# lvextend -l +100%FREE /dev/mapper/${VG_NAME}-root
# xfs_growfs /dev/mapper/${VG_NAME}-roo
#
#
VG_NAME=sata-data
# vgcreate ${VG_NAME} /dev/vdb1
selfpesize=$(vgdisplay ${VG_NAME} | grep 'Total PE' | awk '{print $3}')
## 大小根据实际情况调整
lvcreate -l ${selfpesize} -n lvdata ${VG_NAME}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,143 @@
#!/usr/bin/env bash
### 需要修改以下的内容 ###
#### 需要修改以下的内容 ###
#### 需要修改以下的内容 ###
cmlc_app_image_list="cmlc-app-images.txt" # 需要修改版本
rancher_image_list="kubernetes-images-2.5.7.txt" # 一般不需要修改
middleware_image_list="middleware-images.txt" # 一般不需要修改
DockerRegisterDomain="192.168.8.65:8033" # 需要根据实际修改
HarborAdminPass=V2ryStr@ngPss # 需要跟第一脚本中的密码保持一致
#### 需要修改以上的内容 ###
#### 需要修改以上的内容 ###
#### 需要修改以上的内容 ###
downloadAllNeededImages() {
while [[ $# > 0 ]]; do
pulled=""
while IFS= read -r i; do
[ -z "${i}" ] && continue
echo "开始下载:${i}"
if docker pull "${i}" >/dev/null 2>&1; then
echo "Image pull success: ${i}"
pulled="${pulled} ${i}"
else
if docker inspect "${i}" >/dev/null 2>&1; then
pulled="${pulled} ${i}"
else
echo "Image pull failed: ${i}"
fi
fi
echo "-------------------------------------------------"
done <"${1}"
shift
done
}
downloadAllNeededImagesAndCompress() {
while [[ $# > 0 ]]; do
pulled=""
while IFS= read -r i; do
[ -z "${i}" ] && continue
echo "开始下载:${i}"
if docker pull "${i}" >/dev/null 2>&1; then
echo "Image pull success: ${i}"
pulled="${pulled} ${i}"
else
if docker inspect "${i}" >/dev/null 2>&1; then
pulled="${pulled} ${i}"
else
echo "Image pull failed: ${i}"
fi
fi
echo "-------------------------------------------------"
done <"${1}"
compressPacName="$(echo ${1} | cut -d"." -f1).tar.gz"
echo "Creating ${compressPacName} with $(echo ${pulled} | wc -w | tr -d '[:space:]') images"
docker save $(echo ${pulled}) | gzip --stdout > ${compressPacName}
shift
done
}
pushRKEImageToHarbor(){
linux_images=()
while IFS= read -r i; do
[ -z "${i}" ] && continue
linux_images+=("${i}");
done < "${rancher_image_list}"
docker login -u admin -p ${HarborAdminPass} ${DockerRegisterDomain}
for i in "${linux_images[@]}"; do
[ -z "${i}" ] && continue
case $i in
*/*)
image_name="${DockerRegisterDomain}/${i}"
;;
*)
image_name="${DockerRegisterDomain}/rancher/${i}"
;;
esac
echo "开始镜像至私有仓库推送:${image_name}"
docker tag "${i}" "${image_name}"
docker push "${image_name}"
echo "-------------------------------------------------"
done
}
pushCMLCAPPImageToHarbor(){
app_images=()
while IFS= read -r i; do
[ -z "${i}" ] && continue
app_images+=("${i}");
done < "${cmlc_app_image_list}"
docker login -u admin -p ${HarborAdminPass} ${DockerRegisterDomain}
for app in "${app_images[@]}"; do
[ -z "${app}" ] && continue
image_name="${DockerRegisterDomain}/$(echo ${app} | cut -d"/" -f2-8)"
echo "开始镜像至私有仓库推送:${image_name}"
docker tag "${app}" "${image_name}"
docker push "${image_name}"
echo "-------------------------------------------------"
done
}
pushMiddlewareImageToHarbor(){
middleware_image=()
while IFS= read -r i; do
[ -z "${i}" ] && continue
middleware_image+=("${i}");
done < "${middleware_image_list}"
docker login -u admin -p ${HarborAdminPass} ${DockerRegisterDomain}
for app in "${middleware_image[@]}"; do
[ -z "${app}" ] && continue
case ${app} in
*/*/*)
image_name="${DockerRegisterDomain}/cmii/$(echo "${app}" | cut -d"/" -f3-8)"
;;
*/*)
image_name="${DockerRegisterDomain}/cmii/$(echo "${app}" | cut -d"/" -f2-8)"
;;
esac
echo "开始镜像至私有仓库推送:${image_name}"
docker tag "${app}" "${image_name}"
docker push "${image_name}"
echo "-------------------------------------------------"
done
}
#downloadAllNeededImagesAndCompress "kubernetes-images-2.5.7.txt" "middleware-images.txt"
#downloadAllNeededImages "kubernetes-images-2.5.7.txt" "middleware-images.txt"
pushRKEImageToHarbor
pushMiddlewareImageToHarbor

View File

@@ -0,0 +1,235 @@
#!/usr/bin/env bash
### 需要修改以下的内容 ###
### 需要修改以下的内容 ###
### 需要修改以下的内容 ###
# 理论上来说,能访问公网的服务器 用来部署Harbor服务器
# 所有的主机均可以访问公网的话,填写 除了harbor服务器的 其他所有主机的地址
PrivateServerIPs=(192.168.8.66 192.168.8.67 192.168.8.68) # 内网服务器的IP地址不包括可以访问公网IP的服务器
### 需要修改以上的内容 ###
### 需要修改以上的内容 ###
### 需要修改以上的内容 ###
RED="31m" ## 姨妈红
GREEN="32m" ## 水鸭青
YELLOW="33m" ## 鸭屎黄
PURPLE="35m" ## 基佬紫
BLUE="36m" ## 天依蓝
colorEcho() {
# shellcheck disable=SC2145
echo -e "\033[${1}${@:2}\033[0m" 1>&2
}
check_root() {
if [[ $EUID != 0 ]]; then
colorEcho ${RED} "当前非root账号(或没有root权限)无法继续操作请更换root账号!"
colorEcho ${YELLOW} "使用sudo -命令获取临时root权限执行后可能会提示输入root密码"
exit 1
fi
}
startFunc(){
colorEcho ${PURPLE} "---------------------------------------------------------------------------------"
colorEcho ${BLUE} "开始执行 启动RKE集群的操作 ………"
echo ""
colorEcho ${BLUE} "本脚本的运行有一些列的前提依赖,请确定以下的项目都已完成!!!!"
colorEcho ${YELLOW} "----------------------------------------------------------"
colorEcho ${RED} "1. 完成基础环境初始化将rke系统镜像均上传至私有Harbor中"
colorEcho ${RED} "2. 配置并修改好 rke集群的模板文件命名为 cluster.yml !!"
colorEcho ${RED} "3. ……"
colorEcho ${YELLOW} "----------------------------------------------------------"
while true; do
colorEcho ${RED} "请确保您已经将上述的项目完成!!"
read -r -p "请输入yes进行确认脚本才可继续运行" input
case $input in
yes)
colorEcho ${GREEN} "您已确认上述的项目均已完成!!"
colorEcho ${GREEN} "----------------------------------------------------------"
echo ""
colorEcho ${BLUE} "开始执行 RKE集群的启动过程"
echo ""
main
break
;;
*)
echo ""
colorEcho ${RED} "输入有误!!! 请输入 >> yes << 进行确认"
break
colorEcho ${RED} "-----------------------------------------------------"
echo ""
;;
esac
done
}
installRKE(){
colorEcho ${PURPLE} "---------------------------------------------------------------------------------"
colorEcho ${BLUE} "开始下载并安装 RKE 工具 ………"
echo ""
colorEcho ${BLUE} "开始从rancher镜像下载rke工具……"
wget http://rancher-mirror.cnrancher.com/rke/v1.2.6/rke_linux-amd64
if [ -s rke_linux-amd64 ]; then
colorEcho ${GREEN} "rke工具下载完成"
chmod +x rke_linux-amd64
mv ./rke_linux-amd64 /usr/local/bin/rke
colorEcho ${GREEN} "----------------------------------------------------------"
rke --version
colorEcho ${GREEN} "----------------------------------------------------------"
rke config --list-version --all
echo ""
colorEcho ${BLUE} "开始从rancher镜像下载 kubectl 工具……"
wget http://rancher-mirror.cnrancher.com/kubectl/v1.20.4/linux-amd64-v1.20.4-kubectl
chmod +x linux-amd64-v1.20.4-kubectl
mv linux-amd64-v1.20.4-kubectl /usr/local/bin/kubectl
colorEcho ${GREEN} "----------------------------------------------------------"
kubectl version
colorEcho ${GREEN} "----------------------------------------------------------"
else
colorEcho ${RED} "rke工具下载失败脚本无法继续运行请手动下载rke工具"
colorEcho ${RED} "rke工具下载失败脚本无法继续运行请手动下载rke工具"
colorEcho ${RED} "rke工具下载失败脚本无法继续运行请手动下载rke工具"
return 1
fi
}
createRKEInstallerUser(){
colorEcho ${PURPLE} "---------------------------------------------------------------------------------"
colorEcho ${BLUE} "开始创建 rke-installer 用户………"
echo ""
useradd rke-installer
echo "rke-installer
rke-installer
" | passwd rke-installer
#将登陆用户develop加入到docker用户组中
gpasswd -a rke-installer docker
#更新用户组
newgrp docker
echo ""
if [ -d /home/rke-installer ]; then
colorEcho ${GREEN} "rke-installer 用户创建成功!! "
echo ""
else
colorEcho ${YELLOW} "检测到 rke-installer 用户已经存在"
fi
if [[ -s cluster.yaml || -s cluster.yml ]]; then
colorEcho ${BLUE} "开始将 cluster.yaml文件复制到 rke-installer目录下…………"
mv cluster.y* /home/rke-installer/cluster.yml
if [ -s /home/rke-installer/cluster.yml ]; then
colorEcho ${BLUE} "cluster.yml文件已经放置完成"
chown rke-installer:rke-installer /home/rke-installer/cluster.yml
else
colorEcho ${RED} "当前目录下未检测到 rke集群的模板文件"
colorEcho ${RED} "程序无法继续,将退出!!"
return 1
fi
else
colorEcho ${RED} "当前目录下未检测到 rke集群的模板文件"
colorEcho ${RED} "程序无法继续,将退出!!"
echo ""
colorEcho ${YELLOW} "--------------------------------------------------"
colorEcho ${RED} "请创建RKE集群的模板文件并命名为 cluster.yml "
colorEcho ${RED} "请创建RKE集群的模板文件并命名为 cluster.yml "
colorEcho ${RED} "请创建RKE集群的模板文件并命名为 cluster.yml "
colorEcho ${YELLOW} "--------------------------------------------------"
return 1
fi
colorEcho ${BLUE} "开始切换当前用户至 rke-installer "
su rke-installer
echo ""
colorEcho ${BLUE} "请检查rke-installer用户能否执行 docker ps 命令!!"
docker ps
colorEcho ${BLUE} "----------------------------------------------------------"
}
generateRKEUserKey(){
colorEcho ${PURPLE} "---------------------------------------------------------------------------------"
colorEcho ${BLUE} "开始创建 rke-installer用户的 ssh key ……"
echo ""
su rke-installer
ssh-keygen -t rsa -P "" -f ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
colorEcho ${GREEN} "--------------------------------------------------------------"
colorEcho ${GREEN} "-----------本机配置完成!-------------"
echo ""
for ip in "${PrivateServerIPs[@]}"; do
colorEcho ${BLUE} "请手动将如下的命令,以 root 权限在主机 ${ip} 上运行"
colorEcho ${BLUE} "请手动将如下的命令,以 root 权限在主机 ${ip} 上运行"
colorEcho ${BLUE} "请手动将如下的命令,以 root 权限在主机 ${ip} 上运行"
colorEcho ${BLUE} "-----------------------------------------------"
echo ""
echo ""
colorEcho ${RED} " 请以 root 角色 运行!!! "
colorEcho ${RED} " 请以 root 角色 运行!!! "
colorEcho ${RED} " 请以 root 角色 运行!!! "
echo ""
echo "useradd rke-installer && echo \"rke-installer
rke-installer
\" | passwd rke-installer && gpasswd -a rke-installer docker && newgrp docker && su rke-installer && docker ps "
echo ""
echo "clear && ssh-keygen -t rsa -P \"\" -f ~/.ssh/id_rsa && echo \"$(cat ~/.ssh/id_rsa.pub)\" >> ~/.ssh/authorized_keys && echo \"\" && cat ~/.ssh/authorized_keys"
echo ""
echo ""
while true; do
colorEcho ${RED} "请确保您已经将上述的命令在主机${ip}上执行了!!"
read -r -p "请输入yes进行确认脚本才可继续运行" input
case $input in
yes)
colorEcho ${GREEN} "您已确认在主机${ip}上添加了私有的ssh key"
echo ""
break
;;
*)
echo ""
colorEcho ${RED} "输入有误!!! 请输入 >> yes << 进行确认"
colorEcho ${RED} "请在主机${ip}上执行上述命令!!!"
colorEcho ${RED} "否则本脚本的功能会失效!!"
colorEcho ${RED} "-----------------------------------------------------"
echo ""
;;
esac
done
done
}
startRKECLuster(){
colorEcho ${PURPLE} "---------------------------------------------------------------------------------"
colorEcho ${BLUE} "开始 启动 rke集群 "
colorEcho ${BLUE} "开始 启动 rke集群 "
colorEcho ${BLUE} "开始 启动 rke集群 "
echo ""
if [[ $(pwd) == "/home/rke-installer" ]]; then
colorEcho ${BLUE} "检测到当前目录为 /home/rke-installer"
echo ""
colorEcho ${BLUE} "开始执行 RKE 集群的启动过程 "
colorEcho ${BLUE} "-------------------------------------------------------------"
for i in {3..1..-1}; do
colorEcho ${BLUE} "倒计时开始 ->> $i 秒 <<-准备启动RKE上文的日志输出将会消失"
sleep 2
done
clear
rke up
else
colorEcho ${BLUE} "当前目录不为 /home/rke-installer开始跳转目录"
cd /home/rke-installer
startRKECLuster
fi
}
main(){
check_root
generateRKEUserKey || return $?
startRKECLuster || return $?
}
startFunc

View File

@@ -0,0 +1,36 @@
harbor-qa.sre.cdcyy.cn/cmii/cmii-admin-data:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-admin-gateway:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-admin-user:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-open-gateway:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-uav-airspace:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-uav-brain:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-uav-cloud-live:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-uav-clusters:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-uav-data-post-process:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-uav-developer:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-uav-device:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-uav-gateway:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-uav-hyperspectral-consumer:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-uav-hyperspectral-provider:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-uav-kpi-monitor:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-uav-logger:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-uav-material-warehouse:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-uav-mission:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-uav-mqtthandler:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-uav-notice:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-uav-oauth:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-uav-process:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-uav-security-system:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-uav-surveillance:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-uav-user:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-uav-waypoint:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-uav-platform:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-uav-platform-ai-brain:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-uav-platform-hyperspectral:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-uav-platform-mws:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-uav-platform-mws-admin:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-uav-platform-oms:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-uav-platform-open:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-uav-platform-splice:2.1.14
harbor-qa.sre.cdcyy.cn/cmii/cmii-uav-platform-splice-visual:2.1.14

View File

@@ -0,0 +1,20 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: admin-user
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: admin-user
namespace: kube-system

View File

@@ -0,0 +1,299 @@
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: v1
kind: Namespace
metadata:
name: kube-system
---
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard
namespace: kube-system
---
kind: Service
apiVersion: v1
metadata:
labels:
k8s-app: kubernetes-dashboard
kubernetes.io/cluster-service: "true"
name: kubernetes-dashboard
namespace: kube-system
spec:
ports:
- port: 443
targetPort: 8443
selector:
k8s-app: kubernetes-dashboard
type: NodePort
---
apiVersion: v1
kind: Secret
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard-certs
namespace: kube-system
type: Opaque
---
apiVersion: v1
kind: Secret
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard-csrf
namespace: kube-system
type: Opaque
data:
csrf: ""
---
apiVersion: v1
kind: Secret
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard-key-holder
namespace: kube-system
type: Opaque
---
kind: ConfigMap
apiVersion: v1
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard-settings
namespace: kube-system
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard
namespace: kube-system
rules:
# Allow Dashboard to get, update and delete Dashboard exclusive secrets.
- apiGroups: [""]
resources: ["secrets"]
resourceNames: ["kubernetes-dashboard-key-holder", "kubernetes-dashboard-certs", "kubernetes-dashboard-csrf"]
verbs: ["get", "update", "delete"]
# Allow Dashboard to get and update 'kubernetes-dashboard-settings' config map.
- apiGroups: [""]
resources: ["configmaps"]
resourceNames: ["kubernetes-dashboard-settings"]
verbs: ["get", "update"]
# Allow Dashboard to get metrics.
- apiGroups: [""]
resources: ["services"]
resourceNames: ["heapster", "dashboard-metrics-scraper"]
verbs: ["proxy"]
- apiGroups: [""]
resources: ["services/proxy"]
resourceNames: ["heapster", "http:heapster:", "https:heapster:", "dashboard-metrics-scraper", "http:dashboard-metrics-scraper"]
verbs: ["get"]
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard
rules:
# Allow Metrics Scraper to get metrics from the Metrics server
- apiGroups: ["metrics.k8s.io"]
resources: ["pods", "nodes"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard
namespace: kube-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: kubernetes-dashboard
subjects:
- kind: ServiceAccount
name: kubernetes-dashboard
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kubernetes-dashboard
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kubernetes-dashboard
subjects:
- kind: ServiceAccount
name: kubernetes-dashboard
namespace: kube-system
---
kind: Deployment
apiVersion: apps/v1
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard
namespace: kube-system
spec:
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
k8s-app: kubernetes-dashboard
template:
metadata:
labels:
k8s-app: kubernetes-dashboard
spec:
containers:
- name: kubernetes-dashboard
image: kubernetesui/dashboard:v2.0.1
ports:
- containerPort: 8443
protocol: TCP
args:
- --auto-generate-certificates
- --namespace=kube-system
# Uncomment the following line to manually specify Kubernetes API server Host
# If not specified, Dashboard will attempt to auto discover the API server and connect
# to it. Uncomment only if the default does not work.
# - --apiserver-host=http://my-address:port
volumeMounts:
- name: kubernetes-dashboard-certs
mountPath: /certs
# Create on-disk volume to store exec logs
- mountPath: /tmp
name: tmp-volume
livenessProbe:
httpGet:
scheme: HTTPS
path: /
port: 8443
initialDelaySeconds: 30
timeoutSeconds: 30
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsUser: 1001
runAsGroup: 2001
volumes:
- name: kubernetes-dashboard-certs
secret:
secretName: kubernetes-dashboard-certs
- name: tmp-volume
emptyDir: {}
serviceAccountName: kubernetes-dashboard
# Comment the following tolerations if Dashboard must not be deployed on master
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
---
kind: Service
apiVersion: v1
metadata:
labels:
k8s-app: dashboard-metrics-scraper
name: dashboard-metrics-scraper
namespace: kube-system
spec:
ports:
- port: 8000
targetPort: 8000
selector:
k8s-app: dashboard-metrics-scraper
---
kind: Deployment
apiVersion: apps/v1
metadata:
labels:
k8s-app: dashboard-metrics-scraper
name: dashboard-metrics-scraper
namespace: kube-system
spec:
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
k8s-app: dashboard-metrics-scraper
template:
metadata:
labels:
k8s-app: dashboard-metrics-scraper
annotations:
seccomp.security.alpha.kubernetes.io/pod: 'runtime/default'
spec:
containers:
- name: dashboard-metrics-scraper
image: kubernetesui/metrics-scraper:v1.0.4
ports:
- containerPort: 8000
protocol: TCP
livenessProbe:
httpGet:
scheme: HTTP
path: /
port: 8000
initialDelaySeconds: 30
timeoutSeconds: 30
volumeMounts:
- mountPath: /tmp
name: tmp-volume
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsUser: 1001
runAsGroup: 2001
serviceAccountName: kubernetes-dashboard
# Comment the following tolerations if Dashboard must not be deployed on master
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
volumes:
- name: tmp-volume
emptyDir: {}

View File

@@ -0,0 +1,64 @@
busybox
rancher/backup-restore-operator:v1.0.3
rancher/calico-cni:v3.13.4
rancher/calico-ctl:v3.13.4
rancher/calico-kube-controllers:v3.13.4
rancher/calico-node:v3.13.4
rancher/calico-pod2daemon-flexvol:v3.13.4
rancher/cis-operator:v1.0.3
rancher/cluster-proportional-autoscaler:1.7.1
rancher/configmap-reload:v0.3.0-rancher4
rancher/coredns-coredns:1.6.9
rancher/coreos-etcd:v3.4.3-rancher1
rancher/coreos-flannel:v0.12.0
rancher/coreos-flannel:v0.13.0-rancher1
rancher/coreos-kube-state-metrics:v1.9.7
rancher/coreos-prometheus-config-reloader:v0.39.0
rancher/coreos-prometheus-operator:v0.39.0
rancher/externalip-webhook:v0.1.6
rancher/flannel-cni:v0.3.0-rancher6
rancher/fleet-agent:v0.3.4
rancher/fleet:v0.3.4
rancher/fluentd:v0.1.24
rancher/grafana-grafana:7.1.5
rancher/hyperkube:v1.18.16-rancher1
rancher/jimmidyson-configmap-reload:v0.3.0
rancher/k8s-dns-dnsmasq-nanny:1.15.2
rancher/k8s-dns-kube-dns:1.15.2
rancher/k8s-dns-node-cache:1.15.7
rancher/k8s-dns-sidecar:1.15.2
rancher/klipper-lb:v0.1.2
rancher/kube-api-auth:v0.1.4
rancher/kubectl:v1.18.6
rancher/kubernetes-external-dns:v0.7.3
rancher/library-busybox:1.31.1
rancher/library-busybox:1.32.1
rancher/library-nginx:1.19.2-alpine
rancher/library-traefik:1.7.19
rancher/local-path-provisioner:v0.0.11
rancher/local-path-provisioner:v0.0.14
rancher/local-path-provisioner:v0.0.19
rancher/log-aggregator:v0.1.7
rancher/istio-kubectl:1.5.10
rancher/metrics-server:v0.3.6
rancher/nginx-ingress-controller-defaultbackend:1.5-rancher1
rancher/nginx-ingress-controller:nginx-0.35.0-rancher2
rancher/opa-gatekeeper:v3.1.0-beta.7
rancher/openzipkin-zipkin:2.14.2
rancher/pause:3.1
rancher/plugins-docker:18.09
rancher/prom-alertmanager:v0.21.0
rancher/prom-node-exporter:v1.0.1
rancher/prom-prometheus:v2.12.0
rancher/prom-prometheus:v2.18.2
rancher/prometheus-auth:v0.2.1
rancher/rancher-agent:v2.5.7
rancher/rancher-webhook:v0.1.0-beta9
rancher/rancher:v2.5.7
rancher/rke-tools:v0.1.72
rancher/security-scan:v0.1.14
rancher/security-scan:v0.2.2
rancher/shell:v0.1.6
rancher/sonobuoy-sonobuoy:v0.16.3
rancher/system-upgrade-controller:v0.6.2

View File

@@ -0,0 +1,61 @@
busybox
rancher/backup-restore-operator:v1.0.3
rancher/calico-cni:v3.17.2
rancher/calico-ctl:v3.17.2
rancher/calico-kube-controllers:v3.17.2
rancher/calico-node:v3.17.2
rancher/calico-pod2daemon-flexvol:v3.17.2
rancher/cis-operator:v1.0.3
rancher/cluster-proportional-autoscaler:1.7.1
rancher/coredns-coredns:1.8.0
rancher/coreos-etcd:v3.4.14-rancher1
rancher/coreos-kube-state-metrics:v1.9.7
rancher/coreos-prometheus-config-reloader:v0.39.0
rancher/coreos-prometheus-operator:v0.39.0
rancher/externalip-webhook:v0.1.6
rancher/flannel-cni:v0.3.0-rancher6
rancher/fleet-agent:v0.3.4
rancher/fleet:v0.3.4
rancher/fluentd:v0.1.24
rancher/grafana-grafana:7.1.5
rancher/hyperkube:v1.20.4-rancher1
rancher/jimmidyson-configmap-reload:v0.3.0
rancher/k8s-dns-dnsmasq-nanny:1.15.2
rancher/k8s-dns-kube-dns:1.15.2
rancher/k8s-dns-node-cache:1.15.13
rancher/k8s-dns-sidecar:1.15.2
rancher/klipper-lb:v0.1.2
rancher/kube-api-auth:v0.1.4
rancher/kubectl:v1.20.4
rancher/kubernetes-external-dns:v0.7.3
rancher/library-busybox:1.31.1
rancher/library-busybox:1.32.1
rancher/library-nginx:1.19.2-alpine
rancher/library-traefik:1.7.19
rancher/local-path-provisioner:v0.0.11
rancher/local-path-provisioner:v0.0.14
rancher/local-path-provisioner:v0.0.19
rancher/log-aggregator:v0.1.7
rancher/istio-kubectl:1.5.10
rancher/metrics-server:v0.4.1
rancher/configmap-reload:v0.3.0-rancher4
rancher/nginx-ingress-controller-defaultbackend:1.5-rancher1
rancher/nginx-ingress-controller:nginx-0.43.0-rancher1
rancher/opa-gatekeeper:v3.1.0-beta.7
rancher/openzipkin-zipkin:2.14.2
rancher/pause:3.2
rancher/plugins-docker:18.09
rancher/prom-alertmanager:v0.21.0
rancher/prom-node-exporter:v1.0.1
rancher/prom-prometheus:v2.18.2
rancher/prometheus-auth:v0.2.1
rancher/rancher-agent:v2.5.7
rancher/rancher-webhook:v0.1.0-beta9
rancher/rancher:v2.5.7
rancher/rke-tools:v0.1.72
rancher/security-scan:v0.1.14
rancher/security-scan:v0.2.2
rancher/shell:v0.1.6
rancher/sonobuoy-sonobuoy:v0.16.3
rancher/system-upgrade-controller:v0.6.2

View File

@@ -0,0 +1,18 @@
docker.io/bitnami/redis:6.2.6-debian-10-r0
docker.io/bitnami/mysql:8.0.26-debian-10-r0
docker.io/bitnami/bitnami-shell:10-debian-10-r140
docker.io/bitnami/rabbitmq:3.9.12-debian-10-r3
docker.io/bitnami/minio:2021.3.26-debian-10-r0
docker.io/ossrs/srs:v4.0.136
docker.io/emqx/emqx:4.2.12
docker.io/nacos/nacos-server:2.0.1
docker.io/mongo:5.0
docker.io/rabbitmq:3.7-management
docker.io/v2fly/v2fly-core:v4.38.3
docker.io/pollyduan/ingress-nginx-controller:v0.44.0
docker.io/jettech/kube-webhook-certgen:v1.5.1
docker.io/minio/minio:RELEASE.2022-03-26T06-49-28Z
docker.io/minio/minio:RELEASE.2022.5.4
docker.io/ossrs/srs:v4.0-b9
docker.io/kubernetesui/dashboard:v2.0.1
docker.io/kubernetesui/metrics-scraper:v1.0.4

View File

@@ -0,0 +1,252 @@
nodes:
- address: 192.168.8.65
user: rke-installer
role:
- controlplane
- etcd
- worker
internal_address: 192.168.8.65
- address: 192.168.8.66
user: rke-installer
role:
- worker
labels:
ingress-deploy: true
internal_address: 192.168.8.66
- address: 192.168.8.67
user: rke-installer
role:
- worker
internal_address: 192.168.8.67
labels:
mysql-deploy: true
- address: 192.168.8.68
user: rke-installer
role:
- worker
internal_address: 192.168.8.68
labels:
minio-deploy: true
authentication:
strategy: x509
sans:
- "192.168.8.6"
private_registries:
- url: 192.168.8.65:8033 # 私有镜像库地址
user: admin
password: "V2ryStr@ngPss"
is_default: true
##############################################################################
# 默认值为false如果设置为true当发现不支持的Docker版本时RKE不会报错
ignore_docker_version: true
# Set the name of the Kubernetes cluster
cluster_name: rke-cluster
kubernetes_version: v1.20.4-rancher1-1
ssh_key_path: /home/rke-installer/.ssh/id_rsa
# Enable running cri-dockerd
# Up to Kubernetes 1.23, kubelet contained code called dockershim
# to support Docker runtime. The replacement is called cri-dockerd
# and should be enabled if you want to keep using Docker as your
# container runtime
# Only available to enable in Kubernetes 1.21 and higher
enable_cri_dockerd: true
services:
etcd:
backup_config:
enabled: false
interval_hours: 72
retention: 3
safe_timestamp: false
timeout: 300
creation: 12h
extra_args:
election-timeout: 5000
heartbeat-interval: 500
gid: 0
retention: 72h
snapshot: false
uid: 0
kube-api:
# IP range for any services created on Kubernetes
# This must match the service_cluster_ip_range in kube-controller
service_cluster_ip_range: 10.74.0.0/16
# Expose a different port range for NodePort services
service_node_port_range: 30000-40000
always_pull_images: true
pod_security_policy: false
# Add additional arguments to the kubernetes API server
# This WILL OVERRIDE any existing defaults
extra_args:
# Enable audit log to stdout
audit-log-path: "-"
# Increase number of delete workers
delete-collection-workers: 3
# Set the level of log output to warning-level
v: 1
kube-controller:
# CIDR pool used to assign IP addresses to pods in the cluster
cluster_cidr: 10.100.0.0/16
# IP range for any services created on Kubernetes
# This must match the service_cluster_ip_range in kube-api
service_cluster_ip_range: 10.74.0.0/16
# Add additional arguments to the kubernetes API server
# This WILL OVERRIDE any existing defaults
extra_args:
# Set the level of log output to debug-level
v: 1
# Enable RotateKubeletServerCertificate feature gate
feature-gates: RotateKubeletServerCertificate=true
# Enable TLS Certificates management
# https://kubernetes.io/docs/tasks/tls/managing-tls-in-a-cluster/
cluster-signing-cert-file: "/etc/kubernetes/ssl/kube-ca.pem"
cluster-signing-key-file: "/etc/kubernetes/ssl/kube-ca-key.pem"
kubelet:
# Base domain for the cluster
cluster_domain: cluster.local
# IP address for the DNS service endpoint
cluster_dns_server: 10.74.0.10
# Fail if swap is on
fail_swap_on: false
# Set max pods to 250 instead of default 110
extra_binds:
- "/data/minio-pv:/hostStorage" # 不要修改 为minio的pv添加
extra_args:
max-pods: 122
# Optionally define additional volume binds to a service
scheduler:
extra_args:
# Set the level of log output to warning-level
v: 0
kubeproxy:
extra_args:
# Set the level of log output to warning-level
v: 0
authorization:
mode: rbac
addon_job_timeout: 30
# Specify network plugin-in (canal, calico, flannel, weave, or none)
#network:
# mtu: 1440
# options:
# flannel_backend_type: vxlan
# plugin: calico
# tolerations:
# - key: "node.kubernetes.io/unreachable"
# operator: "Exists"
# effect: "NoExecute"
# tolerationseconds: 300
# - key: "node.kubernetes.io/not-ready"
# operator: "Exists"
# effect: "NoExecute"
# tolerationseconds: 300
network:
options:
flannel_backend_type: vxlan
flannel_iface: eth0
flannel_autoscaler_priority_class_name: system-cluster-critical # Available as of RKE v1.2.6+
flannel_priority_class_name: system-cluster-critical # Available as of RKE v1.2.6+
plugin: flannel
tolerations:
- key: "node.kubernetes.io/unreachable"
operator: "Exists"
effect: "NoExecute"
tolerationseconds: 300
- key: "node.kubernetes.io/not-ready"
operator: "Exists"
effect: "NoExecute"
tolerationseconds: 300
# Specify DNS provider (coredns or kube-dns)
dns:
provider: coredns
nodelocal:
ip_address: '10.74.0.99'
node_selector: null
update_strategy:
# Available as of v1.1.0
update_strategy:
strategy: RollingUpdate
rollingUpdate:
maxUnavailable: 20%
maxSurge: 15%
linear_autoscaler_params:
cores_per_replica: 0.34
nodes_per_replica: 4
prevent_single_point_failure: true
min: 2
max: 3
tolerations:
- key: "node.kubernetes.io/unreachable"
operator: "Exists"
effect: "NoExecute"
tolerationseconds: 300
- key: "node.kubernetes.io/not-ready"
operator: "Exists"
effect: "NoExecute"
tolerationseconds: 300
# Specify monitoring provider (metrics-server)
monitoring:
provider: metrics-server
# Available as of v1.1.0
update_strategy:
strategy: RollingUpdate
rollingUpdate:
maxUnavailable: 8
ingress:
provider: nginx
default_backend: true
http_port: 30500
https_port: 31500
extra_envs:
- name: TZ
value: Asia/Shanghai
node_selector:
ingress-deploy: true
options:
use-forwarded-headers: "true"
access-log-path: /var/log/nginx/access.log
client-body-timeout: '6000'
compute-full-forwarded-for: 'true'
enable-underscores-in-headers: 'true'
log-format-escape-json: 'true'
log-format-upstream: >-
{ "msec": "$msec", "connection": "$connection", "connection_requests":
"$connection_requests", "pid": "$pid", "request_id": "$request_id",
"request_length": "$request_length", "remote_addr": "$remote_addr",
"remote_user": "$remote_user", "remote_port": "$remote_port",
"http_x_forwarded_for": "$http_x_forwarded_for", "time_local":
"$time_local", "time_iso8601": "$time_iso8601", "request": "$request",
"request_uri": "$request_uri", "args": "$args", "status": "$status",
"body_bytes_sent": "$body_bytes_sent", "bytes_sent": "$bytes_sent",
"http_referer": "$http_referer", "http_user_agent": "$http_user_agent",
"http_host": "$http_host", "server_name": "$server_name", "request_time":
"$request_time", "upstream": "$upstream_addr", "upstream_connect_time":
"$upstream_connect_time", "upstream_header_time": "$upstream_header_time",
"upstream_response_time": "$upstream_response_time",
"upstream_response_length": "$upstream_response_length",
"upstream_cache_status": "$upstream_cache_status", "ssl_protocol":
"$ssl_protocol", "ssl_cipher": "$ssl_cipher", "scheme": "$scheme",
"request_method": "$request_method", "server_protocol": "$server_protocol",
"pipe": "$pipe", "gzip_ratio": "$gzip_ratio", "http_cf_ray": "$http_cf_ray",
"geoip_country_code": "$geoip_country_code" }
proxy-body-size: 5120m
proxy-read-timeout: '6000'
proxy-send-timeout: '6000'

8
1-outside-deploy/1.json Normal file
View File

@@ -0,0 +1,8 @@
server {
listen 30080 default;
location /rtc/v1/ {
add_header Access-Control-Allow-Headers X-Requested-With;
add_header Access-Control-Allow-Methods GET,POST,OPTIONS;
proxy_pass http://localhost:30985/rtc/v1/;
}
}

View File

@@ -0,0 +1,26 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
.vscode/
charts/frontend-app/templates/traefik.yaml
charts/all-middleware/charts/rabbitmq-backup
charts/minio-pv
charts/minio-storage

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,17 @@
kind: ConfigMap
apiVersion: v1
metadata:
name: tenant-prefix-logistic-application
namespace: uavcloud-devflight
labels:
app.kubernetes.io/managed-by: Helm
data:
ingress-config.js: |-
// 从ConfigMap中注入
// injected from ConfigMap
var __GlobalIngressConfig = {
TenantEnvironment: "devflight",
CloudHOST: "lab.uavcmlc.com",
ApplicationShortName: "logistic",
AppClientId: "APP_PvdfRRRBPL8xbIwl"
}

View File

@@ -0,0 +1,19 @@
apiVersion: v2
name: outside-deploy
description: 中移凌云平台对外交付部署标准化Charts。提供业务应用前端、后端中间件mysql、redis、minio等一键式部署的能力
deprecated: true
type: application
version: 1.1.0
appVersion: 2.2.2
kubeVersion: ^1.16.0-0
maintainers:
- name: super wdd
email: wangziwen@cmii.chinamobile.com

View File

@@ -0,0 +1,24 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
ci/*

View File

@@ -0,0 +1,30 @@
apiVersion: v2
name: all-ingress-config
description: 中移凌云平台所有的Ingress配置包含前端后端Api/Gateway等
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 2.2.2
keywords:
- uavcloud
- ingress
- template
- function
- chinamobile

View File

@@ -0,0 +1,33 @@
{{- if or .Values.frontendApplication.enabled .Values.backendApplication.enabled .Values.apiGatewayApplication.enabled }}
{{- if .Values.frontendApplication.enabled }}
-- 已经开启前端应用的Ingress
-- The Ingress of the front-end application has been opened!
{{- end }}
{{- if .Values.backendApplication.enabled }}
-- 已经开启后端应用的Ingress
-- The Ingress of the back-end application has been opened!
{{- end }}
{{- if .Values.apiGatewayApplication.enabled }}
-- 已经开启Api和Gateway应用的Ingress
-- Ingress of Api and Gateway applications has been opened!
{{- end }}
{{- else }}
[ERROR] 您并没有选择开启任何应用的Ingress仅仅更新ConfigMap
[ERROR] You did not choose to open Ingress for any app! Just update the ConfigMap! !
{{- end }}
{{ if .Values.global.domain.IsPrivateDeployment }}
-- 您选择了【私有化】域名部署!!
-- [INFO] 请注意域名中不包含前缀!
-- 当前中移凌云的主页访问地址为:{{- if .Values.global.ingress.tls_enabled -}}https://{{- else -}}http://{{- end -}}{{ .Values.global.domain.DeployDomainName }}/
-- You have chosen [Private] domain name deployment! !
-- [INFO] Please note that the domain name does not contain a prefix!
-- The current homepage access address of China Mobile Lingyun is{{- if .Values.global.ingress.tls_enabled -}}https://{{- else -}}http://{{- end -}}{{ .Values.global.domain.DeployDomainName }}/
{{- else }}
-- 当前部署的租户环境为:{{ .Values.global.domain.TenantEnvironment }}
-- 当前中移凌云的主页访问地址为:{{- if .Values.global.ingress.tls_enabled -}}https://{{- else -}}http://{{- end -}}{{ .Values.global.domain.DeployDomainName }}/{{ .Values.global.domain.TenantEnvironment }}/
-- The currently deployed tenant environment is: {{ .Values.global.domain.TenantEnvironment }}
-- The current homepage access address of China Mobile Lingyun is{{- if .Values.global.ingress.tls_enabled -}}https://{{- else -}}http://{{- end -}}{{ .Values.global.domain.DeployDomainName }}/{{ .Values.global.domain.TenantEnvironment }}/
{{- end }}
[SUCCESS] Ingress Deployment has been accomplished !!!

View File

@@ -0,0 +1,50 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Create chart name and version as used by the chart label.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "all-ingress.name" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 }}
{{- end }}
{{/*
Create the tls configuration for https to enable trafik-ingress
*/}}
{{- define "all-ingress-front.full.applications" -}}
- cmii-uav-platform
- cmii-uav-platform-ai-brain
- cmii-uav-platform-hyperspectral
- cmii-uav-platform-mws
- cmii-uav-platform-oms
- cmii-uav-platform-open
- cmii-uav-platform-splice
- cmii-uav-platform-splice-visual
{{- end }}
{{/*
common annotations of frontend applications
*/}}
{{- define "all-ingress.frontend.commom.annotations" -}}
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$1
{{- end }}
{{/*
Specific annotations created for api applications
*/}}
{{- define "all-ingress.all-apis.commom.annotations" -}}
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$2
{{- end }}
{{/*
the specific annotations for project-minio
*/}}
{{/*{{- define "uavcloud-ingress.apiGateway.project-minio.annotations" -}}*/}}
{{/*kubernetes.io/ingress.class: "nginx"*/}}
{{/*nginx.ingress.kubernetes.io/enable-cors: "true"*/}}
{{/*nginx.ingress.kubernetes.io/rewrite-target: /api/uav/minio/$2*/}}
{{/*{{- end }}*/}}

View File

@@ -0,0 +1,51 @@
{{- if .Values.enabled }}
{{- $namespace := .Release.Namespace -}}
{{- $TenantEnvironment := .Values.global.domain.TenantEnvironment -}}
{{- $DeployDomainName := .Values.global.domain.DeployDomainName -}}
{{- $IsPrivateDeployment := .Values.global.domain.IsPrivateDeployment -}}
{{- range $applicationName, $values := .Values.frontendApplication.manifest }}
---
kind: ConfigMap
apiVersion: v1
metadata:
{{- if eq $values.shortname "" }}
name: tenant-prefix-platform
{{- else }}
name: tenant-prefix-{{ $values.shortname }}
{{- end }}
namespace: {{ $namespace }}
data:
ingress-config.js: |-
// 从ConfigMap中注入
// injected from ConfigMap
var __GlobalIngressConfig = {
{{- if $IsPrivateDeployment }}
TenantEnvironment: "",
{{- else }}
TenantEnvironment: {{ $TenantEnvironment | quote -}},
{{- end }}
CloudHOST: {{ $DeployDomainName | quote -}},
{{- if not (contains "appli" $values.shortname ) }}
{{- /* short name not contains application, judge for situations */}}
{{- if contains "cms-portal" $values.shortname }}
ApplicationShortName: "cmsportal",
{{- else if contains "-rescue" $values.shortname }}
ApplicationShortName: {{ trimSuffix "-rescue" $values.shortname | quote -}},
{{- else if contains "screen" $values.shortname }}
ApplicationShortName: {{ trimSuffix "-screen" $values.shortname | quote -}},
{{- else }}
ApplicationShortName: {{ $values.shortname | quote }},
{{- end }}
{{- else }}
ApplicationShortName: {{ trimSuffix "-application" $values.shortname | quote -}},
{{- end }}
{{- range $appShortNamePlusTenantEnv, $appClientId := $values}}
{{- $realApplicationNamePlusTenantEnv := cat $values.shortname $TenantEnvironment | replace " " "-" }}
{{- if hasPrefix $appShortNamePlusTenantEnv $realApplicationNamePlusTenantEnv }}
AppClientId: {{ $appClientId | quote }}
{{- end }}
{{- end }}
}
---
{{- end }}
{{- end }}

View File

@@ -0,0 +1,215 @@
{{- if and .Values.enabled .Values.apiGatewayApplication.enabled }}
{{- $namespace := .Release.Namespace -}}
{{- $TenantEnvironment := .Values.global.domain.TenantEnvironment -}}
{{- $DeployDomainName := ternary (first (regexSplit ":" .Values.global.domain.DeployDomainName -1)) ( .Values.global.domain.DeployDomainName ) (contains ":" .Values.global.domain.DeployDomainName) -}}
{{- $IsPrivateDeployment := .Values.global.domain.IsPrivateDeployment -}}
{{- $IsTlsEnables := .Values.global.ingress.tls_enabled -}}
{{- $scope := $ -}}
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: all-gateways-ingress
namespace: {{ $namespace }}
labels:
type: {{ $.Values.apiGatewayApplication.type }}
accessmode: {{ $.Values.apiGatewayApplication.accessmode }}
helm.sh/chart: {{ include "all-ingress.name" $scope }}
app.kubernetes.io/managed-by: {{ $.Release.Service }}
{{- if $.Values.global.image.tag }}
app.kubernetes.io/version: {{ $.Values.global.image.tag | quote }}
{{- end }}
annotations:
{{- include "all-ingress.frontend.commom.annotations" $scope | nindent 4 }}
{{- if $IsTlsEnables }}
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/permanent-redirect-code: '301'
{{- end }}
nginx.ingress.kubernetes.io/configuration-snippet: |
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
spec:
rules:
- host: {{ $DeployDomainName }}
http:
paths:
{{- if $IsPrivateDeployment }}
{{- range $key,$value := .Values.apiGatewayApplication.manifest }}
{{- if eq $value false }}
{{- $applicationName := ternary (trimPrefix "cmii-uav-" $key) (trimPrefix "cmii-" $key) (contains "cmii-uav" $key) -}}
{{- if eq $applicationName "material-warehouse" }}
- path: /api/warehouses/?(.*)
{{- else if eq $applicationName "gateway" }}
- path: /api/?(.*)
{{- else if eq $applicationName "admin-gateway" }}
- path: /oms/api/?(.*)
{{- /* {{- else if eq $applicationName "project-minio" }}*/}}
{{- /* - path: /?(.*)/api/minios/?(.*)*/}}
{{- else if eq $applicationName "open-gateway" }}
- path: /open/api/?(.*)
{{- else }}
- path: /{{ $applicationName }}/?(.*)
{{- end }}
pathType: ImplementationSpecific
backend:
serviceName: {{ $key }}
servicePort: 8080
{{- end }}
{{- end }}
{{- else }}
{{- range $key,$value := .Values.apiGatewayApplication.manifest }}
{{- if eq $value false }}
{{- $applicationName := ternary (trimPrefix "cmii-uav-" $key) (trimPrefix "cmii-" $key) (contains "cmii-uav" $key) -}}
{{- if eq $applicationName "material-warehouse" }}
- path: /{{ $TenantEnvironment }}/api/warehouses/?(.*)
{{- else if eq $applicationName "gateway" }}
- path: /{{ $TenantEnvironment }}/api/?(.*)
{{- else if eq $applicationName "admin-gateway" }}
- path: /{{ $TenantEnvironment }}/oms/api/?(.*)
{{- /* {{- else if eq $applicationName "project-minio" }}*/}}
{{- /* - path: /{{ $TenantEnvironment }}/?(.*)/api/minios/?(.*)*/}}
{{- else if eq $applicationName "open-gateway" }}
- path: /{{ $TenantEnvironment }}/open/api/?(.*)
{{- else }}
- path: /{{ $applicationName }}/?(.*)
{{- end }}
pathType: ImplementationSpecific
backend:
serviceName: {{ $key }}
servicePort: 8080
{{- end }}
{{- end }}
{{- end }}
{{- if $IsTlsEnables }}
tls:
- hosts:
- {{ $DeployDomainName }}
- secretName: {{ $DeployDomainName | quote }}
{{- end }}
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: all-apis-ingress
namespace: {{ $namespace }}
labels:
type: {{ $.Values.apiGatewayApplication.type }}
accessmode: {{ $.Values.apiGatewayApplication.accessmode }}
helm.sh/chart: {{ include "all-ingress.name" $scope }}
app.kubernetes.io/managed-by: {{ $.Release.Service }}
{{- if $.Values.global.image.tag }}
app.kubernetes.io/version: {{ $.Values.global.image.tag | quote }}
{{- end }}
annotations:
{{- include "all-ingress.all-apis.commom.annotations" $scope | nindent 4 }}
{{- if $IsTlsEnables }}
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/permanent-redirect-code: '301'
{{- end }}
nginx.ingress.kubernetes.io/configuration-snippet: |
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
spec:
rules:
- host: {{ $DeployDomainName }}
http:
paths:
{{- if $IsPrivateDeployment }}
{{- range $key,$value := .Values.apiGatewayApplication.manifest }}
{{- $applicationName := ternary (trimPrefix "cmii-uav-" $key) (trimPrefix "cmii-" $key) (contains "cmii-uav" $key) -}}
{{- if $value }}
{{- if eq $applicationName "material-warehouse" }}
- path: /?(.*)/api/warehouses/?(.*)
{{- else if eq $applicationName "gateway" }}
- path: /api/?(.*)
{{- else if eq $applicationName "admin-gateway" }}
- path: /oms/api/?(.*)
{{- /* {{- else if eq $applicationName "project-minio" }}*/}}
{{- /* - path: /?(.*)/api/minios/?(.*)*/}}
{{- else if eq $applicationName "open-gateway" }}
- path: /open/api/?(.*)
{{- else }}
- path: /{{ $applicationName }}/?(.*)
{{- end }}
pathType: ImplementationSpecific
backend:
serviceName: {{ $key }}
servicePort: 8080
{{- end }}
{{- end }}
{{- else }}
{{- range $key,$value := .Values.apiGatewayApplication.manifest }}
{{- if $value }}
{{- $applicationName := ternary (trimPrefix "cmii-uav-" $key) (trimPrefix "cmii-" $key) (contains "cmii-uav" $key) -}}
{{- if eq $applicationName "material-warehouse" }}
- path: /{{ $TenantEnvironment }}/?(.*)/api/warehouses/?(.*)
{{- else if eq $applicationName "gateway" }}
- path: /{{ $TenantEnvironment }}/api/?(.*)
{{- else if eq $applicationName "admin-gateway" }}
- path: /{{ $TenantEnvironment }}/oms/api/?(.*)
{{- /* {{- else if eq $applicationName "project-minio" }}*/}}
{{- /* - path: /{{ $TenantEnvironment }}/?(.*)/api/minios/?(.*)*/}}
{{- else if eq $applicationName "open-gateway" }}
- path: /{{ $TenantEnvironment }}/open/api/?(.*)
{{- else }}
- path: /{{ $applicationName }}/?(.*)
{{- end }}
pathType: ImplementationSpecific
backend:
serviceName: {{ $key }}
servicePort: 8080
{{- end }}
{{- end }}
{{- end }}
{{- if $IsTlsEnables }}
tls:
- hosts:
- {{ $DeployDomainName }}
- secretName: {{ $DeployDomainName | quote }}
{{- end }}
---
{{- end }}
{{/*apiVersion: networking.k8s.io/v1beta1*/}}
{{/*kind: Ingress*/}}
{{/*metadata:*/}}
{{/* name: project-minio-ingress*/}}
{{/* namespace: {{ $namespace }}*/}}
{{/* labels:*/}}
{{/* type: {{ $.Values.apiGatewayApplication.type }}*/}}
{{/* accessmode: {{ $.Values.apiGatewayApplication.accessmode }}*/}}
{{/* helm.sh/chart: {{ include "uavcloud-ingress.name" $scope }}*/}}
{{/* app.kubernetes.io/managed-by: {{ $.Release.Service }}*/}}
{{/* {{- if $.Values.global.image.tag }}*/}}
{{/* app.kubernetes.io/version: {{ $.Values.global.image.tag | quote }}*/}}
{{/* {{- end }}*/}}
{{/* annotations:*/}}
{{/* {{- include "uavcloud-ingress.apiGateway.project-minio.annotations" $scope | nindent 4 }}*/}}
{{/* {{- if $IsTlsEnables }}*/}}
{{/* nginx.ingress.kubernetes.io/ssl-redirect: "true"*/}}
{{/* nginx.ingress.kubernetes.io/permanent-redirect-code: '301'*/}}
{{/* {{- end }}*/}}
{{/* nginx.ingress.kubernetes.io/configuration-snippet: |*/}}
{{/* proxy_set_header Upgrade $http_upgrade;*/}}
{{/* proxy_set_header Connection "Upgrade";*/}}
{{/*spec:*/}}
{{/* rules:*/}}
{{/* - host: {{ $DeployDomainName }}*/}}
{{/* http:*/}}
{{/* paths:*/}}
{{/* {{- if $IsPrivateDeployment }}*/}}
{{/* - path: /?(.*)/api/minio/?(.*)*/}}
{{/* {{- else }}*/}}
{{/* - path: /{{ $TenantEnvironment }}/?(.*)/api/minio/?(.*)*/}}
{{/* {{- end }}*/}}
{{/* pathType: ImplementationSpecific*/}}
{{/* backend:*/}}
{{/* serviceName: cmii-project-minio*/}}
{{/* servicePort: 8080*/}}
{{/* {{- if $IsTlsEnables }}*/}}
{{/* tls:*/}}
{{/* - hosts:*/}}
{{/* - {{ $DeployDomainName }}*/}}
{{/* - secretName: {{ $DeployDomainName | quote }}*/}}
{{/* {{- end }}*/}}
{{/*---*/}}

View File

@@ -0,0 +1,35 @@
{{- if and .Values.enabled .Values.backendApplication.enabled }}
{{- $namespace := .Release.Namespace -}}
{{- $TenantEnvironment := .Values.global.domain.TenantEnvironment -}}
{{- $scope := $ -}}
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: backend-applications-ingress
namespace: {{ $namespace }}
labels:
type: {{ .Values.backendApplication.type }}
accessmode: {{ $.Values.backendApplication.accessmode }}
helm.sh/chart: {{ include "all-ingress.name" $scope }}
app.kubernetes.io/managed-by: {{ $.Release.Service }}
{{- if $.Values.global.image.tag }}
app.kubernetes.io/version: {{ $.Values.global.image.tag | quote }}
{{- end }}
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/enable-cors: "true"
spec:
rules:
{{- range $key,$value := .Values.backendApplication.manifest }}
{{- $applicationName := $key | trunc 63 }}
- host: {{ $applicationName }}.uavcloud-{{ $TenantEnvironment }}.io
http:
paths:
- path: /
backend:
serviceName: {{ $applicationName }}
servicePort: 8080
{{- end }}
---
{{- end }}

View File

@@ -0,0 +1,121 @@
{{- if and .Values.enabled .Values.frontendApplication.enabled }}
{{- $namespace := .Release.Namespace -}}
{{- $TenantEnvironment := .Values.global.domain.TenantEnvironment -}}
{{- $DeployDomainName := ternary (first (regexSplit ":" .Values.global.domain.DeployDomainName -1)) ( .Values.global.domain.DeployDomainName ) (contains ":" .Values.global.domain.DeployDomainName) -}}
{{- $IsPrivateDeployment := .Values.global.domain.IsPrivateDeployment -}}
{{- $scope := $ -}}
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: frontend-applications-ingress
namespace: {{ $namespace }}
labels:
type: {{ .Values.frontendApplication.type }}
accessmode: {{ $.Values.frontendApplication.accessmode }}
helm.sh/chart: {{ include "all-ingress.name" $scope }}
app.kubernetes.io/managed-by: {{ $.Release.Service }}
{{- if $.Values.global.image.tag }}
app.kubernetes.io/version: {{ $.Values.global.image.tag | quote }}
{{- end }}
annotations:
{{- include "all-ingress.frontend.commom.annotations" $scope | nindent 4 }}
{{- if .Values.global.ingress.tls_enabled }}
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/permanent-redirect-code: '301'
{{- end }}
nginx.ingress.kubernetes.io/configuration-snippet: |
{{- range $applicationName, $values := .Values.frontendApplication.manifest }}
{{- if $IsPrivateDeployment }}
{{- if eq $values.shortname "" }}
{{- /* 主域名的情况, 域名改造 */}}
rewrite ^(/green)$ $1/ redirect;
rewrite ^(/supervision)$ $1/ redirect;
rewrite ^(/inspection)$ $1/ redirect;
rewrite ^(/pangu)$ $1/ redirect;
{{- /* 主域名的情况, 域名改造 end end end */}}
{{- else if not (contains "appli" $values.shortname) }}
{{- /* 特殊短域名的情况 */}}
{{- /* short name not contains application, judge for situations */}}
{{- if contains "-portal" $values.shortname}}
rewrite ^(/cmsportal)$ $1/ redirect;
{{- else if contains "-rescue" $values.shortname }}
rewrite ^(/{{ trimSuffix "-rescue" $values.shortname }})$ $1/ redirect;
{{- else if contains "screen" $values.shortname }}
rewrite ^(/ {{ trimSuffix "-screen" $values.shortname }})$ $1/ redirect;
{{- else }}
{{- /* 没有特殊规则的域名 全部会出现在这里 */}}
rewrite ^(/{{ $values.shortname }})$ $1/ redirect;
{{- end }}
{{- else if (contains "appli" $values.shortname) }}
rewrite ^(/{{ trimSuffix "-application" $values.shortname }})$ $1/ redirect;
{{- else }}
{{- /* 备份一下 以防万一 */}}
rewrite ^(/{{ $values.shortname }})$ $1/ redirect;
{{- end }}
{{- else }}
{{- if eq $values.shortname "" }}
rewrite ^(/{{- $TenantEnvironment -}})$ $1/ redirect;
{{- else }}
rewrite ^(/{{- cat $TenantEnvironment $values.shortname | replace " " "/" -}})$ $1/ redirect;
{{- end }}
{{- end }}
{{- end }}
spec:
rules:
- host: {{ $DeployDomainName }}
http:
paths:
{{- /* 域名改造, add for demo */}}
- path: /inspection/?(.*)
pathType: ImplementationSpecific
backend:
serviceName: cmii-uav-platform
servicePort: 9528
- path: /supervision/?(.*)
pathType: ImplementationSpecific
backend:
serviceName: cmii-uav-platform
servicePort: 9528
- path: /green/?(.*)
pathType: ImplementationSpecific
backend:
serviceName: cmii-uav-platform
servicePort: 9528
- path: /pangu/?(.*)
pathType: ImplementationSpecific
backend:
serviceName: cmii-uav-platform
servicePort: 9528
{{- /* 域名改造, end end end */}}
{{- range $applicationName, $values := .Values.frontendApplication.manifest }}
{{- if $IsPrivateDeployment }}
{{- if eq $values.shortname ""}}
- path: /?(.*)
{{- else if (contains "appli" $values.shortname) }}
- path: /{{ trimSuffix "-application" $values.shortname }}/?(.*)
{{- else }}
- path: /{{ $values.shortname }}/?(.*)
{{- end }}
{{- else }}
{{- if eq $values.shortname ""}}
- path: /{{ $TenantEnvironment }}/?(.*)
{{- else if not (contains "appli" $values.shortname) }}
- path: /{{ $TenantEnvironment }}/{{ trimSuffix "-application" $values.shortname }}/?(.*)
{{- else }}
- path: /{{- cat $TenantEnvironment $values.shortname | replace " " "/" -}}/?(.*)
{{- end }}
{{- end }}
pathType: ImplementationSpecific
backend:
serviceName: {{ $applicationName }}
servicePort: 9528
{{- end }}
{{- if .Values.global.ingress.tls_enabled }}
tls:
- hosts:
- {{ $DeployDomainName }}
- secretName: {{ $DeployDomainName | quote }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,156 @@
# Default values for uavcloud-ingress-core.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
global:
domain:
DeployDomainName: "lab.uavcmlc.com:31500" # will be overridden by upper values
TenantEnvironment: "outside" # please don't modify this, unless you know what you are doing
IsPrivateDeployment: true # please don't modify this, unless you know what you are doing
ingress:
tls_enabled: false
enabled: true
frontendApplication:
enabled: true
type: frontend
accessmode: public
manifest:
# AppFullName vs AppShortName for frontend applications
cmii-uav-platform:
shortname: ""
cmii-uav-platform-ai-brain:
shortname: "ai-brain"
ai-brain-dev: APP_i6mlNKODBo42OIVn
ai-brain-test: APP_0BF17ayVaSpY89O4
ai-brain-feature: APP_0BF17ayVaSpY89O4
ai-brain-devbase: APP_0BF17ayVaSpY89O4
ai-brain-uat: APP_kZeiSXxg9qZxj6ue
ai-brain-demo: APP_rafnuCAmBESIVYMH
ai-brain-outside: APP_rafnuCAmBESIVYMH # this is actually outside works, copy from demo
cmii-uav-platform-hyperspectral:
shortname: "hyper"
hyper-dev: APP_CN713PC4qwViGj1d
hyper-test: APP_xtN9XF2L1J4IRHaB
hyper-devbase: APP_xtN9XF2L1J4IRHaB
hyper-feature: APP_xtN9XF2L1J4IRHaB
hyper-uat: APP_OT4l1kYrzWT4tiif
hyper-demo: APP_xbMkKdsbsbv8SH4w
hyper-outside: APP_xbMkKdsbsbv8SH4w # this is actually outside works, copy from demo
cmii-uav-platform-mws:
shortname: "mws"
mws-dev: APP_4lVSVI0ZGxTssir8
mws-test: APP_MEeBJHp1fSVD1Wuw
mws-devbase: APP_MEeBJHp1fSVD1Wuw
mws-feature: APP_MEeBJHp1fSVD1Wuw
mws-uat: APP_U4GEiHutGQL5prSP
mws-demo: APP_uKniXPELlRERBBwK
mws-outside: APP_uKniXPELlRERBBwK # this is actually outside works, copy from demo
cmii-uav-platform-mws-admin:
shortname: "mws-admin"
cmii-uav-platform-oms:
shortname: "oms"
cmii-uav-platform-cms:
shortname: "cms"
cmii-uav-platform-cms-portal:
shortname: "cmsportal"
cmii-uav-platform-open:
shortname: "open"
cmii-uav-platform-splice:
shortname: "splice"
splice-dev: APP_bYdlPsBBIncZdaYR
splice-test: APP_l4HIMixfIXhlCTi9
splice-devbase: APP_l4HIMixfIXhlCTi9
splice-feature: APP_l4HIMixfIXhlCTi9
splice-uat: APP
splice-demo: APP_zE0M3sTRXrCIJS8Y
splice-outside: APP_zE0M3sTRXrCIJS8Y # this is actually outside works, copy from demo
cmii-uav-platform-splice-visual:
shortname: "splice-visual"
cmii-uav-platform-detection:
shortname: "detection"
detectiondemo: APP_FDHW2VLVDWPnnOCy
detection-outside: APP_FDHW2VLVDWPnnOCy # this is actually outside works, copy from demo
cmii-uav-platform-security:
shortname: "security"
security-demo: APP_JUSEMc7afyWXxvE7
security-outside: APP_JUSEMc7afyWXxvE7 # this is actually outside works, copy from demo
cmii-uav-platform-visualization:
shortname: "visualization"
visualization-demo: APP_Jc8i2wOQ1t73QEJS
visualization-outside: APP_Jc8i2wOQ1t73QEJS # this is actually outside works, copy from demo
cmii-uav-platform-logistics:
shortname: "logistics"
logistics-demo: APP_PvdfRRRBPL8xbIwl
logistics-outside: APP_PvdfRRRBPL8xbIwl
cmii-uav-platform-share:
shortname: "share"
share-demo: APP_4lVSVI0ZGxTssir8
share-outside: APP_4lVSVI0ZGxTssir8
cmii-uav-platform-base:
shortname: "base"
base-demo: APP_9LY41OaKSqk2btY0
base-outside: APP_9LY41OaKSqk2btY0 # this is actually outside works, copy from demo
cmii-uav-platform-traffic-screen:
shortname: "traffic"
traffic-demo: APP_PvdfRRRBPL8xbIwl
traffic-outside: APP_PvdfRRRBPL8xbIwl
cmii-uav-platform-emergency-rescue:
shortname: "emergency"
emergency-demo: APP_aGsTAY1uMZrpKdfk
emergency-outside: APP_aGsTAY1uMZrpKdfk
backendApplication:
enabled: true
type: backend
# this ingress is for swagger url, CI/CD url,they can only be accessed only by internal network
accessmode: internal
manifest:
# all backend applications
cmii-admin-data: false
cmii-admin-user: false
cmii-uav-airspace: false
cmii-uav-brain: false
cmii-uav-clusters: false
cmii-uav-data-post-process: false
cmii-uav-developer: false
cmii-uav-device: false
cmii-uav-kpi-monitor: false
cmii-uav-live: false
cmii-uav-logger: false
cmii-uav-mission: false
cmii-uav-monitor: false
cmii-uav-mqtthandler: false
cmii-uav-notice: false
cmii-uav-oauth: false
cmii-uav-process: false
cmii-uav-security-system: false
cmii-uav-surveillance: false
cmii-uav-user: false
cmii-uav-waypoint: false
cmii-uav-cms: false
cmii-uav-industrial-portfolio: false
cmii-project-minio: false
cmii-uav-material-warehouse: false
cmii-uav-gateway: false
cmii-open-gateway: false
cmii-admin-gateway: false
apiGatewayApplication:
enabled: true
type: "api-gateway"
# this ingress is for apis and gateways
accessmode: pulic
manifest:
# all applications need to expose api/gateway to public network
# cmii-project-minio: false # deprecated
cmii-uav-material-warehouse: true
cmii-uav-gateway: false
cmii-open-gateway: false
cmii-admin-gateway: false

View File

@@ -0,0 +1,24 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
ci/*

View File

@@ -0,0 +1,31 @@
apiVersion: v2
name: all-middleware
description: including all middlewares for the uavcloud platform,
such as mysql, redis, emqx, mongo, rabbitmq, nacos
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 2.2.2
keywords:
- uavcloud
- middleware
- template
- function
- chinamobile

View File

@@ -0,0 +1,22 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

View File

@@ -0,0 +1,23 @@
annotations:
category: Infrastructure
apiVersion: v2
appVersion: 1.7.0
description: A Library Helm Chart for grouping common logic between bitnami charts.
This chart is not deployable by itself.
home: https://github.com/bitnami/charts/tree/master/bitnami/common
icon: https://bitnami.com/downloads/logos/bitnami-mark.png
keywords:
- common
- helper
- template
- function
- bitnami
maintainers:
- email: containers@bitnami.com
name: Bitnami
name: common
sources:
- https://github.com/bitnami/charts
- http://www.bitnami.com/
type: library
version: 1.7.0

View File

@@ -0,0 +1,326 @@
# Bitnami Common Library Chart
A [Helm Library Chart](https://helm.sh/docs/topics/library_charts/#helm) for grouping common logic between bitnami charts.
## TL;DR
```yaml
dependencies:
- name: common
version: 0.x.x
repository: https://charts.bitnami.com/bitnami
```
```bash
$ helm dependency update
```
```yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "common.names.fullname" . }}
data:
myvalue: "Hello World"
```
## Introduction
This chart provides a common template helpers which can be used to develop new charts using [Helm](https://helm.sh) package manager.
Bitnami charts can be used with [Kubeapps](https://kubeapps.com/) for deployment and management of Helm Charts in clusters. This Helm chart has been tested on top of [Bitnami Kubernetes Production Runtime](https://kubeprod.io/) (BKPR). Deploy BKPR to get automated TLS certificates, logging and monitoring for your applications.
## Prerequisites
- Kubernetes 1.12+
- Helm 3.1.0
## Parameters
The following table lists the helpers available in the library which are scoped in different sections.
### Affinities
| Helper identifier | Description | Expected Input |
|-------------------------------|------------------------------------------------------|------------------------------------------------|
| `common.affinities.node.soft` | Return a soft nodeAffinity definition | `dict "key" "FOO" "values" (list "BAR" "BAZ")` |
| `common.affinities.node.hard` | Return a hard nodeAffinity definition | `dict "key" "FOO" "values" (list "BAR" "BAZ")` |
| `common.affinities.pod.soft` | Return a soft podAffinity/podAntiAffinity definition | `dict "component" "FOO" "context" $` |
| `common.affinities.pod.hard` | Return a hard podAffinity/podAntiAffinity definition | `dict "component" "FOO" "context" $` |
### Capabilities
| Helper identifier | Description | Expected Input |
|----------------------------------------------|------------------------------------------------------------------------------------------------|-------------------|
| `common.capabilities.kubeVersion` | Return the target Kubernetes version (using client default if .Values.kubeVersion is not set). | `.` Chart context |
| `common.capabilities.deployment.apiVersion` | Return the appropriate apiVersion for deployment. | `.` Chart context |
| `common.capabilities.statefulset.apiVersion` | Return the appropriate apiVersion for statefulset. | `.` Chart context |
| `common.capabilities.ingress.apiVersion` | Return the appropriate apiVersion for ingress. | `.` Chart context |
| `common.capabilities.rbac.apiVersion` | Return the appropriate apiVersion for RBAC resources. | `.` Chart context |
| `common.capabilities.crd.apiVersion` | Return the appropriate apiVersion for CRDs. | `.` Chart context |
| `common.capabilities.policy.apiVersion` | Return the appropriate apiVersion for policy | `.` Chart context |
| `common.capabilities.supportsHelmVersion` | Returns true if the used Helm version is 3.3+ | `.` Chart context |
### Errors
| Helper identifier | Description | Expected Input |
|-----------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|
| `common.errors.upgrade.passwords.empty` | It will ensure required passwords are given when we are upgrading a chart. If `validationErrors` is not empty it will throw an error and will stop the upgrade action. | `dict "validationErrors" (list $validationError00 $validationError01) "context" $` |
### Images
| Helper identifier | Description | Expected Input |
|-----------------------------|------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
| `common.images.image` | Return the proper and full image name | `dict "imageRoot" .Values.path.to.the.image "global" $`, see [ImageRoot](#imageroot) for the structure. |
| `common.images.pullSecrets` | Return the proper Docker Image Registry Secret Names (deprecated: use common.images.renderPullSecrets instead) | `dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "global" .Values.global` |
| `common.images.renderPullSecrets` | Return the proper Docker Image Registry Secret Names (evaluates values as templates) | `dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "context" $` |
### Ingress
| Helper identifier | Description | Expected Input |
|-------------------------------------------|----------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `common.ingress.backend` | Generate a proper Ingress backend entry depending on the API version | `dict "serviceName" "foo" "servicePort" "bar"`, see the [Ingress deprecation notice](https://kubernetes.io/blog/2019/07/18/api-deprecations-in-1-16/) for the syntax differences |
| `common.ingress.supportsPathType` | Prints "true" if the pathType field is supported | `.` Chart context |
| `common.ingress.supportsIngressClassname` | Prints "true" if the ingressClassname field is supported | `.` Chart context |
### Labels
| Helper identifier | Description | Expected Input |
|-----------------------------|------------------------------------------------------|-------------------|
| `common.labels.standard` | Return Kubernetes standard labels | `.` Chart context |
| `common.labels.matchLabels` | Return the proper Docker Image Registry Secret Names | `.` Chart context |
### Names
| Helper identifier | Description | Expected Inpput |
|-------------------------|------------------------------------------------------------|-------------------|
| `common.names.name` | Expand the name of the chart or use `.Values.nameOverride` | `.` Chart context |
| `common.names.fullname` | Create a default fully qualified app name. | `.` Chart context |
| `common.names.chart` | Chart name plus version | `.` Chart context |
### Secrets
| Helper identifier | Description | Expected Input |
|---------------------------|--------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `common.secrets.name` | Generate the name of the secret. | `dict "existingSecret" .Values.path.to.the.existingSecret "defaultNameSuffix" "mySuffix" "context" $` see [ExistingSecret](#existingsecret) for the structure. |
| `common.secrets.key` | Generate secret key. | `dict "existingSecret" .Values.path.to.the.existingSecret "key" "keyName"` see [ExistingSecret](#existingsecret) for the structure. |
| `common.passwords.manage` | Generate secret password or retrieve one if already created. | `dict "secret" "secret-name" "key" "keyName" "providedValues" (list "path.to.password1" "path.to.password2") "length" 10 "strong" false "chartName" "chartName" "context" $`, length, strong and chartNAme fields are optional. |
| `common.secrets.exists` | Returns whether a previous generated secret already exists. | `dict "secret" "secret-name" "context" $` |
### Storage
| Helper identifier | Description | Expected Input |
|-------------------------------|---------------------------------------|---------------------------------------------------------------------------------------------------------------------|
| `common.affinities.node.soft` | Return a soft nodeAffinity definition | `dict "persistence" .Values.path.to.the.persistence "global" $`, see [Persistence](#persistence) for the structure. |
### TplValues
| Helper identifier | Description | Expected Input |
|---------------------------|----------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|
| `common.tplvalues.render` | Renders a value that contains template | `dict "value" .Values.path.to.the.Value "context" $`, value is the value should rendered as template, context frequently is the chart context `$` or `.` |
### Utils
| Helper identifier | Description | Expected Input |
|--------------------------------|------------------------------------------------------------------------------------------|------------------------------------------------------------------------|
| `common.utils.fieldToEnvVar` | Build environment variable name given a field. | `dict "field" "my-password"` |
| `common.utils.secret.getvalue` | Print instructions to get a secret value. | `dict "secret" "secret-name" "field" "secret-value-field" "context" $` |
| `common.utils.getValueFromKey` | Gets a value from `.Values` object given its key path | `dict "key" "path.to.key" "context" $` |
| `common.utils.getKeyFromList` | Returns first `.Values` key with a defined value or first of the list if all non-defined | `dict "keys" (list "path.to.key1" "path.to.key2") "context" $` |
### Validations
| Helper identifier | Description | Expected Input |
|--------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `common.validations.values.single.empty` | Validate a value must not be empty. | `dict "valueKey" "path.to.value" "secret" "secret.name" "field" "my-password" "subchart" "subchart" "context" $` secret, field and subchart are optional. In case they are given, the helper will generate a how to get instruction. See [ValidateValue](#validatevalue) |
| `common.validations.values.multiple.empty` | Validate a multiple values must not be empty. It returns a shared error for all the values. | `dict "required" (list $validateValueConf00 $validateValueConf01) "context" $`. See [ValidateValue](#validatevalue) |
| `common.validations.values.mariadb.passwords` | This helper will ensure required password for MariaDB are not empty. It returns a shared error for all the values. | `dict "secret" "mariadb-secret" "subchart" "true" "context" $` subchart field is optional and could be true or false it depends on where you will use mariadb chart and the helper. |
| `common.validations.values.postgresql.passwords` | This helper will ensure required password for PostgreSQL are not empty. It returns a shared error for all the values. | `dict "secret" "postgresql-secret" "subchart" "true" "context" $` subchart field is optional and could be true or false it depends on where you will use postgresql chart and the helper. |
| `common.validations.values.redis.passwords` | This helper will ensure required password for Redis<sup>TM</sup> are not empty. It returns a shared error for all the values. | `dict "secret" "redis-secret" "subchart" "true" "context" $` subchart field is optional and could be true or false it depends on where you will use redis chart and the helper. |
| `common.validations.values.cassandra.passwords` | This helper will ensure required password for Cassandra are not empty. It returns a shared error for all the values. | `dict "secret" "cassandra-secret" "subchart" "true" "context" $` subchart field is optional and could be true or false it depends on where you will use cassandra chart and the helper. |
| `common.validations.values.mongodb.passwords` | This helper will ensure required password for MongoDB&reg; are not empty. It returns a shared error for all the values. | `dict "secret" "mongodb-secret" "subchart" "true" "context" $` subchart field is optional and could be true or false it depends on where you will use mongodb chart and the helper. |
### Warnings
| Helper identifier | Description | Expected Input |
|------------------------------|----------------------------------|------------------------------------------------------------|
| `common.warnings.rollingTag` | Warning about using rolling tag. | `ImageRoot` see [ImageRoot](#imageroot) for the structure. |
## Special input schemas
### ImageRoot
```yaml
registry:
type: string
description: Docker registry where the image is located
example: docker.io
repository:
type: string
description: Repository and image name
example: bitnami/nginx
tag:
type: string
description: image tag
example: 1.16.1-debian-10-r63
pullPolicy:
type: string
description: Specify a imagePullPolicy. Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
pullSecrets:
type: array
items:
type: string
description: Optionally specify an array of imagePullSecrets (evaluated as templates).
debug:
type: boolean
description: Set to true if you would like to see extra information on logs
example: false
## An instance would be:
# registry: docker.io
# repository: bitnami/nginx
# tag: 1.16.1-debian-10-r63
# pullPolicy: IfNotPresent
# debug: false
```
### Persistence
```yaml
enabled:
type: boolean
description: Whether enable persistence.
example: true
storageClass:
type: string
description: Ghost data Persistent Volume Storage Class, If set to "-", storageClassName: "" which disables dynamic provisioning.
example: "-"
accessMode:
type: string
description: Access mode for the Persistent Volume Storage.
example: ReadWriteOnce
size:
type: string
description: Size the Persistent Volume Storage.
example: 8Gi
path:
type: string
description: Path to be persisted.
example: /bitnami
## An instance would be:
# enabled: true
# storageClass: "-"
# accessMode: ReadWriteOnce
# size: 8Gi
# path: /bitnami
```
### ExistingSecret
```yaml
name:
type: string
description: Name of the existing secret.
example: mySecret
keyMapping:
description: Mapping between the expected key name and the name of the key in the existing secret.
type: object
## An instance would be:
# name: mySecret
# keyMapping:
# password: myPasswordKey
```
#### Example of use
When we store sensitive data for a deployment in a secret, some times we want to give to users the possibility of using theirs existing secrets.
```yaml
# templates/secret.yaml
---
apiVersion: v1
kind: Secret
metadata:
name: {{ include "common.names.fullname" . }}
labels:
app: {{ include "common.names.fullname" . }}
type: Opaque
data:
password: {{ .Values.password | b64enc | quote }}
# templates/dpl.yaml
---
...
env:
- name: PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "common.secrets.name" (dict "existingSecret" .Values.existingSecret "context" $) }}
key: {{ include "common.secrets.key" (dict "existingSecret" .Values.existingSecret "key" "password") }}
...
# values.yaml
---
name: mySecret
keyMapping:
password: myPasswordKey
```
### ValidateValue
#### NOTES.txt
```console
{{- $validateValueConf00 := (dict "valueKey" "path.to.value00" "secret" "secretName" "field" "password-00") -}}
{{- $validateValueConf01 := (dict "valueKey" "path.to.value01" "secret" "secretName" "field" "password-01") -}}
{{ include "common.validations.values.multiple.empty" (dict "required" (list $validateValueConf00 $validateValueConf01) "context" $) }}
```
If we force those values to be empty we will see some alerts
```console
$ helm install test mychart --set path.to.value00="",path.to.value01=""
'path.to.value00' must not be empty, please add '--set path.to.value00=$PASSWORD_00' to the command. To get the current value:
export PASSWORD_00=$(kubectl get secret --namespace default secretName -o jsonpath="{.data.password-00}" | base64 --decode)
'path.to.value01' must not be empty, please add '--set path.to.value01=$PASSWORD_01' to the command. To get the current value:
export PASSWORD_01=$(kubectl get secret --namespace default secretName -o jsonpath="{.data.password-01}" | base64 --decode)
```
## Upgrading
### To 1.0.0
[On November 13, 2020, Helm v2 support was formally finished](https://github.com/helm/charts#status-of-the-project), this major version is the result of the required changes applied to the Helm Chart to be able to incorporate the different features added in Helm v3 and to be consistent with the Helm project itself regarding the Helm v2 EOL.
**What changes were introduced in this major version?**
- Previous versions of this Helm Chart use `apiVersion: v1` (installable by both Helm 2 and 3), this Helm Chart was updated to `apiVersion: v2` (installable by Helm 3 only). [Here](https://helm.sh/docs/topics/charts/#the-apiversion-field) you can find more information about the `apiVersion` field.
- Use `type: library`. [Here](https://v3.helm.sh/docs/faq/#library-chart-support) you can find more information.
- The different fields present in the *Chart.yaml* file has been ordered alphabetically in a homogeneous way for all the Bitnami Helm Charts
**Considerations when upgrading to this version**
- If you want to upgrade to this version from a previous one installed with Helm v3, you shouldn't face any issues
- If you want to upgrade to this version using Helm v2, this scenario is not supported as this version doesn't support Helm v2 anymore
- If you installed the previous version with Helm v2 and wants to upgrade to this version with Helm v3, please refer to the [official Helm documentation](https://helm.sh/docs/topics/v2_v3_migration/#migration-use-cases) about migrating from Helm v2 to v3
**Useful links**
- https://docs.bitnami.com/tutorials/resolve-helm2-helm3-post-migration-issues/
- https://helm.sh/docs/topics/v2_v3_migration/
- https://helm.sh/blog/migrate-from-helm-v2-to-helm-v3/

View File

@@ -0,0 +1,102 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Return a soft nodeAffinity definition
{{ include "common.affinities.nodes.soft" (dict "key" "FOO" "values" (list "BAR" "BAZ")) -}}
*/}}
{{- define "common.affinities.nodes.soft" -}}
preferredDuringSchedulingIgnoredDuringExecution:
- preference:
matchExpressions:
- key: {{ .key }}
operator: In
values:
{{- range .values }}
- {{ . | quote }}
{{- end }}
weight: 1
{{- end -}}
{{/*
Return a hard nodeAffinity definition
{{ include "common.affinities.nodes.hard" (dict "key" "FOO" "values" (list "BAR" "BAZ")) -}}
*/}}
{{- define "common.affinities.nodes.hard" -}}
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: {{ .key }}
operator: In
values:
{{- range .values }}
- {{ . | quote }}
{{- end }}
{{- end -}}
{{/*
Return a nodeAffinity definition
{{ include "common.affinities.nodes" (dict "type" "soft" "key" "FOO" "values" (list "BAR" "BAZ")) -}}
*/}}
{{- define "common.affinities.nodes" -}}
{{- if eq .type "soft" }}
{{- include "common.affinities.nodes.soft" . -}}
{{- else if eq .type "hard" }}
{{- include "common.affinities.nodes.hard" . -}}
{{- end -}}
{{- end -}}
{{/*
Return a soft podAffinity/podAntiAffinity definition
{{ include "common.affinities.pods.soft" (dict "component" "FOO" "extraMatchLabels" .Values.extraMatchLabels "context" $) -}}
*/}}
{{- define "common.affinities.pods.soft" -}}
{{- $component := default "" .component -}}
{{- $extraMatchLabels := default (dict) .extraMatchLabels -}}
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels: {{- (include "common.labels.matchLabels" .context) | nindent 10 }}
{{- if not (empty $component) }}
{{ printf "app.kubernetes.io/component: %s" $component }}
{{- end }}
{{- range $key, $value := $extraMatchLabels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
namespaces:
- {{ .context.Release.Namespace | quote }}
topologyKey: kubernetes.io/hostname
weight: 1
{{- end -}}
{{/*
Return a hard podAffinity/podAntiAffinity definition
{{ include "common.affinities.pods.hard" (dict "component" "FOO" "extraMatchLabels" .Values.extraMatchLabels "context" $) -}}
*/}}
{{- define "common.affinities.pods.hard" -}}
{{- $component := default "" .component -}}
{{- $extraMatchLabels := default (dict) .extraMatchLabels -}}
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels: {{- (include "common.labels.matchLabels" .context) | nindent 8 }}
{{- if not (empty $component) }}
{{ printf "app.kubernetes.io/component: %s" $component }}
{{- end }}
{{- range $key, $value := $extraMatchLabels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
namespaces:
- {{ .context.Release.Namespace | quote }}
topologyKey: kubernetes.io/hostname
{{- end -}}
{{/*
Return a podAffinity/podAntiAffinity definition
{{ include "common.affinities.pods" (dict "type" "soft" "key" "FOO" "values" (list "BAR" "BAZ")) -}}
*/}}
{{- define "common.affinities.pods" -}}
{{- if eq .type "soft" }}
{{- include "common.affinities.pods.soft" . -}}
{{- else if eq .type "hard" }}
{{- include "common.affinities.pods.hard" . -}}
{{- end -}}
{{- end -}}

View File

@@ -0,0 +1,106 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Return the target Kubernetes version
*/}}
{{- define "common.capabilities.kubeVersion" -}}
{{- if .Values.global }}
{{- if .Values.global.kubeVersion }}
{{- .Values.global.kubeVersion -}}
{{- else }}
{{- default .Capabilities.KubeVersion.Version .Values.kubeVersion -}}
{{- end -}}
{{- else }}
{{- default .Capabilities.KubeVersion.Version .Values.kubeVersion -}}
{{- end -}}
{{- end -}}
{{/*
Return the appropriate apiVersion for policy.
*/}}
{{- define "common.capabilities.policy.apiVersion" -}}
{{- if semverCompare "<1.21-0" (include "common.capabilities.kubeVersion" .) -}}
{{- print "policy/v1beta1" -}}
{{- else -}}
{{- print "policy/v1" -}}
{{- end -}}
{{- end -}}
{{/*
Return the appropriate apiVersion for deployment.
*/}}
{{- define "common.capabilities.deployment.apiVersion" -}}
{{- if semverCompare "<1.14-0" (include "common.capabilities.kubeVersion" .) -}}
{{- print "extensions/v1beta1" -}}
{{- else -}}
{{- print "apps/v1" -}}
{{- end -}}
{{- end -}}
{{/*
Return the appropriate apiVersion for statefulset.
*/}}
{{- define "common.capabilities.statefulset.apiVersion" -}}
{{- if semverCompare "<1.14-0" (include "common.capabilities.kubeVersion" .) -}}
{{- print "apps/v1beta1" -}}
{{- else -}}
{{- print "apps/v1" -}}
{{- end -}}
{{- end -}}
{{/*
Return the appropriate apiVersion for ingress.
*/}}
{{- define "common.capabilities.ingress.apiVersion" -}}
{{- if .Values.ingress -}}
{{- if .Values.ingress.apiVersion -}}
{{- .Values.ingress.apiVersion -}}
{{- else if semverCompare "<1.14-0" (include "common.capabilities.kubeVersion" .) -}}
{{- print "extensions/v1beta1" -}}
{{- else if semverCompare "<1.19-0" (include "common.capabilities.kubeVersion" .) -}}
{{- print "networking.k8s.io/v1beta1" -}}
{{- else -}}
{{- print "networking.k8s.io/v1" -}}
{{- end }}
{{- else if semverCompare "<1.14-0" (include "common.capabilities.kubeVersion" .) -}}
{{- print "extensions/v1beta1" -}}
{{- else if semverCompare "<1.19-0" (include "common.capabilities.kubeVersion" .) -}}
{{- print "networking.k8s.io/v1beta1" -}}
{{- else -}}
{{- print "networking.k8s.io/v1" -}}
{{- end -}}
{{- end -}}
{{/*
Return the appropriate apiVersion for RBAC resources.
*/}}
{{- define "common.capabilities.rbac.apiVersion" -}}
{{- if semverCompare "<1.17-0" (include "common.capabilities.kubeVersion" .) -}}
{{- print "rbac.authorization.k8s.io/v1beta1" -}}
{{- else -}}
{{- print "rbac.authorization.k8s.io/v1" -}}
{{- end -}}
{{- end -}}
{{/*
Return the appropriate apiVersion for CRDs.
*/}}
{{- define "common.capabilities.crd.apiVersion" -}}
{{- if semverCompare "<1.19-0" (include "common.capabilities.kubeVersion" .) -}}
{{- print "apiextensions.k8s.io/v1beta1" -}}
{{- else -}}
{{- print "apiextensions.k8s.io/v1" -}}
{{- end -}}
{{- end -}}
{{/*
Returns true if the used Helm version is 3.3+.
A way to check the used Helm version was not introduced until version 3.3.0 with .Capabilities.HelmVersion, which contains an additional "{}}" structure.
This check is introduced as a regexMatch instead of {{ if .Capabilities.HelmVersion }} because checking for the key HelmVersion in <3.3 results in a "interface not found" error.
**To be removed when the catalog's minimun Helm version is 3.3**
*/}}
{{- define "common.capabilities.supportsHelmVersion" -}}
{{- if regexMatch "{(v[0-9])*[^}]*}}$" (.Capabilities | toString ) }}
{{- true -}}
{{- end -}}
{{- end -}}

View File

@@ -0,0 +1,23 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Through error when upgrading using empty passwords values that must not be empty.
Usage:
{{- $validationError00 := include "common.validations.values.single.empty" (dict "valueKey" "path.to.password00" "secret" "secretName" "field" "password-00") -}}
{{- $validationError01 := include "common.validations.values.single.empty" (dict "valueKey" "path.to.password01" "secret" "secretName" "field" "password-01") -}}
{{ include "common.errors.upgrade.passwords.empty" (dict "validationErrors" (list $validationError00 $validationError01) "context" $) }}
Required password params:
- validationErrors - String - Required. List of validation strings to be return, if it is empty it won't throw error.
- context - Context - Required. Parent context.
*/}}
{{- define "common.errors.upgrade.passwords.empty" -}}
{{- $validationErrors := join "" .validationErrors -}}
{{- if and $validationErrors .context.Release.IsUpgrade -}}
{{- $errorString := "\nPASSWORDS ERROR: You must provide your current passwords when upgrading the release." -}}
{{- $errorString = print $errorString "\n Note that even after reinstallation, old credentials may be needed as they may be kept in persistent volume claims." -}}
{{- $errorString = print $errorString "\n Further information can be obtained at https://docs.bitnami.com/general/how-to/troubleshoot-helm-chart-issues/#credential-errors-while-upgrading-chart-releases" -}}
{{- $errorString = print $errorString "\n%s" -}}
{{- printf $errorString $validationErrors | fail -}}
{{- end -}}
{{- end -}}

View File

@@ -0,0 +1,111 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Return the proper image name
{{ include "common.images.image" ( dict "imageRoot" .Values.path.to.the.image "global" $) }}
*/}}
{{- define "common.images.image" -}}
{{- $registryName := .imageRoot.registry -}}
{{- $repositoryName := .imageRoot.repository -}}
{{- $tag := .imageRoot.tag | toString -}}
{{- if .global }}
{{- if .global.imageRegistry }}
{{- $registryName = .global.imageRegistry -}}
{{- end -}}
{{- end -}}
{{- if $registryName }}
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
{{- else -}}
{{- printf "%s:%s" $repositoryName $tag -}}
{{- end -}}
{{- end -}}
{{- define "common.images.mysqlImage" -}}
{{/* mysql image */}}
{{- $registryName := .imageRoot.registry -}}
{{- $repositoryName := .imageRoot.repository -}}
{{- $tag := .imageRoot.tag | toString -}}
{{- if .global }}
{{- if .global.image.repository }}
{{- $registryName = .global.image.repository -}}
{{- end -}}
{{- end -}}
{{- if .global.image.repository }}
{{/* the only defrence is shown below */}}
{{- printf "%s/mysql:%s" $registryName $tag -}}
{{- else }}
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
{{- end -}}
{{- end -}}
{{- define "common.images.mysqlPermissionsImage" -}}
{{/* mysql image */}}
{{- $registryName := .imageRoot.registry -}}
{{- $repositoryName := .imageRoot.repository -}}
{{- $tag := .imageRoot.tag | toString -}}
{{- if .global }}
{{- if .global.image.repository }}
{{- $registryName = .global.image.repository -}}
{{- end -}}
{{- end -}}
{{- if .global.image.repository }}
{{/* the only defrence is shown below */}}
{{- printf "%s/bitnami-shell:%s" $registryName $tag -}}
{{- else }}
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
{{- end -}}
{{- end -}}
{{/*
Return the proper Docker Image Registry Secret Names (deprecated: use common.images.renderPullSecrets instead)
{{ include "common.images.pullSecrets" ( dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "global" .Values.global) }}
*/}}
{{- define "common.images.pullSecrets" -}}
{{- $pullSecrets := list }}
{{- if .global }}
{{- range .global.imagePullSecrets -}}
{{- $pullSecrets = append $pullSecrets . -}}
{{- end -}}
{{- end -}}
{{- range .images -}}
{{- range .pullSecrets -}}
{{- $pullSecrets = append $pullSecrets . -}}
{{- end -}}
{{- end -}}
{{- if (not (empty $pullSecrets)) }}
imagePullSecrets:
{{- range $pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end }}
{{- end -}}
{{/*
Return the proper Docker Image Registry Secret Names evaluating values as templates
{{ include "common.images.renderPullSecrets" ( dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "context" $) }}
*/}}
{{- define "common.images.renderPullSecrets" -}}
{{- $pullSecrets := list }}
{{- $context := .context }}
{{- if $context.Values.global }}
{{- range $context.Values.global.imagePullSecrets -}}
{{- $pullSecrets = append $pullSecrets (include "common.tplvalues.render" (dict "value" . "context" $context)) -}}
{{- end -}}
{{- end -}}
{{- range .images -}}
{{- range .pullSecrets -}}
{{- $pullSecrets = append $pullSecrets (include "common.tplvalues.render" (dict "value" . "context" $context)) -}}
{{- end -}}
{{- end -}}
{{- if (not (empty $pullSecrets)) }}
imagePullSecrets:
{{- range $pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end }}
{{- end -}}

View File

@@ -0,0 +1,55 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Generate backend entry that is compatible with all Kubernetes API versions.
Usage:
{{ include "common.ingress.backend" (dict "serviceName" "backendName" "servicePort" "backendPort" "context" $) }}
Params:
- serviceName - String. Name of an existing service backend
- servicePort - String/Int. Port name (or number) of the service. It will be translated to different yaml depending if it is a string or an integer.
- context - Dict - Required. The context for the template evaluation.
*/}}
{{- define "common.ingress.backend" -}}
{{- $apiVersion := (include "common.capabilities.ingress.apiVersion" .context) -}}
{{- if or (eq $apiVersion "extensions/v1beta1") (eq $apiVersion "networking.k8s.io/v1beta1") -}}
serviceName: {{ .serviceName }}
servicePort: {{ .servicePort }}
{{- else -}}
service:
name: {{ .serviceName }}
port:
{{- if typeIs "string" .servicePort }}
name: {{ .servicePort }}
{{- else if or (typeIs "int" .servicePort) (typeIs "float64" .servicePort) }}
number: {{ .servicePort | int }}
{{- end }}
{{- end -}}
{{- end -}}
{{/*
Print "true" if the API pathType field is supported
Usage:
{{ include "common.ingress.supportsPathType" . }}
*/}}
{{- define "common.ingress.supportsPathType" -}}
{{- if (semverCompare "<1.18-0" (include "common.capabilities.kubeVersion" .)) -}}
{{- print "false" -}}
{{- else -}}
{{- print "true" -}}
{{- end -}}
{{- end -}}
{{/*
Returns true if the ingressClassname field is supported
Usage:
{{ include "common.ingress.supportsIngressClassname" . }}
*/}}
{{- define "common.ingress.supportsIngressClassname" -}}
{{- if semverCompare "<1.18-0" (include "common.capabilities.kubeVersion" .) -}}
{{- print "false" -}}
{{- else -}}
{{- print "true" -}}
{{- end -}}
{{- end -}}

View File

@@ -0,0 +1,58 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Kubernetes standard labels
*/}}
{{- define "common.labels.middleware.minio" -}}
{{ include "common.labels.standard.middleware" . }}
cmii.app: minio
{{- end -}}
{{- define "common.labels.matchLabels.minio" -}}
{{ include "common.labels.matchLabels.middleware" . }}
cmii.app: minio
{{- end -}}
{{- define "common.labels.middleware.mysql" -}}
{{ include "common.labels.standard.middleware" . }}
cmii.app: mysql
{{- end -}}
{{- define "common.labels.matchLabels.mysql" -}}
{{ include "common.labels.matchLabels.middleware" . }}
cmii.app: mysql
{{- end -}}
{{- define "common.labels.middleware.redis" -}}
{{ include "common.labels.standard.middleware" . }}
cmii.app: redis
{{- end -}}
{{- define "common.labels.matchLabels.redis" -}}
{{ include "common.labels.matchLabels.middleware" . }}
cmii.app: redis
{{- end -}}
{{- define "common.labels.standard.middleware" -}}
{{ include "common.labels.standard" . }}
cmii.type: middleware
{{- end -}}
{{- define "common.labels.matchLabels.middleware" -}}
{{ include "common.labels.matchLabels" . }}
cmii.type: middleware
{{- end -}}
{{- define "common.labels.standard" -}}
app.kubernetes.io/name: {{ include "common.names.name" . }}
helm.sh/chart: {{ include "common.names.chart" . }}
app.kubernetes.io/release: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Chart.Name }}
{{- end -}}
{{/*
Labels to use on deploy.spec.selector.matchLabels and svc.spec.selector
*/}}
{{- define "common.labels.matchLabels" -}}
app.kubernetes.io/name: {{ include "common.names.name" . }}
app.kubernetes.io/release: {{ .Release.Name }}
{{- end -}}

View File

@@ -0,0 +1,32 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "common.names.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "common.names.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "common.names.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

View File

@@ -0,0 +1,129 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Generate secret name.
Usage:
{{ include "common.secrets.name" (dict "existingSecret" .Values.path.to.the.existingSecret "defaultNameSuffix" "mySuffix" "context" $) }}
Params:
- existingSecret - ExistingSecret/String - Optional. The path to the existing secrets in the values.yaml given by the user
to be used instead of the default one. Allows for it to be of type String (just the secret name) for backwards compatibility.
+info: https://github.com/bitnami/charts/tree/master/bitnami/common#existingsecret
- defaultNameSuffix - String - Optional. It is used only if we have several secrets in the same deployment.
- context - Dict - Required. The context for the template evaluation.
*/}}
{{- define "common.secrets.name" -}}
{{- $name := (include "common.names.fullname" .context) -}}
{{- if .defaultNameSuffix -}}
{{- $name = printf "%s-%s" $name .defaultNameSuffix | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- with .existingSecret -}}
{{- if not (typeIs "string" .) -}}
{{- with .name -}}
{{- $name = . -}}
{{- end -}}
{{- else -}}
{{- $name = . -}}
{{- end -}}
{{- end -}}
{{- printf "%s" $name -}}
{{- end -}}
{{/*
Generate secret key.
Usage:
{{ include "common.secrets.key" (dict "existingSecret" .Values.path.to.the.existingSecret "key" "keyName") }}
Params:
- existingSecret - ExistingSecret/String - Optional. The path to the existing secrets in the values.yaml given by the user
to be used instead of the default one. Allows for it to be of type String (just the secret name) for backwards compatibility.
+info: https://github.com/bitnami/charts/tree/master/bitnami/common#existingsecret
- key - String - Required. Name of the key in the secret.
*/}}
{{- define "common.secrets.key" -}}
{{- $key := .key -}}
{{- if .existingSecret -}}
{{- if not (typeIs "string" .existingSecret) -}}
{{- if .existingSecret.keyMapping -}}
{{- $key = index .existingSecret.keyMapping $.key -}}
{{- end -}}
{{- end }}
{{- end -}}
{{- printf "%s" $key -}}
{{- end -}}
{{/*
Generate secret password or retrieve one if already created.
Usage:
{{ include "common.secrets.passwords.manage" (dict "secret" "secret-name" "key" "keyName" "providedValues" (list "path.to.password1" "path.to.password2") "length" 10 "strong" false "chartName" "chartName" "context" $) }}
Params:
- secret - String - Required - Name of the 'Secret' resource where the password is stored.
- key - String - Required - Name of the key in the secret.
- providedValues - List<String> - Required - The path to the validating value in the values.yaml, e.g: "mysql.password". Will pick first parameter with a defined value.
- length - int - Optional - Length of the generated random password.
- strong - Boolean - Optional - Whether to add symbols to the generated random password.
- chartName - String - Optional - Name of the chart used when said chart is deployed as a subchart.
- context - Context - Required - Parent context.
*/}}
{{- define "common.secrets.passwords.manage" -}}
{{- $password := "" }}
{{- $subchart := "" }}
{{- $chartName := default "" .chartName }}
{{- $passwordLength := default 10 .length }}
{{- $providedPasswordKey := include "common.utils.getKeyFromList" (dict "keys" .providedValues "context" $.context) }}
{{- $providedPasswordValue := include "common.utils.getValueFromKey" (dict "key" $providedPasswordKey "context" $.context) }}
{{- $secret := (lookup "v1" "Secret" $.context.Release.Namespace .secret) }}
{{- if $secret }}
{{- if index $secret.data .key }}
{{- $password = index $secret.data .key }}
{{- end -}}
{{- else if $providedPasswordValue }}
{{- $password = $providedPasswordValue | toString | b64enc | quote }}
{{- else }}
{{- if .context.Values.enabled }}
{{- $subchart = $chartName }}
{{- end -}}
{{- $requiredPassword := dict "valueKey" $providedPasswordKey "secret" .secret "field" .key "subchart" $subchart "context" $.context -}}
{{- $requiredPasswordError := include "common.validations.values.single.empty" $requiredPassword -}}
{{- $passwordValidationErrors := list $requiredPasswordError -}}
{{- include "common.errors.upgrade.passwords.empty" (dict "validationErrors" $passwordValidationErrors "context" $.context) -}}
{{- if .strong }}
{{- $subStr := list (lower (randAlpha 1)) (randNumeric 1) (upper (randAlpha 1)) | join "_" }}
{{- $password = randAscii $passwordLength }}
{{- $password = regexReplaceAllLiteral "\\W" $password "@" | substr 5 $passwordLength }}
{{- $password = printf "%s%s" $subStr $password | toString | shuffle | b64enc | quote }}
{{- else }}
{{- $password = randAlphaNum $passwordLength | b64enc | quote }}
{{- end }}
{{- end -}}
{{- printf "%s" $password -}}
{{- end -}}
{{/*
Returns whether a previous generated secret already exists
Usage:
{{ include "common.secrets.exists" (dict "secret" "secret-name" "context" $) }}
Params:
- secret - String - Required - Name of the 'Secret' resource where the password is stored.
- context - Context - Required - Parent context.
*/}}
{{- define "common.secrets.exists" -}}
{{- $secret := (lookup "v1" "Secret" $.context.Release.Namespace .secret) }}
{{- if $secret }}
{{- true -}}
{{- end -}}
{{- end -}}

View File

@@ -0,0 +1,23 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Return the proper Storage Class
{{ include "common.storage.class" ( dict "persistence" .Values.path.to.the.persistence "global" $) }}
*/}}
{{- define "common.storage.class" -}}
{{- $storageClass := .persistence.storageClass -}}
{{- if .global -}}
{{- if .global.storageClass -}}
{{- $storageClass = .global.storageClass -}}
{{- end -}}
{{- end -}}
{{- if $storageClass -}}
{{- if (eq "-" $storageClass) -}}
{{- printf "storageClassName: \"\"" -}}
{{- else }}
{{- printf "storageClassName: %s" $storageClass -}}
{{- end -}}
{{- end -}}
{{- end -}}

View File

@@ -0,0 +1,13 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Renders a value that contains template.
Usage:
{{ include "common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $) }}
*/}}
{{- define "common.tplvalues.render" -}}
{{- if typeIs "string" .value }}
{{- tpl .value .context }}
{{- else }}
{{- tpl (.value | toYaml) .context }}
{{- end }}
{{- end -}}

View File

@@ -0,0 +1,62 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Print instructions to get a secret value.
Usage:
{{ include "common.utils.secret.getvalue" (dict "secret" "secret-name" "field" "secret-value-field" "context" $) }}
*/}}
{{- define "common.utils.secret.getvalue" -}}
{{- $varname := include "common.utils.fieldToEnvVar" . -}}
export {{ $varname }}=$(kubectl get secret --namespace {{ .context.Release.Namespace | quote }} {{ .secret }} -o jsonpath="{.data.{{ .field }}}" | base64 --decode)
{{- end -}}
{{/*
Build env var name given a field
Usage:
{{ include "common.utils.fieldToEnvVar" dict "field" "my-password" }}
*/}}
{{- define "common.utils.fieldToEnvVar" -}}
{{- $fieldNameSplit := splitList "-" .field -}}
{{- $upperCaseFieldNameSplit := list -}}
{{- range $fieldNameSplit -}}
{{- $upperCaseFieldNameSplit = append $upperCaseFieldNameSplit ( upper . ) -}}
{{- end -}}
{{ join "_" $upperCaseFieldNameSplit }}
{{- end -}}
{{/*
Gets a value from .Values given
Usage:
{{ include "common.utils.getValueFromKey" (dict "key" "path.to.key" "context" $) }}
*/}}
{{- define "common.utils.getValueFromKey" -}}
{{- $splitKey := splitList "." .key -}}
{{- $value := "" -}}
{{- $latestObj := $.context.Values -}}
{{- range $splitKey -}}
{{- if not $latestObj -}}
{{- printf "please review the entire path of '%s' exists in values" $.key | fail -}}
{{- end -}}
{{- $value = ( index $latestObj . ) -}}
{{- $latestObj = $value -}}
{{- end -}}
{{- printf "%v" (default "" $value) -}}
{{- end -}}
{{/*
Returns first .Values key with a defined value or first of the list if all non-defined
Usage:
{{ include "common.utils.getKeyFromList" (dict "keys" (list "path.to.key1" "path.to.key2") "context" $) }}
*/}}
{{- define "common.utils.getKeyFromList" -}}
{{- $key := first .keys -}}
{{- $reverseKeys := reverse .keys }}
{{- range $reverseKeys }}
{{- $value := include "common.utils.getValueFromKey" (dict "key" . "context" $.context ) }}
{{- if $value -}}
{{- $key = . }}
{{- end -}}
{{- end -}}
{{- printf "%s" $key -}}
{{- end -}}

View File

@@ -0,0 +1,14 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Warning about using rolling tag.
Usage:
{{ include "common.warnings.rollingTag" .Values.path.to.the.imageRoot }}
*/}}
{{- define "common.warnings.rollingTag" -}}
{{- if and (contains "bitnami/" .repository) (not (.tag | toString | regexFind "-r\\d+$|sha256:")) }}
WARNING: Rolling tag detected ({{ .repository }}:{{ .tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment.
+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/
{{- end }}
{{- end -}}

View File

@@ -0,0 +1,72 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Validate Cassandra required passwords are not empty.
Usage:
{{ include "common.validations.values.cassandra.passwords" (dict "secret" "secretName" "subchart" false "context" $) }}
Params:
- secret - String - Required. Name of the secret where Cassandra values are stored, e.g: "cassandra-passwords-secret"
- subchart - Boolean - Optional. Whether Cassandra is used as subchart or not. Default: false
*/}}
{{- define "common.validations.values.cassandra.passwords" -}}
{{- $existingSecret := include "common.cassandra.values.existingSecret" . -}}
{{- $enabled := include "common.cassandra.values.enabled" . -}}
{{- $dbUserPrefix := include "common.cassandra.values.key.dbUser" . -}}
{{- $valueKeyPassword := printf "%s.password" $dbUserPrefix -}}
{{- if and (not $existingSecret) (eq $enabled "true") -}}
{{- $requiredPasswords := list -}}
{{- $requiredPassword := dict "valueKey" $valueKeyPassword "secret" .secret "field" "cassandra-password" -}}
{{- $requiredPasswords = append $requiredPasswords $requiredPassword -}}
{{- include "common.validations.values.multiple.empty" (dict "required" $requiredPasswords "context" .context) -}}
{{- end -}}
{{- end -}}
{{/*
Auxiliary function to get the right value for existingSecret.
Usage:
{{ include "common.cassandra.values.existingSecret" (dict "context" $) }}
Params:
- subchart - Boolean - Optional. Whether Cassandra is used as subchart or not. Default: false
*/}}
{{- define "common.cassandra.values.existingSecret" -}}
{{- if .subchart -}}
{{- .context.Values.cassandra.dbUser.existingSecret | quote -}}
{{- else -}}
{{- .context.Values.dbUser.existingSecret | quote -}}
{{- end -}}
{{- end -}}
{{/*
Auxiliary function to get the right value for enabled cassandra.
Usage:
{{ include "common.cassandra.values.enabled" (dict "context" $) }}
*/}}
{{- define "common.cassandra.values.enabled" -}}
{{- if .subchart -}}
{{- printf "%v" .context.Values.cassandra.enabled -}}
{{- else -}}
{{- printf "%v" (not .context.Values.enabled) -}}
{{- end -}}
{{- end -}}
{{/*
Auxiliary function to get the right value for the key dbUser
Usage:
{{ include "common.cassandra.values.key.dbUser" (dict "subchart" "true" "context" $) }}
Params:
- subchart - Boolean - Optional. Whether Cassandra is used as subchart or not. Default: false
*/}}
{{- define "common.cassandra.values.key.dbUser" -}}
{{- if .subchart -}}
cassandra.dbUser
{{- else -}}
dbUser
{{- end -}}
{{- end -}}

View File

@@ -0,0 +1,103 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Validate MariaDB required passwords are not empty.
Usage:
{{ include "common.validations.values.mariadb.passwords" (dict "secret" "secretName" "subchart" false "context" $) }}
Params:
- secret - String - Required. Name of the secret where MariaDB values are stored, e.g: "mysql-passwords-secret"
- subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false
*/}}
{{- define "common.validations.values.mariadb.passwords" -}}
{{- $existingSecret := include "common.mariadb.values.auth.existingSecret" . -}}
{{- $enabled := include "common.mariadb.values.enabled" . -}}
{{- $architecture := include "common.mariadb.values.architecture" . -}}
{{- $authPrefix := include "common.mariadb.values.key.auth" . -}}
{{- $valueKeyRootPassword := printf "%s.rootPassword" $authPrefix -}}
{{- $valueKeyUsername := printf "%s.username" $authPrefix -}}
{{- $valueKeyPassword := printf "%s.password" $authPrefix -}}
{{- $valueKeyReplicationPassword := printf "%s.replicationPassword" $authPrefix -}}
{{- if and (not $existingSecret) (eq $enabled "true") -}}
{{- $requiredPasswords := list -}}
{{- $requiredRootPassword := dict "valueKey" $valueKeyRootPassword "secret" .secret "field" "mariadb-root-password" -}}
{{- $requiredPasswords = append $requiredPasswords $requiredRootPassword -}}
{{- $valueUsername := include "common.utils.getValueFromKey" (dict "key" $valueKeyUsername "context" .context) }}
{{- if not (empty $valueUsername) -}}
{{- $requiredPassword := dict "valueKey" $valueKeyPassword "secret" .secret "field" "mariadb-password" -}}
{{- $requiredPasswords = append $requiredPasswords $requiredPassword -}}
{{- end -}}
{{- if (eq $architecture "replication") -}}
{{- $requiredReplicationPassword := dict "valueKey" $valueKeyReplicationPassword "secret" .secret "field" "mariadb-replication-password" -}}
{{- $requiredPasswords = append $requiredPasswords $requiredReplicationPassword -}}
{{- end -}}
{{- include "common.validations.values.multiple.empty" (dict "required" $requiredPasswords "context" .context) -}}
{{- end -}}
{{- end -}}
{{/*
Auxiliary function to get the right value for existingSecret.
Usage:
{{ include "common.mariadb.values.auth.existingSecret" (dict "context" $) }}
Params:
- subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false
*/}}
{{- define "common.mariadb.values.auth.existingSecret" -}}
{{- if .subchart -}}
{{- .context.Values.mariadb.auth.existingSecret | quote -}}
{{- else -}}
{{- .context.Values.auth.existingSecret | quote -}}
{{- end -}}
{{- end -}}
{{/*
Auxiliary function to get the right value for enabled mariadb.
Usage:
{{ include "common.mariadb.values.enabled" (dict "context" $) }}
*/}}
{{- define "common.mariadb.values.enabled" -}}
{{- if .subchart -}}
{{- printf "%v" .context.Values.mariadb.enabled -}}
{{- else -}}
{{- printf "%v" (not .context.Values.enabled) -}}
{{- end -}}
{{- end -}}
{{/*
Auxiliary function to get the right value for architecture
Usage:
{{ include "common.mariadb.values.architecture" (dict "subchart" "true" "context" $) }}
Params:
- subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false
*/}}
{{- define "common.mariadb.values.architecture" -}}
{{- if .subchart -}}
{{- .context.Values.mariadb.architecture -}}
{{- else -}}
{{- .context.Values.architecture -}}
{{- end -}}
{{- end -}}
{{/*
Auxiliary function to get the right value for the key auth
Usage:
{{ include "common.mariadb.values.key.auth" (dict "subchart" "true" "context" $) }}
Params:
- subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false
*/}}
{{- define "common.mariadb.values.key.auth" -}}
{{- if .subchart -}}
mariadb.auth
{{- else -}}
auth
{{- end -}}
{{- end -}}

View File

@@ -0,0 +1,108 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Validate MongoDB(R) required passwords are not empty.
Usage:
{{ include "common.validations.values.mongodb.passwords" (dict "secret" "secretName" "subchart" false "context" $) }}
Params:
- secret - String - Required. Name of the secret where MongoDB(R) values are stored, e.g: "mongodb-passwords-secret"
- subchart - Boolean - Optional. Whether MongoDB(R) is used as subchart or not. Default: false
*/}}
{{- define "common.validations.values.mongodb.passwords" -}}
{{- $existingSecret := include "common.mongodb.values.auth.existingSecret" . -}}
{{- $enabled := include "common.mongodb.values.enabled" . -}}
{{- $authPrefix := include "common.mongodb.values.key.auth" . -}}
{{- $architecture := include "common.mongodb.values.architecture" . -}}
{{- $valueKeyRootPassword := printf "%s.rootPassword" $authPrefix -}}
{{- $valueKeyUsername := printf "%s.username" $authPrefix -}}
{{- $valueKeyDatabase := printf "%s.database" $authPrefix -}}
{{- $valueKeyPassword := printf "%s.password" $authPrefix -}}
{{- $valueKeyReplicaSetKey := printf "%s.replicaSetKey" $authPrefix -}}
{{- $valueKeyAuthEnabled := printf "%s.enabled" $authPrefix -}}
{{- $authEnabled := include "common.utils.getValueFromKey" (dict "key" $valueKeyAuthEnabled "context" .context) -}}
{{- if and (not $existingSecret) (eq $enabled "true") (eq $authEnabled "true") -}}
{{- $requiredPasswords := list -}}
{{- $requiredRootPassword := dict "valueKey" $valueKeyRootPassword "secret" .secret "field" "mongodb-root-password" -}}
{{- $requiredPasswords = append $requiredPasswords $requiredRootPassword -}}
{{- $valueUsername := include "common.utils.getValueFromKey" (dict "key" $valueKeyUsername "context" .context) }}
{{- $valueDatabase := include "common.utils.getValueFromKey" (dict "key" $valueKeyDatabase "context" .context) }}
{{- if and $valueUsername $valueDatabase -}}
{{- $requiredPassword := dict "valueKey" $valueKeyPassword "secret" .secret "field" "mongodb-password" -}}
{{- $requiredPasswords = append $requiredPasswords $requiredPassword -}}
{{- end -}}
{{- if (eq $architecture "replicaset") -}}
{{- $requiredReplicaSetKey := dict "valueKey" $valueKeyReplicaSetKey "secret" .secret "field" "mongodb-replica-set-key" -}}
{{- $requiredPasswords = append $requiredPasswords $requiredReplicaSetKey -}}
{{- end -}}
{{- include "common.validations.values.multiple.empty" (dict "required" $requiredPasswords "context" .context) -}}
{{- end -}}
{{- end -}}
{{/*
Auxiliary function to get the right value for existingSecret.
Usage:
{{ include "common.mongodb.values.auth.existingSecret" (dict "context" $) }}
Params:
- subchart - Boolean - Optional. Whether MongoDb is used as subchart or not. Default: false
*/}}
{{- define "common.mongodb.values.auth.existingSecret" -}}
{{- if .subchart -}}
{{- .context.Values.mongodb.auth.existingSecret | quote -}}
{{- else -}}
{{- .context.Values.auth.existingSecret | quote -}}
{{- end -}}
{{- end -}}
{{/*
Auxiliary function to get the right value for enabled mongodb.
Usage:
{{ include "common.mongodb.values.enabled" (dict "context" $) }}
*/}}
{{- define "common.mongodb.values.enabled" -}}
{{- if .subchart -}}
{{- printf "%v" .context.Values.mongodb.enabled -}}
{{- else -}}
{{- printf "%v" (not .context.Values.enabled) -}}
{{- end -}}
{{- end -}}
{{/*
Auxiliary function to get the right value for the key auth
Usage:
{{ include "common.mongodb.values.key.auth" (dict "subchart" "true" "context" $) }}
Params:
- subchart - Boolean - Optional. Whether MongoDB(R) is used as subchart or not. Default: false
*/}}
{{- define "common.mongodb.values.key.auth" -}}
{{- if .subchart -}}
mongodb.auth
{{- else -}}
auth
{{- end -}}
{{- end -}}
{{/*
Auxiliary function to get the right value for architecture
Usage:
{{ include "common.mongodb.values.architecture" (dict "subchart" "true" "context" $) }}
Params:
- subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false
*/}}
{{- define "common.mongodb.values.architecture" -}}
{{- if .subchart -}}
{{- .context.Values.mongodb.architecture -}}
{{- else -}}
{{- .context.Values.architecture -}}
{{- end -}}
{{- end -}}

View File

@@ -0,0 +1,131 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Validate PostgreSQL required passwords are not empty.
Usage:
{{ include "common.validations.values.postgresql.passwords" (dict "secret" "secretName" "subchart" false "context" $) }}
Params:
- secret - String - Required. Name of the secret where postgresql values are stored, e.g: "postgresql-passwords-secret"
- subchart - Boolean - Optional. Whether postgresql is used as subchart or not. Default: false
*/}}
{{- define "common.validations.values.postgresql.passwords" -}}
{{- $existingSecret := include "common.postgresql.values.existingSecret" . -}}
{{- $enabled := include "common.postgresql.values.enabled" . -}}
{{- $valueKeyPostgresqlPassword := include "common.postgresql.values.key.postgressPassword" . -}}
{{- $valueKeyPostgresqlReplicationEnabled := include "common.postgresql.values.key.replicationPassword" . -}}
{{- if and (not $existingSecret) (eq $enabled "true") -}}
{{- $requiredPasswords := list -}}
{{- $requiredPostgresqlPassword := dict "valueKey" $valueKeyPostgresqlPassword "secret" .secret "field" "postgresql-password" -}}
{{- $requiredPasswords = append $requiredPasswords $requiredPostgresqlPassword -}}
{{- $enabledReplication := include "common.postgresql.values.enabled.replication" . -}}
{{- if (eq $enabledReplication "true") -}}
{{- $requiredPostgresqlReplicationPassword := dict "valueKey" $valueKeyPostgresqlReplicationEnabled "secret" .secret "field" "postgresql-replication-password" -}}
{{- $requiredPasswords = append $requiredPasswords $requiredPostgresqlReplicationPassword -}}
{{- end -}}
{{- include "common.validations.values.multiple.empty" (dict "required" $requiredPasswords "context" .context) -}}
{{- end -}}
{{- end -}}
{{/*
Auxiliary function to decide whether evaluate global values.
Usage:
{{ include "common.postgresql.values.use.global" (dict "key" "key-of-global" "context" $) }}
Params:
- key - String - Required. Field to be evaluated within global, e.g: "existingSecret"
*/}}
{{- define "common.postgresql.values.use.global" -}}
{{- if .context.Values.global -}}
{{- if .context.Values.global.postgresql -}}
{{- index .context.Values.global.postgresql .key | quote -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
Auxiliary function to get the right value for existingSecret.
Usage:
{{ include "common.postgresql.values.existingSecret" (dict "context" $) }}
*/}}
{{- define "common.postgresql.values.existingSecret" -}}
{{- $globalValue := include "common.postgresql.values.use.global" (dict "key" "existingSecret" "context" .context) -}}
{{- if .subchart -}}
{{- default (.context.Values.postgresql.existingSecret | quote) $globalValue -}}
{{- else -}}
{{- default (.context.Values.existingSecret | quote) $globalValue -}}
{{- end -}}
{{- end -}}
{{/*
Auxiliary function to get the right value for enabled postgresql.
Usage:
{{ include "common.postgresql.values.enabled" (dict "context" $) }}
*/}}
{{- define "common.postgresql.values.enabled" -}}
{{- if .subchart -}}
{{- printf "%v" .context.Values.postgresql.enabled -}}
{{- else -}}
{{- printf "%v" (not .context.Values.enabled) -}}
{{- end -}}
{{- end -}}
{{/*
Auxiliary function to get the right value for the key postgressPassword.
Usage:
{{ include "common.postgresql.values.key.postgressPassword" (dict "subchart" "true" "context" $) }}
Params:
- subchart - Boolean - Optional. Whether postgresql is used as subchart or not. Default: false
*/}}
{{- define "common.postgresql.values.key.postgressPassword" -}}
{{- $globalValue := include "common.postgresql.values.use.global" (dict "key" "postgresqlUsername" "context" .context) -}}
{{- if not $globalValue -}}
{{- if .subchart -}}
postgresql.postgresqlPassword
{{- else -}}
postgresqlPassword
{{- end -}}
{{- else -}}
global.postgresql.postgresqlPassword
{{- end -}}
{{- end -}}
{{/*
Auxiliary function to get the right value for enabled.replication.
Usage:
{{ include "common.postgresql.values.enabled.replication" (dict "subchart" "true" "context" $) }}
Params:
- subchart - Boolean - Optional. Whether postgresql is used as subchart or not. Default: false
*/}}
{{- define "common.postgresql.values.enabled.replication" -}}
{{- if .subchart -}}
{{- printf "%v" .context.Values.postgresql.replication.enabled -}}
{{- else -}}
{{- printf "%v" .context.Values.replication.enabled -}}
{{- end -}}
{{- end -}}
{{/*
Auxiliary function to get the right value for the key replication.password.
Usage:
{{ include "common.postgresql.values.key.replicationPassword" (dict "subchart" "true" "context" $) }}
Params:
- subchart - Boolean - Optional. Whether postgresql is used as subchart or not. Default: false
*/}}
{{- define "common.postgresql.values.key.replicationPassword" -}}
{{- if .subchart -}}
postgresql.replication.password
{{- else -}}
replication.password
{{- end -}}
{{- end -}}

View File

@@ -0,0 +1,76 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Validate Redis(TM) required passwords are not empty.
Usage:
{{ include "common.validations.values.redis.passwords" (dict "secret" "secretName" "subchart" false "context" $) }}
Params:
- secret - String - Required. Name of the secret where redis values are stored, e.g: "redis-passwords-secret"
- subchart - Boolean - Optional. Whether redis is used as subchart or not. Default: false
*/}}
{{- define "common.validations.values.redis.passwords" -}}
{{- $enabled := include "common.redis.values.enabled" . -}}
{{- $valueKeyPrefix := include "common.redis.values.keys.prefix" . -}}
{{- $standarizedVersion := include "common.redis.values.standarized.version" . }}
{{- $existingSecret := ternary (printf "%s%s" $valueKeyPrefix "auth.existingSecret") (printf "%s%s" $valueKeyPrefix "existingSecret") (eq $standarizedVersion "true") }}
{{- $existingSecretValue := include "common.utils.getValueFromKey" (dict "key" $existingSecret "context" .context) }}
{{- $valueKeyRedisPassword := ternary (printf "%s%s" $valueKeyPrefix "auth.password") (printf "%s%s" $valueKeyPrefix "password") (eq $standarizedVersion "true") }}
{{- $valueKeyRedisUseAuth := ternary (printf "%s%s" $valueKeyPrefix "auth.enabled") (printf "%s%s" $valueKeyPrefix "usePassword") (eq $standarizedVersion "true") }}
{{- if and (not $existingSecretValue) (eq $enabled "true") -}}
{{- $requiredPasswords := list -}}
{{- $useAuth := include "common.utils.getValueFromKey" (dict "key" $valueKeyRedisUseAuth "context" .context) -}}
{{- if eq $useAuth "true" -}}
{{- $requiredRedisPassword := dict "valueKey" $valueKeyRedisPassword "secret" .secret "field" "redis-password" -}}
{{- $requiredPasswords = append $requiredPasswords $requiredRedisPassword -}}
{{- end -}}
{{- include "common.validations.values.multiple.empty" (dict "required" $requiredPasswords "context" .context) -}}
{{- end -}}
{{- end -}}
{{/*
Auxiliary function to get the right value for enabled redis.
Usage:
{{ include "common.redis.values.enabled" (dict "context" $) }}
*/}}
{{- define "common.redis.values.enabled" -}}
{{- if .subchart -}}
{{- printf "%v" .context.Values.redis.enabled -}}
{{- else -}}
{{- printf "%v" (not .context.Values.enabled) -}}
{{- end -}}
{{- end -}}
{{/*
Auxiliary function to get the right prefix path for the values
Usage:
{{ include "common.redis.values.key.prefix" (dict "subchart" "true" "context" $) }}
Params:
- subchart - Boolean - Optional. Whether redis is used as subchart or not. Default: false
*/}}
{{- define "common.redis.values.keys.prefix" -}}
{{- if .subchart -}}redis.{{- else -}}{{- end -}}
{{- end -}}
{{/*
Checks whether the redis chart's includes the standarizations (version >= 14)
Usage:
{{ include "common.redis.values.standarized.version" (dict "context" $) }}
*/}}
{{- define "common.redis.values.standarized.version" -}}
{{- $standarizedAuth := printf "%s%s" (include "common.redis.values.keys.prefix" .) "auth" -}}
{{- $standarizedAuthValues := include "common.utils.getValueFromKey" (dict "key" $standarizedAuth "context" .context) }}
{{- if $standarizedAuthValues -}}
{{- true -}}
{{- end -}}
{{- end -}}

View File

@@ -0,0 +1,46 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Validate values must not be empty.
Usage:
{{- $validateValueConf00 := (dict "valueKey" "path.to.value" "secret" "secretName" "field" "password-00") -}}
{{- $validateValueConf01 := (dict "valueKey" "path.to.value" "secret" "secretName" "field" "password-01") -}}
{{ include "common.validations.values.empty" (dict "required" (list $validateValueConf00 $validateValueConf01) "context" $) }}
Validate value params:
- valueKey - String - Required. The path to the validating value in the values.yaml, e.g: "mysql.password"
- secret - String - Optional. Name of the secret where the validating value is generated/stored, e.g: "mysql-passwords-secret"
- field - String - Optional. Name of the field in the secret data, e.g: "mysql-password"
*/}}
{{- define "common.validations.values.multiple.empty" -}}
{{- range .required -}}
{{- include "common.validations.values.single.empty" (dict "valueKey" .valueKey "secret" .secret "field" .field "context" $.context) -}}
{{- end -}}
{{- end -}}
{{/*
Validate a value must not be empty.
Usage:
{{ include "common.validations.value.empty" (dict "valueKey" "mariadb.password" "secret" "secretName" "field" "my-password" "subchart" "subchart" "context" $) }}
Validate value params:
- valueKey - String - Required. The path to the validating value in the values.yaml, e.g: "mysql.password"
- secret - String - Optional. Name of the secret where the validating value is generated/stored, e.g: "mysql-passwords-secret"
- field - String - Optional. Name of the field in the secret data, e.g: "mysql-password"
- subchart - String - Optional - Name of the subchart that the validated password is part of.
*/}}
{{- define "common.validations.values.single.empty" -}}
{{- $value := include "common.utils.getValueFromKey" (dict "key" .valueKey "context" .context) }}
{{- $subchart := ternary "" (printf "%s." .subchart) (empty .subchart) }}
{{- if not $value -}}
{{- $varname := "my-value" -}}
{{- $getCurrentValue := "" -}}
{{- if and .secret .field -}}
{{- $varname = include "common.utils.fieldToEnvVar" . -}}
{{- $getCurrentValue = printf " To get the current value:\n\n %s\n" (include "common.utils.secret.getvalue" .) -}}
{{- end -}}
{{- printf "\n '%s' must not be empty, please add '--set %s%s=$%s' to the command.%s" .valueKey $subchart .valueKey $varname $getCurrentValue -}}
{{- end -}}
{{- end -}}

View File

@@ -0,0 +1,3 @@
## bitnami/common
## It is required by CI/CD tools and processes.
exampleValue: common-chart

View File

@@ -0,0 +1,26 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
Jenkinsfile
chart_template.yaml
emqx.conf

View File

@@ -0,0 +1,24 @@
apiVersion: v2
name: emqx
description: emqx middleware, can by deployed in clusterMode or standaloneMode
dependend on PVCs in helm-emqxs
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 2.2.0

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,33 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Kubernetes standard labels
*/}}
{{- define "uavcloud-middleware.emqx.labels.standard" -}}
cmii.type: {{ .Values.global.application.type }}
{{- if .Values.enabled.clusterMode}}
cmii.app: {{ .Values.appName.clusterMode }}
cmii.emqx.architecture: cluster
{{- else }}
cmii.app: {{ .Values.appName.standaloneMode }}
cmii.emqx.architecture: standalone
{{- end }}
helm.sh/chart: {{ include "uavcloud-middleware.chart" . }}
app.kubernetes.io/managed-by: {{ $.Release.Service }}
{{- if .Values.global.image.tag }}
app.kubernetes.io/version: {{ .Values.global.image.tag | quote }}
{{- end }}
{{- end -}}
{{/*
Labels to use on deploy.spec.selector.matchLabels and svc.spec.selector
*/}}
{{- define "uavcloud-middleware.emqx.labels.matchLabels" -}}
cmii.type: {{ .Values.global.application.type }}
{{- if .Values.enabled.clusterMode}}
cmii.app: {{ .Values.appName.clusterMode }}
cmii.emqx.architecture: cluster
{{- else }}
cmii.app: {{ .Values.appName.standaloneMode }}
cmii.emqx.architecture: standalone
{{- end }}
{{- end -}}

View File

@@ -0,0 +1,24 @@
{{- define "uavcloud-middleware.emqx.cluster.config.acl" -}}
{allow, {user, "admin"}, pubsub, ["admin/#"]}.
{allow, {user, "dashboard"}, subscribe, ["$SYS/#"]}.
{allow, {ipaddr, "127.0.0.1"}, pubsub, ["$SYS/#", "#"]}.
{deny, all, subscribe, ["$SYS/#", {eq, "#"}]}.
{allow, all}.
{{- end -}}
{{- define "uavcloud-middleware.emqx.cluster.config.emqx_auth_username" -}}
auth.user.1.username = {{ .Values.auth.username }}
auth.user.1.password = {{ .Values.auth.password }}
auth.user.password_hash = sha256
{{- end -}}
{{- define "uavcloud-middleware.emqx.cluster.config.loaded_plugins" -}}
{emqx_auth_username,true}.
{emqx_management, true}.
{emqx_recon, true}.
{emqx_retainer, false}.
{emqx_dashboard, true}.
{emqx_telemetry, true}.
{emqx_rule_engine, true}.
{emqx_bridge_mqtt, false}.
{{- end -}}

View File

@@ -0,0 +1,41 @@
{{- if .Values.enabled.clusterMode }}
{{- $namespace := .Release.Namespace -}}
{{- $applicationName := .Values.appName.clusterMode -}}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ $applicationName }}-env
namespace: {{ $namespace }}
labels:
{{- include "uavcloud-middleware.emqx.labels.standard" . | nindent 4 }}
data:
EMQX_CLUSTER__K8S__ADDRESS_TYPE: hostname
EMQX_CLUSTER__K8S__APISERVER: https://kubernetes.default.svc:443
EMQX_CLUSTER__K8S__SUFFIX: svc.cluster.local
EMQX_NAME: {{ $applicationName }}
EMQX_CLUSTER__K8S__APP_NAME: {{ $applicationName }}
EMQX_CLUSTER__DISCOVERY: k8s
EMQX_CLUSTER__K8S__SERVICE_NAME: {{ $applicationName }}-headless
EMQX_CLUSTER__K8S__NAMESPACE: {{ $namespace }}
EMQX_ALLOW_ANONYMOUS: "false"
EMQX_ACL_NOMATCH: "deny"
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ $applicationName }}-cm
namespace: {{ $namespace }}
labels:
{{- include "uavcloud-middleware.emqx.labels.standard" . | nindent 4 }}
data:
emqx_auth_username.conf: |-
{{- include "uavcloud-middleware.emqx.cluster.config.emqx_auth_username" . | nindent 4 }}
acl.conf: |-
{{- include "uavcloud-middleware.emqx.cluster.config.acl" . | nindent 4 }}
loaded_plugins: |-
{{- include "uavcloud-middleware.emqx.cluster.config.loaded_plugins" . | nindent 4 }}
---
{{- end }}

View File

@@ -0,0 +1,30 @@
{{- if and .Values.enabled.clusterMode .Values.ingress.enabled }}
{{- $namespace := .Release.Namespace -}}
{{- $applicationName := .Values.appName.clusterMode -}}
{{- $DeployDomainName := ternary (first (regexSplit ":" .Values.global.domain.DeployDomainName -1)) ( .Values.global.domain.DeployDomainName ) (contains ":" .Values.global.domain.DeployDomainName) -}}
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: {{ $applicationName }}
namespace: {{ $namespace }}
labels:
{{- include "uavcloud-middleware.emqx.labels.standard" . | nindent 4 }}
spec:
rules:
- host: "emqx.{{ $DeployDomainName }}"
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
serviceName: {{ $applicationName }}
servicePort: {{ .Values.containerPort.dashboard }}
{{- if .Values.global.ingress.tls_enabled }}
tls:
- hosts:
- "emqx.{{ $DeployDomainName }}"
secretName: "x.{{ $DeployDomainName }}-tls"
{{- end }}
---
{{- end }}

View File

@@ -0,0 +1,22 @@
{{- if and .Values.enabled.clusterMode .Values.enabled.standaloneMode }}
{{/* 不要用这个使用统一生成的PVC */}}
{{- $namespace := .Release.Namespace -}}
{{- $applicationName := .Values.appName.clusterMode -}}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ $applicationName }}
namespace: {{ $namespace }}
labels:
{{- include "uavcloud-middleware.emqx.labels.standard" . | nindent 4 }}
spec:
storageClassName: {{ .Values.global.storageClass.name }}
accessModes:
- {{ .Values.storageClass.accessMode }}
volumeMode: {{ .Values.storageClass.volumeMode }}
resources:
requests:
storage: {{ .Values.storageClass.resources.requests.storage }}
---
{{- end }}

View File

@@ -0,0 +1,40 @@
{{- if .Values.enabled.clusterMode }}
{{- $namespace := .Release.Namespace -}}
{{- $applicationName := .Values.appName.clusterMode -}}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ $applicationName }}
namespace: {{ $namespace }}
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ $applicationName }}
namespace: {{ $namespace }}
rules:
- apiGroups:
- ""
resources:
- endpoints
verbs:
- get
- watch
- list
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ $applicationName }}
namespace: {{ $namespace }}
subjects:
- kind: ServiceAccount
name: {{ $applicationName }}
namespace: {{ $namespace }}
roleRef:
kind: Role
name: {{ $applicationName }}
apiGroup: rbac.authorization.k8s.io
---
{{- end }}

View File

@@ -0,0 +1,94 @@
{{- if .Values.enabled.clusterMode }}
{{- $namespace := .Release.Namespace -}}
{{- $applicationName := .Values.appName.clusterMode -}}
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ $applicationName }}
namespace: {{ $namespace }}
labels:
{{- include "uavcloud-middleware.emqx.labels.standard" . | nindent 4 }}
spec:
replicas: {{ .Values.replicas.clusterMode }}
serviceName: {{ $applicationName }}-headless
updateStrategy:
type: RollingUpdate
selector:
matchLabels:
{{- include "uavcloud-middleware.emqx.labels.matchLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "uavcloud-middleware.emqx.labels.standard" . | nindent 8 }}
spec:
{{- if .Values.global.affinity }}
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.global.affinity "context" $) | nindent 8 }}
{{- else }}
affinity:
{{- /* podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.global.podAffinityPreset "context" $) | nindent 10 -}}*/}}
{{- /* podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.global.podAntiAffinityPreset "context" $) | nindent 10 }}*/}}
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.global.nodeAffinityPreset.type "key" .Values.global.nodeAffinityPreset.key "values" .Values.global.nodeAffinityPreset.values) | nindent 10 -}}
{{- end }}
serviceAccountName: {{ $applicationName }}
containers:
- name: {{ $applicationName }}
image: "{{ .Values.global.image.repository | default .Values.image.repository }}/emqx:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.global.image.pullPolicy }}
ports:
- name: mqtt
containerPort: {{ .Values.containerPort.mqtt }}
- name: mqttssl
containerPort: {{ .Values.containerPort.mqttssl }}
- name: mgmt
containerPort: {{ .Values.containerPort.mgmt }}
- name: ws
containerPort: {{ .Values.containerPort.websocket }}
- name: wss
containerPort: {{ .Values.containerPort.wss }}
- name: dashboard
containerPort: {{ .Values.containerPort.dashboard }}
- name: ekka
containerPort: 4370
envFrom:
- configMapRef:
name: {{ $applicationName }}-env
resources:
{{- toYaml .Values.resources | nindent 12 }}
readinessProbe:
httpGet:
path: /status
port: {{ .Values.containerPort.mgmt | default 8081 }}
initialDelaySeconds: 5
periodSeconds: 5
volumeMounts:
- name: emqx-data
mountPath: "/opt/emqx/data/mnesia"
readOnly: false
- name: {{ $applicationName }}-cm
mountPath: "/opt/emqx/etc/plugins/emqx_auth_username.conf"
subPath: emqx_auth_username.conf
readOnly: false
- name: {{ $applicationName }}-cm
mountPath: "/opt/emqx/etc/acl.conf"
subPath: "acl.conf"
readOnly: false
- name: {{ $applicationName }}-cm
mountPath: "/opt/emqx/data/loaded_plugins"
subPath: loaded_plugins
readOnly: false
volumes:
- name: emqx-data
persistentVolumeClaim:
claimName: helm-emqxs
- name: {{ $applicationName }}-cm
configMap:
name: {{ $applicationName }}-cm
items:
- key: emqx_auth_username.conf
path: emqx_auth_username.conf
- key: acl.conf
path: acl.conf
- key: loaded_plugins
path: loaded_plugins
{{- end }}

View File

@@ -0,0 +1,36 @@
{{- if .Values.enabled.clusterMode }}
{{- $namespace := .Release.Namespace -}}
{{- $applicationName := .Values.appName.clusterMode -}}
---
apiVersion: v1
kind: Service
metadata:
name: {{ $applicationName }}
namespace: {{ $namespace }}
labels:
{{- include "uavcloud-middleware.emqx.labels.standard" . | nindent 4 }}
spec:
type: NodePort
selector:
{{- include "uavcloud-middleware.emqx.labels.matchLabels" . | nindent 4 }}
ports:
- port: {{ .Values.containerPort.mqtt }}
name: mqtt
targetPort: {{ .Values.containerPort.mqtt }}
{{- if .Values.nodePort.enabled }}
nodePort: {{ .Values.nodePort.mqtt }}
{{- end }}
- port: {{ .Values.containerPort.dashboard }}
name: dashboard
targetPort: {{ .Values.containerPort.dashboard }}
{{- if .Values.nodePort.enabled }}
nodePort: {{ .Values.nodePort.dashboard }}
{{- end }}
- port: {{ .Values.containerPort.websocket }}
name: mqtt-websocket
targetPort: {{ .Values.containerPort.websocket }}
{{- if .Values.nodePort.enabled }}
nodePort: {{ .Values.nodePort.mqttWebSocket }}
{{- end }}
---
{{- end }}

View File

@@ -0,0 +1,47 @@
{{- if and .Values.enabled.clusterMode}}
{{- $namespace := .Release.Namespace -}}
{{- $applicationName := .Values.appName.clusterMode -}}
---
apiVersion: v1
kind: Service
metadata:
name: {{ $applicationName }}-headless
namespace: {{ $namespace }}
labels:
{{- include "uavcloud-middleware.emqx.labels.standard" . | nindent 4 }}
spec:
type: ClusterIP
clusterIP: None
selector:
{{- include "uavcloud-middleware.emqx.labels.matchLabels" . | nindent 4 }}
ports:
- name: mqtt
port: {{ .Values.containerPort.mqtt }}
protocol: TCP
targetPort: {{ .Values.containerPort.mqtt }}
- name: mqttssl
port: {{ .Values.containerPort.mqttssl }}
protocol: TCP
targetPort: {{ .Values.containerPort.mqttssl }}
- name: mgmt
port: {{ .Values.containerPort.mgmt }}
protocol: TCP
targetPort: {{ .Values.containerPort.mgmt }}
- name: websocket
port: {{ .Values.containerPort.websocket }}
protocol: TCP
targetPort: {{ .Values.containerPort.websocket }}
- name: wss
port: {{ .Values.containerPort.wss }}
protocol: TCP
targetPort: {{ .Values.containerPort.wss }}
- name: dashboard
port: {{ .Values.containerPort.dashboard }}
protocol: TCP
targetPort: {{ .Values.containerPort.dashboard }}
- name: ekka
port: 4370
protocol: TCP
targetPort: 4370
---
{{- end }}

View File

@@ -0,0 +1,30 @@
{{- if and .Values.enabled.standaloneMode .Values.ingress.enabled }}
{{- $namespace := .Release.Namespace -}}
{{- $applicationName := .Values.appName.standaloneMode -}}
{{- $DeployDomainName := ternary (first (regexSplit ":" .Values.global.domain.DeployDomainName -1)) ( .Values.global.domain.DeployDomainName ) (contains ":" .Values.global.domain.DeployDomainName) -}}
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: {{ $applicationName }}
namespace: {{ $namespace }}
labels:
{{- include "uavcloud-middleware.emqx.labels.standard" . | nindent 4 }}
spec:
rules:
- host: "emqx.{{ $DeployDomainName }}"
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
serviceName: {{ $applicationName }}
servicePort: {{ .Values.containerPort.dashboard }}
{{- if .Values.global.ingress.tls_enabled }}
tls:
- hosts:
- "emqx.{{ $DeployDomainName }}"
secretName: "x.{{ $DeployDomainName }}-tls"
{{- end }}
---
{{- end }}

View File

@@ -0,0 +1,82 @@
{{- if and .Values.enabled.standaloneMode (not .Values.enabled.clusterMode) }}
{{- $namespace := .Release.Namespace -}}
{{- $applicationName := .Values.appName.standaloneMode -}}
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ $applicationName }}
namespace: {{ $namespace }}
labels:
{{- include "uavcloud-middleware.emqx.labels.standard" . | nindent 4 }}
spec:
serviceName: {{ $applicationName }}
replicas: {{ .Values.replicas.standaloneMode }}
selector:
matchLabels:
{{- include "uavcloud-middleware.emqx.labels.matchLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "uavcloud-middleware.emqx.labels.standard" . | nindent 8 }}
annotations:
pod.alpha.kubernetes.io/initialized: "true"
spec:
{{- if .Values.global.affinity }}
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.global.affinity "context" $) | nindent 8 }}
{{- else }}
affinity:
{{- /* podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.global.podAffinityPreset "context" $) | nindent 10 -}}*/}}
{{- /* podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.global.podAntiAffinityPreset "context" $) | nindent 10 }}*/}}
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.global.nodeAffinityPreset.type "key" .Values.global.nodeAffinityPreset.key "values" .Values.global.nodeAffinityPreset.values) | nindent 10 -}}
{{- end }}
containers:
- name: {{ $applicationName }}
image: "{{ .Values.global.image.repository | default .Values.image.repository }}/emqx:{{ .Values.image.tag }}"
securityContext:
privileged: true
resources:
{{- toYaml .Values.resources | nindent 12 }}
ports:
- containerPort: {{ .Values.containerPort.mqtt }}
name: mqtt
protocol: TCP
- containerPort: {{ .Values.containerPort.dashboard }}
name: dashboard
protocol: TCP
- containerPort: {{ .Values.containerPort.websocket }}
name: mqtt-websocket
protocol: TCP
volumeMounts:
- name: {{ $applicationName }}-plugins
mountPath: /opt/emqx/data/loaded_plugins
subPath: loaded_plugins
- name: {{ $applicationName }}-auth
mountPath: /opt/emqx/etc/plugins/emqx_auth_username.conf
subPath: emqx_auth_username.conf
- name: emqx-data
mountPath: /opt/emqx/data/emqx_erl_pipes
readOnly: false
subPath: {{ $namespace }}/{{ $applicationName }}/data
- name: emqx-data
mountPath: /opt/emqx/log
readOnly: false
subPath: {{ $namespace }}/{{ $applicationName }}/log
volumes:
- name: emqx-data
persistentVolumeClaim:
claimName: helm-emqxs
- name: {{ $applicationName }}-plugins
configMap:
name: {{ $applicationName }}-plugins
items:
- key: loaded_plugins
path: loaded_plugins
- name: {{ $applicationName }}-auth
configMap:
name: {{ $applicationName }}-auth
items:
- key: emqx_auth_username.conf
path: emqx_auth_username.conf
---
{{- end }}

View File

@@ -0,0 +1,36 @@
{{- if and .Values.enabled.standaloneMode (not .Values.enabled.clusterMode) }}
{{- $namespace := .Release.Namespace -}}
{{- $applicationName := .Values.appName.standaloneMode -}}
---
apiVersion: v1
kind: Service
metadata:
name: {{ $applicationName }}
namespace: {{ $namespace }}
labels:
{{- include "uavcloud-middleware.emqx.labels.standard" . | nindent 4 }}
spec:
type: {{ .Values.global.middlewareService.type }}
selector:
{{- include "uavcloud-middleware.emqx.labels.matchLabels" . | nindent 4 }}
ports:
- port: {{ .Values.containerPort.mqtt }}
name: mqtt
targetPort: {{ .Values.containerPort.mqtt }}
{{- if eq .Values.global.middlewareService.type "NodePort" }}
nodePort: {{ .Values.nodePort.mqtt }}
{{- end }}
- port: {{ .Values.containerPort.dashboard }}
name: dashboard
targetPort: {{ .Values.containerPort.dashboard }}
{{- if eq .Values.global.middlewareService.type "NodePort" }}
nodePort: {{ .Values.nodePort.dashboard }}
{{- end }}
- port: {{ .Values.containerPort.websocket }}
name: mqtt-websocket
targetPort: {{ .Values.containerPort.websocket }}
{{- if eq .Values.global.middlewareService.type "NodePort" }}
nodePort: {{ .Values.nodePort.mqttWebSocket }}
{{- end }}
---
{{- end }}

View File

@@ -0,0 +1,54 @@
enabled:
clusterMode: true
standaloneMode: false
auth:
username: cmii
password: odD8#Ve7.B
storageClass:
accessMode: "ReadWriteOnce"
volumeMode: Filesystem
resources:
requests:
storage: 16Gi
nodePort:
enabled: true
mqtt: 31883
dashboard: 48083
mqttWebSocket: 38083
ingress:
enabled: false
image:
repository: docker.io/emqx # commonly no use
tag: 4.2.12
replicas:
clusterMode: 3
standaloneMode: 1
appName:
clusterMode: helm-emqxs
standaloneMode: helm-emqx
# please don't modify this values below !!!
containerPort:
mqtt: 1883
mgmt: 8081
websocket: 8083
wss: 8084
mqttssl: 8883
dashboard: 18083
resources:
limits:
memory: 2Gi
cpu: "1"
requests:
memory: 1Gi
cpu: 300m

View File

@@ -0,0 +1,25 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
Jenkinsfile
chart_template.yaml

View File

@@ -0,0 +1,24 @@
# Just template
apiVersion: v2
name: mongo
description: uavcloud middleware for mongo
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 2.2.2

View File

@@ -0,0 +1,21 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Kubernetes standard labels
*/}}
{{- define "uavcloud-middleware.mongo.labels.standard" -}}
cmii.app: {{ .Values.appName }}
cmii.type: {{ .Values.global.application.type }}
helm.sh/chart: {{ include "uavcloud-middleware.chart" . }}
app.kubernetes.io/managed-by: {{ $.Release.Service }}
{{- if $.Values.global.image.tag }}
app.kubernetes.io/version: {{ $.Values.global.image.tag | quote }}
{{- end }}
{{- end -}}
{{/*
Labels to use on deploy.spec.selector.matchLabels and svc.spec.selector
*/}}
{{- define "uavcloud-middleware.mongo.labels.matchLabels" -}}
cmii.app: {{ .Values.appName }}
cmii.type: {{ .Values.global.application.type }}
{{- end -}}

View File

@@ -0,0 +1,57 @@
{{- if .Values.enabled }}
{{- $namespace := .Release.Namespace -}}
{{- $applicationName := .Values.appName -}}
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ $applicationName }}
namespace: {{ $namespace }}
labels:
{{- include "uavcloud-middleware.mongo.labels.standard" . | nindent 4 }}
spec:
serviceName: {{ $applicationName }}
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "uavcloud-middleware.mongo.labels.matchLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "uavcloud-middleware.mongo.labels.standard" . | nindent 8 }}
annotations:
pod.alpha.kubernetes.io/initialized: "true"
spec:
{{- if .Values.global.affinity }}
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.global.affinity "context" $) | nindent 8 }}
{{- else }}
affinity:
{{- /* podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.global.podAffinityPreset "context" $) | nindent 10 -}}*/}}
{{- /* podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.global.podAntiAffinityPreset "context" $) | nindent 10 }}*/}}
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.global.nodeAffinityPreset.type "key" .Values.global.nodeAffinityPreset.key "values" .Values.global.nodeAffinityPreset.values) | nindent 10 -}}
{{- end }}
containers:
- name: {{ $applicationName }}
image: "{{ .Values.global.image.repository | default .Values.image.repository }}/mongo:{{ .Values.image.tag }}"
resources:
{{- toYaml .Values.resources | nindent 12 }}
ports:
- containerPort: {{ .Values.containerPort.mongo }}
name: mongo27017
protocol: TCP
env:
- name: MONGO_INITDB_ROOT_USERNAME
value: {{ .Values.auth.username }}
- name: MONGO_INITDB_ROOT_PASSWORD
value: {{ .Values.auth.password }}
volumeMounts:
- name: mongo-data
mountPath: /data/db
readOnly: false
subPath: {{ $namespace }}/{{ $applicationName }}/data/db
volumes:
- name: mongo-data
persistentVolumeClaim:
claimName: helm-mongo
---
{{- end }}

View File

@@ -0,0 +1,24 @@
{{- if .Values.enabled }}
{{- $namespace := .Release.Namespace -}}
{{- $applicationName := .Values.appName -}}
---
apiVersion: v1
kind: Service
metadata:
name: {{ $applicationName }}
namespace: {{ $namespace }}
labels:
{{- include "uavcloud-middleware.mongo.labels.standard" . | nindent 4 }}
spec:
type: {{ .Values.global.middlewareService.type }}
selector:
{{- include "uavcloud-middleware.mongo.labels.matchLabels" . | nindent 4 }}
ports:
- port: 27017
name: server-27017
targetPort: 27017
{{- if eq .Values.global.middlewareService.type "NodePort" }}
nodePort: {{ .Values.nodePort.mongo }}
{{- end }}
---
{{- end }}

View File

@@ -0,0 +1,35 @@
image:
repository: docker.io
tag: "5.0"
replicaCount: 1
enabled: true
appName: helm-mongo
auth:
username: cmlc
password: REdPza8#oVlt
nodePort:
mongo: 37017
containerPort:
mongo: 27017
resources:
limits:
memory: 4Gi
cpu: "2"
requests:
memory: 2Gi
cpu: "1"
storageClass:
accessMode: "ReadWriteMany"
volumeMode: Filesystem
resources:
requests:
storage: 16Gi

View File

@@ -0,0 +1,23 @@
apiVersion: v2
name: nacos
description: uavcloud middleware for nacos
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.1.1
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 2.2.2

View File

@@ -0,0 +1,253 @@
/*
* Copyright 1999-2018 Alibaba Group Holding Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/******************************************/
/* 数据库全名 = cmii_nacos_config */
/* 表名称 = config_info */
/******************************************/
# CREATE SCHEMA cmii_nacos_config;
CREATE TABLE `config_info`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`data_id` varchar(255) NOT NULL COMMENT 'data_id',
`group_id` varchar(255) DEFAULT NULL,
`content` longtext NOT NULL COMMENT 'content',
`md5` varchar(32) DEFAULT NULL COMMENT 'md5',
`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
`src_user` text COMMENT 'source user',
`src_ip` varchar(50) DEFAULT NULL COMMENT 'source ip',
`app_name` varchar(128) DEFAULT NULL,
`tenant_id` varchar(128) DEFAULT '' COMMENT '租户字段',
`c_desc` varchar(256) DEFAULT NULL,
`c_use` varchar(64) DEFAULT NULL,
`effect` varchar(64) DEFAULT NULL,
`type` varchar(64) DEFAULT NULL,
`c_schema` text,
PRIMARY KEY (`id`),
UNIQUE KEY `uk_configinfo_datagrouptenant` (`data_id`, `group_id`, `tenant_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_bin COMMENT ='config_info';
/******************************************/
/* 数据库全名 = nacos_config */
/* 表名称 = config_info_aggr */
/******************************************/
CREATE TABLE `config_info_aggr`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`data_id` varchar(255) NOT NULL COMMENT 'data_id',
`group_id` varchar(255) NOT NULL COMMENT 'group_id',
`datum_id` varchar(255) NOT NULL COMMENT 'datum_id',
`content` longtext NOT NULL COMMENT '内容',
`gmt_modified` datetime NOT NULL COMMENT '修改时间',
`app_name` varchar(128) DEFAULT NULL,
`tenant_id` varchar(128) DEFAULT '' COMMENT '租户字段',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_configinfoaggr_datagrouptenantdatum` (`data_id`, `group_id`, `tenant_id`, `datum_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_bin COMMENT ='增加租户字段';
/******************************************/
/* 数据库全名 = nacos_config */
/* 表名称 = config_info_beta */
/******************************************/
CREATE TABLE `config_info_beta`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`data_id` varchar(255) NOT NULL COMMENT 'data_id',
`group_id` varchar(128) NOT NULL COMMENT 'group_id',
`app_name` varchar(128) DEFAULT NULL COMMENT 'app_name',
`content` longtext NOT NULL COMMENT 'content',
`beta_ips` varchar(1024) DEFAULT NULL COMMENT 'betaIps',
`md5` varchar(32) DEFAULT NULL COMMENT 'md5',
`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
`src_user` text COMMENT 'source user',
`src_ip` varchar(50) DEFAULT NULL COMMENT 'source ip',
`tenant_id` varchar(128) DEFAULT '' COMMENT '租户字段',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_configinfobeta_datagrouptenant` (`data_id`, `group_id`, `tenant_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_bin COMMENT ='config_info_beta';
/******************************************/
/* 数据库全名 = nacos_config */
/* 表名称 = config_info_tag */
/******************************************/
CREATE TABLE `config_info_tag`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`data_id` varchar(255) NOT NULL COMMENT 'data_id',
`group_id` varchar(128) NOT NULL COMMENT 'group_id',
`tenant_id` varchar(128) DEFAULT '' COMMENT 'tenant_id',
`tag_id` varchar(128) NOT NULL COMMENT 'tag_id',
`app_name` varchar(128) DEFAULT NULL COMMENT 'app_name',
`content` longtext NOT NULL COMMENT 'content',
`md5` varchar(32) DEFAULT NULL COMMENT 'md5',
`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
`src_user` text COMMENT 'source user',
`src_ip` varchar(50) DEFAULT NULL COMMENT 'source ip',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_configinfotag_datagrouptenanttag` (`data_id`, `group_id`, `tenant_id`, `tag_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_bin COMMENT ='config_info_tag';
/******************************************/
/* 数据库全名 = nacos_config */
/* 表名称 = config_tags_relation */
/******************************************/
CREATE TABLE `config_tags_relation`
(
`id` bigint(20) NOT NULL COMMENT 'id',
`tag_name` varchar(128) NOT NULL COMMENT 'tag_name',
`tag_type` varchar(64) DEFAULT NULL COMMENT 'tag_type',
`data_id` varchar(255) NOT NULL COMMENT 'data_id',
`group_id` varchar(128) NOT NULL COMMENT 'group_id',
`tenant_id` varchar(128) DEFAULT '' COMMENT 'tenant_id',
`nid` bigint(20) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`nid`),
UNIQUE KEY `uk_configtagrelation_configidtag` (`id`, `tag_name`, `tag_type`),
KEY `idx_tenant_id` (`tenant_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_bin COMMENT ='config_tag_relation';
/******************************************/
/* 数据库全名 = nacos_config */
/* 表名称 = group_capacity */
/******************************************/
CREATE TABLE `group_capacity`
(
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`group_id` varchar(128) NOT NULL DEFAULT '' COMMENT 'Group ID空字符表示整个集群',
`quota` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '配额0表示使用默认值',
`usage` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '使用量',
`max_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个配置大小上限单位为字节0表示使用默认值',
`max_aggr_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '聚合子配置最大个数0表示使用默认值',
`max_aggr_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个聚合数据的子配置大小上限单位为字节0表示使用默认值',
`max_history_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最大变更历史数量',
`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_group_id` (`group_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_bin COMMENT ='集群、各Group容量信息表';
/******************************************/
/* 数据库全名 = nacos_config */
/* 表名称 = his_config_info */
/******************************************/
CREATE TABLE `his_config_info`
(
`id` bigint(64) unsigned NOT NULL,
`nid` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`data_id` varchar(255) NOT NULL,
`group_id` varchar(128) NOT NULL,
`app_name` varchar(128) DEFAULT NULL COMMENT 'app_name',
`content` longtext NOT NULL,
`md5` varchar(32) DEFAULT NULL,
`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`src_user` text,
`src_ip` varchar(50) DEFAULT NULL,
`op_type` char(10) DEFAULT NULL,
`tenant_id` varchar(128) DEFAULT '' COMMENT '租户字段',
PRIMARY KEY (`nid`),
KEY `idx_gmt_create` (`gmt_create`),
KEY `idx_gmt_modified` (`gmt_modified`),
KEY `idx_did` (`data_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_bin COMMENT ='多租户改造';
/******************************************/
/* 数据库全名 = nacos_config */
/* 表名称 = tenant_capacity */
/******************************************/
CREATE TABLE `tenant_capacity`
(
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`tenant_id` varchar(128) NOT NULL DEFAULT '' COMMENT 'Tenant ID',
`quota` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '配额0表示使用默认值',
`usage` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '使用量',
`max_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个配置大小上限单位为字节0表示使用默认值',
`max_aggr_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '聚合子配置最大个数',
`max_aggr_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个聚合数据的子配置大小上限单位为字节0表示使用默认值',
`max_history_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最大变更历史数量',
`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_tenant_id` (`tenant_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_bin COMMENT ='租户容量信息表';
CREATE TABLE `tenant_info`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`kp` varchar(128) NOT NULL COMMENT 'kp',
`tenant_id` varchar(128) default '' COMMENT 'tenant_id',
`tenant_name` varchar(128) default '' COMMENT 'tenant_name',
`tenant_desc` varchar(256) DEFAULT NULL COMMENT 'tenant_desc',
`create_source` varchar(32) DEFAULT NULL COMMENT 'create_source',
`gmt_create` bigint(20) NOT NULL COMMENT '创建时间',
`gmt_modified` bigint(20) NOT NULL COMMENT '修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_tenant_info_kptenantid` (`kp`, `tenant_id`),
KEY `idx_tenant_id` (`tenant_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_bin COMMENT ='tenant_info';
CREATE TABLE `users`
(
`username` varchar(50) NOT NULL PRIMARY KEY,
`password` varchar(500) NOT NULL,
`enabled` boolean NOT NULL
);
CREATE TABLE `roles`
(
`username` varchar(50) NOT NULL,
`role` varchar(50) NOT NULL,
UNIQUE INDEX `idx_user_role` (`username` ASC, `role` ASC) USING BTREE
);
CREATE TABLE `permissions`
(
`role` varchar(50) NOT NULL,
`resource` varchar(255) NOT NULL,
`action` varchar(8) NOT NULL,
UNIQUE INDEX `uk_role_permission` (`role`, `resource`, `action`) USING BTREE
);
INSERT INTO users (username, password, enabled)
VALUES ('nacos', '$2a$10$EuWPZHzz32dJN7jexM34MOeYirDdFAZm2kuWj7VEOJhhZkDrxfvUu', TRUE);
INSERT INTO roles (username, role)
VALUES ('nacos', 'ROLE_ADMIN');

View File

@@ -0,0 +1,21 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Kubernetes standard labels
*/}}
{{- define "uavcloud-middleware.nacos.labels.standard" -}}
cmii.app: {{ .Values.appName }}
cmii.type: {{ .Values.global.application.type }}
helm.sh/chart: {{ include "uavcloud-middleware.chart" . }}
app.kubernetes.io/managed-by: {{ $.Release.Service }}
{{- if $.Values.global.image.tag }}
app.kubernetes.io/version: {{ $.Values.global.image.tag | quote }}
{{- end }}
{{- end -}}
{{/*
Labels to use on deploy.spec.selector.matchLabels and svc.spec.selector
*/}}
{{- define "uavcloud-middleware.nacos.labels.matchLabels" -}}
cmii.app: {{ .Values.appName }}
cmii.type: {{ .Values.global.application.type }}
{{- end -}}

View File

@@ -0,0 +1,19 @@
{{- if .Values.enabled }}
{{- $namespace := .Release.Namespace -}}
{{- $applicationName := .Values.appName -}}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ $applicationName }}-cm
namespace: {{ $namespace }}
labels:
{{- include "uavcloud-middleware.nacos.labels.standard" . | nindent 4 }}
data:
mysql.db.name: "{{ .Values.database.db_name }}"
mysql.db.host: "{{ .Values.database.host }}"
mysql.port: "{{ .Values.database.port }}"
mysql.user: "{{ .Values.database.username }}"
mysql.password: "{{ .Values.database.password }}"
---
{{- end }}

View File

@@ -0,0 +1,30 @@
{{- if and .Values.enabled .Values.ingress.enabled }}
{{- $namespace := .Release.Namespace -}}
{{- $applicationName := .Values.appName -}}
{{- $DeployDomainName := ternary (first (regexSplit ":" .Values.global.domain.DeployDomainName -1)) ( .Values.global.domain.DeployDomainName ) (contains ":" .Values.global.domain.DeployDomainName) -}}
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: {{ $applicationName }}
namespace: {{ $namespace }}
labels:
{{- include "uavcloud-middleware.nacos.labels.standard" . | nindent 4 }}
spec:
rules:
- host: "nacos.{{ $DeployDomainName }}"
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
serviceName: {{ $applicationName }}
servicePort: {{ .Values.containerPort.dashboard }}
{{- if .Values.global.ingress.tls_enabled }}
tls:
- hosts:
- "nacos.{{ $DeployDomainName }}"
secretName: "x.{{ $DeployDomainName }}-tls"
{{- end }}
---
{{- end }}

Some files were not shown because too many files have changed in this diff Show More