diff --git a/.run/RunAgentToShanghai.run.xml b/.run/RunAgentToShanghai.run.xml
new file mode 100644
index 0000000..57bd0cf
--- /dev/null
+++ b/.run/RunAgentToShanghai.run.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/agent/Dockerfile b/agent/Dockerfile
index 8f5e597..8677394 100644
--- a/agent/Dockerfile
+++ b/agent/Dockerfile
@@ -9,7 +9,7 @@ ENV JAVA_OPTS="-Xms2028m -Xmx2048m"
# Set time zone
RUN set -eux; \
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime; \
- echo $TZ > /etc/timezone \
+ echo $TZ > /etc/timezone
# Create Folder
RUN mkdir -p /wdd
diff --git a/agent/Dockerfile-wsl2 b/agent/Dockerfile-wsl2
new file mode 100644
index 0000000..e0afd3f
--- /dev/null
+++ b/agent/Dockerfile-wsl2
@@ -0,0 +1,24 @@
+
+# Base images that the image needs to depend on
+FROM icederce/eclipse-temurin-11-jre-focal
+
+# Set environment variables
+ENV TZ=Asia/Shanghai serverName="" serverIpPbV4="" serverIpInV4="" serverIpPbV6="" serverIpInV6="" location="" provider="" managePort="" cpuBrand="" cpuCore="" memoryTotal="" diskTotal="" diskUsage="" osInfo="" osKernelInfo="" tcpControl="" virtualization="" ioSpeed=""
+ENV JAVA_OPTS="-Xms2028m -Xmx2048m"
+
+# Set time zone
+RUN set -eux; \
+ ln -snf /usr/share/zoneinfo/$TZ /etc/localtime; \
+ echo $TZ > /etc/timezone
+
+# Create Folder
+RUN mkdir -p /wdd
+
+# Define the work dir
+WORKDIR /wdd
+
+# Copy the jar and rename it
+COPY ./target/agent-*.jar /wdd/agent.jar
+
+# When the docker container starts, run the jar
+ENTRYPOINT exec java ${JAVA_OPTS} -jar /wdd/agent.jar
diff --git a/agent/src/main/java/io/wdd/agent/AgentApplication.java b/agent/src/main/java/io/wdd/agent/AgentApplication.java
index e23443e..1834cd2 100644
--- a/agent/src/main/java/io/wdd/agent/AgentApplication.java
+++ b/agent/src/main/java/io/wdd/agent/AgentApplication.java
@@ -2,6 +2,7 @@ package io.wdd.agent;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication
public class AgentApplication {
diff --git a/agent/src/main/java/io/wdd/agent/config/beans/executor/CommandLog.java b/agent/src/main/java/io/wdd/agent/config/beans/executor/CommandLog.java
index d64aad1..48a61e2 100644
--- a/agent/src/main/java/io/wdd/agent/config/beans/executor/CommandLog.java
+++ b/agent/src/main/java/io/wdd/agent/config/beans/executor/CommandLog.java
@@ -7,6 +7,7 @@ import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.AccessType;
+import java.nio.ByteBuffer;
import java.time.LocalDateTime;
@Data
@@ -14,8 +15,8 @@ import java.time.LocalDateTime;
@NoArgsConstructor
public class CommandLog {
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
- private LocalDateTime lineTime;
+// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private String lineTime;
private String lineContend;
diff --git a/agent/src/main/java/io/wdd/agent/config/wsl2-fixed-ip.bat b/agent/src/main/java/io/wdd/agent/config/wsl2-fixed-ip.bat
new file mode 100644
index 0000000..311ab3f
--- /dev/null
+++ b/agent/src/main/java/io/wdd/agent/config/wsl2-fixed-ip.bat
@@ -0,0 +1,31 @@
+@echo off
+setlocal enabledelayedexpansion
+
+::不管三七二十一先停掉可能在跑的wsl实例
+wsl --shutdown Ubuntu-18.04
+::重新拉起来,并且用root的身份,启动ssh服务和docker服务
+wsl -u root service ssh start
+wsl -u root service docker start | findstr "Starting Docker" > nul
+if !errorlevel! equ 0 (
+ echo docker start success
+ :: 看看我要的IP在不在
+ wsl -u root ip addr | findstr "172.24.240.10" > nul
+ if !errorlevel! equ 0 (
+ echo wsl ip has set
+ ) else (
+ ::不在的话给安排上
+ wsl -u root ip addr add 172.24.240.10/24 broadcast 172.24.240.0 dev eth0 label eth0:1
+ echo set wsl ip success: 172.24.240.10
+ )
+
+
+ ::windows作为wsl的宿主,在wsl的固定IP的同一网段也给安排另外一个IP
+ ipconfig | findstr "172.24.240.1" > nul
+ if !errorlevel! equ 0 (
+ echo windows ip has set
+ ) else (
+ netsh interface ip add address "vEthernet (WSL)" 172.24.240.1 255.255.240.0
+ echo set windows ip success: 172.24.240.1
+ )
+)
+pause
\ No newline at end of file
diff --git a/agent/src/main/java/io/wdd/agent/excuetor/config/RedisConfiguration.java b/agent/src/main/java/io/wdd/agent/excuetor/config/RedisConfiguration.java
new file mode 100644
index 0000000..b73b316
--- /dev/null
+++ b/agent/src/main/java/io/wdd/agent/excuetor/config/RedisConfiguration.java
@@ -0,0 +1,28 @@
+package io.wdd.agent.excuetor.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.RedisSerializer;
+
+
+@Configuration
+public class RedisConfiguration {
+
+ @Bean
+ public RedisTemplate redisTemplate(RedisConnectionFactory redisConnectionFactory) {
+
+ RedisTemplate redisTemplate = new RedisTemplate<>();
+
+ redisTemplate.setConnectionFactory(redisConnectionFactory);
+
+ GenericJackson2JsonRedisSerializer jsonRedisSerializer = new GenericJackson2JsonRedisSerializer();
+ redisTemplate.setKeySerializer(RedisSerializer.string());
+ redisTemplate.setHashKeySerializer(RedisSerializer.string());
+ redisTemplate.setValueSerializer(jsonRedisSerializer);
+ redisTemplate.setHashValueSerializer(jsonRedisSerializer);
+ return redisTemplate;
+ }
+}
diff --git a/agent/src/main/java/io/wdd/agent/excuetor/redis/StreamSender.java b/agent/src/main/java/io/wdd/agent/excuetor/redis/StreamSender.java
new file mode 100644
index 0000000..e6d2c79
--- /dev/null
+++ b/agent/src/main/java/io/wdd/agent/excuetor/redis/StreamSender.java
@@ -0,0 +1,105 @@
+package io.wdd.agent.excuetor.redis;
+
+
+import io.wdd.agent.config.beans.executor.CommandLog;
+import lombok.SneakyThrows;
+import org.apache.commons.beanutils.BeanUtils;
+import org.apache.commons.lang3.ObjectUtils;
+import org.apache.commons.lang3.RandomStringUtils;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.redis.connection.stream.MapRecord;
+import org.springframework.data.redis.connection.stream.RecordId;
+import org.springframework.data.redis.connection.stream.StreamRecords;
+import org.springframework.data.redis.connection.stream.StringRecord;
+import org.springframework.data.redis.core.RedisTemplate;
+
+import javax.annotation.Resource;
+import java.lang.reflect.InvocationTargetException;
+import java.nio.ByteBuffer;
+import java.nio.charset.StandardCharsets;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.time.format.DateTimeFormatter;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+@Configuration
+public class StreamSender {
+
+ @Resource
+ RedisTemplate redisTemplate;
+
+
+ private static ByteBuffer currentTimeByteBuffer(){
+
+ byte[] timeBytes = LocalDateTime.now(ZoneId.of("UTC+8")).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")).getBytes(StandardCharsets.UTF_8);
+
+ return ByteBuffer.wrap(timeBytes);
+ }
+
+ private static String currentTimeString(){
+
+ return LocalDateTime.now(ZoneId.of("UTC+8")).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
+ }
+
+
+ public static String TEST_STREAM_JAVA = "test-stream-java";
+
+
+ public boolean send(String streamKey, String content){
+
+ CommandLog commandLog = new CommandLog(currentTimeString(), content);
+ Map map = null;
+ try {
+ map = BeanUtils.describe(commandLog);
+ } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {
+ throw new RuntimeException(e);
+ }
+
+ StringRecord stringRecord = StreamRecords.string(map).withStreamKey(streamKey);
+
+ RecordId recordId = redisTemplate.opsForStream().add(stringRecord);
+
+ return ObjectUtils.isNotEmpty(recordId);
+
+ }
+
+
+
+ @SneakyThrows
+ public void test(){
+
+ RecordId recordId = null;
+ if (!redisTemplate.hasKey(TEST_STREAM_JAVA)) {
+
+ recordId = redisTemplate.opsForStream().add(TEST_STREAM_JAVA, generateFakeData());
+ }
+
+ for (int i = 0; i < 100; i++) {
+
+ Map fakeData = generateFakeData();
+
+ MapRecord mapRecord = StreamRecords.mapBacked(fakeData).withStreamKey(TEST_STREAM_JAVA);
+
+
+ redisTemplate.opsForStream().add(mapRecord);
+
+ TimeUnit.MILLISECONDS.sleep(200);
+
+ }
+
+
+
+ }
+
+ @SneakyThrows
+ private static Map generateFakeData() {
+ String random = RandomStringUtils.random(16);
+ CommandLog commandLog = new CommandLog();
+
+ Map map = BeanUtils.describe(commandLog);
+
+ return map;
+ }
+
+}
diff --git a/agent/src/main/java/io/wdd/agent/excuetor/redis/StreamSenderTest.java b/agent/src/main/java/io/wdd/agent/excuetor/redis/StreamSenderTest.java
deleted file mode 100644
index b7f4d9f..0000000
--- a/agent/src/main/java/io/wdd/agent/excuetor/redis/StreamSenderTest.java
+++ /dev/null
@@ -1,62 +0,0 @@
-package io.wdd.agent.excuetor.redis;
-
-
-import io.wdd.agent.config.beans.executor.CommandLog;
-import lombok.SneakyThrows;
-import org.apache.commons.lang3.RandomStringUtils;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.data.redis.connection.stream.MapRecord;
-import org.springframework.data.redis.connection.stream.RecordId;
-import org.springframework.data.redis.connection.stream.StreamRecords;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.data.redis.hash.HashMapper;
-
-import javax.annotation.Resource;
-import java.time.LocalDateTime;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-@Configuration
-public class StreamSenderTest {
-
- @Resource
- RedisTemplate redisTemplate;
-
- public static String TEST_STREAM_JAVA = "test-stream-java";
-
- @SneakyThrows
- public void test(){
-
- HashMapper hashMapper = redisTemplate.opsForStream().getHashMapper(CommandLog.class);
-
- RecordId recordId = null;
- if (!redisTemplate.hasKey(TEST_STREAM_JAVA)) {
-
- recordId = redisTemplate.opsForStream().add(TEST_STREAM_JAVA, generateFakeData(hashMapper));
- }
-
- for (int i = 0; i < 100; i++) {
-
- Map fakeData = generateFakeData(hashMapper);
-
- MapRecord mapRecord = StreamRecords.mapBacked(fakeData).withId(recordId).withStreamKey(TEST_STREAM_JAVA);
-
-
- recordId = redisTemplate.opsForStream(hashMapper).add(mapRecord);
-
- TimeUnit.MILLISECONDS.sleep(200);
-
- }
-
-
-
- }
-
- private static Map generateFakeData(HashMapper hashMapper) {
- String random = RandomStringUtils.random(16);
- CommandLog commandLog = new CommandLog(LocalDateTime.now(), random);
- Map map = hashMapper.toHash(commandLog);
- return map;
- }
-
-}
diff --git a/agent/src/main/java/io/wdd/agent/excuetor/shell/CommandExecutor.java b/agent/src/main/java/io/wdd/agent/excuetor/shell/CommandExecutor.java
new file mode 100644
index 0000000..df3b208
--- /dev/null
+++ b/agent/src/main/java/io/wdd/agent/excuetor/shell/CommandExecutor.java
@@ -0,0 +1,66 @@
+package io.wdd.agent.excuetor.shell;
+
+import com.google.common.io.ByteStreams;
+import io.wdd.agent.excuetor.redis.StreamSender;
+import io.wdd.agent.excuetor.thread.DaemonLogThread;
+import io.wdd.agent.excuetor.thread.LogToStreamSender;
+import io.wdd.agent.excuetor.thread.LogToSysOut;
+import org.springframework.context.annotation.Configuration;
+
+import javax.annotation.Resource;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.ByteBuffer;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+
+
+@Configuration
+public class CommandExecutor {
+
+ @Resource
+ StreamSender streamSender;
+
+ public void execute(String streamKey, String... command) throws IOException, InterruptedException, ExecutionException {
+
+ ProcessBuilder processBuilder = new ProcessBuilder(command);
+
+// processBuilder.redirectErrorStream(true);
+// processBuilder.inheritIO();
+ processBuilder.directory(new File(System.getProperty("user.home")));
+ Process process = processBuilder.start();
+
+ LogToStreamSender toStreamSender = new LogToStreamSender(streamKey, process.getInputStream(), streamSender::send);
+
+// LogToSysOut(process.getInputStream(), System.out::println);
+
+ // a command shell don't understand how long it actually take
+ int processResult = process.waitFor();
+ System.out.println("processResult = " + processResult);
+
+ Future> future = DaemonLogThread.start(toStreamSender);
+
+ System.out.println("future.get() = " + future.get());
+ }
+
+
+ private ByteBuffer cvToByteBuffer(InputStream inputStream) throws IOException {
+
+ byte[] toByteArray = ByteStreams.toByteArray(inputStream);
+
+ ByteBuffer bufferByte = ByteBuffer.wrap(toByteArray);
+
+ return bufferByte;
+ }
+
+ private String cvToString(InputStream inputStream) throws IOException {
+
+ String s = String.valueOf(ByteStreams.toByteArray(inputStream));
+
+ System.out.println("s = " + s);
+
+ return s;
+
+ }
+}
diff --git a/agent/src/main/java/io/wdd/agent/excuetor/thread/DaemonLogThread.java b/agent/src/main/java/io/wdd/agent/excuetor/thread/DaemonLogThread.java
new file mode 100644
index 0000000..e4c6571
--- /dev/null
+++ b/agent/src/main/java/io/wdd/agent/excuetor/thread/DaemonLogThread.java
@@ -0,0 +1,31 @@
+package io.wdd.agent.excuetor.thread;
+
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
+
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.ThreadFactory;
+
+public class DaemonLogThread {
+
+ private static final ExecutorService executorService;
+
+ static {
+
+ ThreadFactory daemonLogThread = new ThreadFactoryBuilder()
+ .setDaemon(true)
+ .setNameFormat("DaemonLogThread")
+ .setPriority(1)
+ .build();
+
+ executorService = Executors.newSingleThreadExecutor(daemonLogThread);
+
+ }
+
+
+ public static Future> start(Runnable logToSenderTask) {
+
+ return executorService.submit(logToSenderTask);
+ }
+}
diff --git a/agent/src/main/java/io/wdd/agent/excuetor/thread/LogToStreamSender.java b/agent/src/main/java/io/wdd/agent/excuetor/thread/LogToStreamSender.java
new file mode 100644
index 0000000..8ce4001
--- /dev/null
+++ b/agent/src/main/java/io/wdd/agent/excuetor/thread/LogToStreamSender.java
@@ -0,0 +1,37 @@
+package io.wdd.agent.excuetor.thread;
+
+
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.function.BiConsumer;
+
+public class LogToStreamSender implements Runnable {
+
+ private final InputStream contentInputStream;
+ private final String streamKey;
+ private final BiConsumer biConsumer;
+
+ public LogToStreamSender(String streamKey, InputStream contentInputStream, BiConsumer biConsumer) {
+ this.contentInputStream = contentInputStream;
+ this.biConsumer = biConsumer;
+ this.streamKey = streamKey;
+ }
+
+
+ @Override
+ public void run() {
+
+ new BufferedReader(new InputStreamReader(contentInputStream)).lines()
+ .map(
+ String::valueOf
+ ).map(
+ lineStr -> {
+ biConsumer.accept(streamKey, lineStr);
+ return lineStr;
+ }
+ ).forEach(System.out::println);
+
+
+ }
+}
diff --git a/agent/src/main/java/io/wdd/agent/excuetor/thread/LogToSysOut.java b/agent/src/main/java/io/wdd/agent/excuetor/thread/LogToSysOut.java
new file mode 100644
index 0000000..ade2478
--- /dev/null
+++ b/agent/src/main/java/io/wdd/agent/excuetor/thread/LogToSysOut.java
@@ -0,0 +1,26 @@
+package io.wdd.agent.excuetor.thread;
+
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.function.Consumer;
+
+public class LogToSysOut implements Runnable {
+
+ private final InputStream inputStream;
+ private final Consumer consumer;
+
+ public LogToSysOut(InputStream inputStream, Consumer consumer) {
+ this.inputStream = inputStream;
+ this.consumer = consumer;
+ }
+
+ @Override
+ public void run() {
+ new BufferedReader(new InputStreamReader(inputStream)).lines()
+ .map(
+ String::valueOf
+ )
+ .forEach(consumer);
+ }
+}
diff --git a/agent/src/main/java/io/wdd/agent/initialization/bootup/reference/linux-init-LapPro.sh b/agent/src/main/java/io/wdd/agent/initialization/bootup/reference/linux-init-LapPro.sh
index 2667b1a..7932b0a 100644
--- a/agent/src/main/java/io/wdd/agent/initialization/bootup/reference/linux-init-LapPro.sh
+++ b/agent/src/main/java/io/wdd/agent/initialization/bootup/reference/linux-init-LapPro.sh
@@ -1146,10 +1146,10 @@ main() {
commonToolInstall
# 安装docker,版本信息在本脚本的开头处修改~~
- InstallDocker cn || return $?
- InstallDockerCompose || return $?
- modifySystemConfig_Docker
- changeDockerRegisterMirror || return $?
+# InstallDocker cn || return $?
+# InstallDockerCompose || return $?
+# modifySystemConfig_Docker
+# changeDockerRegisterMirror || return $?
# InstallRedis -p 36379 -m docker
diff --git a/agent/src/main/java/io/wdd/agent/initialization/message/InitRabbitMQConnector.java b/agent/src/main/java/io/wdd/agent/initialization/message/InitRabbitMQConnector.java
index fe40722..cdc558a 100644
--- a/agent/src/main/java/io/wdd/agent/initialization/message/InitRabbitMQConnector.java
+++ b/agent/src/main/java/io/wdd/agent/initialization/message/InitRabbitMQConnector.java
@@ -16,29 +16,22 @@ import org.springframework.context.annotation.Configuration;
@Configuration
public class InitRabbitMQConnector {
- @Value("${octopus.message.init_exchange}")
- public String INIT_EXCHANGE;
-
- @Value("${octopus.message.init_from_server}")
- public String INIT_FROM_SERVER;
-
- @Value("${octopus.message.init_to_server}")
- public String INIT_TO_SERVER;
-
- @Value("${octopus.message.init_from_server_key}")
- public String INIT_FROM_SERVER_KEY;
-
- @Value("${octopus.message.init_to_server_key}")
- public String INIT_TO_SERVER_KEY;
-
- @Value("${octopus.message.octopus_exchange}")
- public String OCTOPUS_EXCHANGE;
-
- @Value("${octopus.message.octopus_to_server}")
- public String OCTOPUS_TO_SERVER;
-
//
public static String SPECIFIC_AGENT_TOPIC_NAME;
+ @Value("${octopus.message.init_exchange}")
+ public String INIT_EXCHANGE;
+ @Value("${octopus.message.init_from_server}")
+ public String INIT_FROM_SERVER;
+ @Value("${octopus.message.init_to_server}")
+ public String INIT_TO_SERVER;
+ @Value("${octopus.message.init_from_server_key}")
+ public String INIT_FROM_SERVER_KEY;
+ @Value("${octopus.message.init_to_server_key}")
+ public String INIT_TO_SERVER_KEY;
+ @Value("${octopus.message.octopus_exchange}")
+ public String OCTOPUS_EXCHANGE;
+ @Value("${octopus.message.octopus_to_server}")
+ public String OCTOPUS_TO_SERVER;
@Bean
public DirectExchange initDirectExchange() {
diff --git a/agent/src/main/resources/application.yml b/agent/src/main/resources/application.yml
deleted file mode 100644
index f93ef74..0000000
--- a/agent/src/main/resources/application.yml
+++ /dev/null
@@ -1,51 +0,0 @@
-server:
- port: 8000
-
-
-spring:
- main:
- allow-circular-references: true
- allow-bean-definition-overriding: true
- rabbitmq:
- host: 127.0.0.1
- port: 35672
- username: boge
- password: boge14@Level5
- virtual-host: /wddserver
- listener:
- simple:
- retry:
- # ack failed will reentrant the Rabbit Listener
- max-attempts: 5
- enabled: true
- # retry interval unit ms
- max-interval: 5000
- initial-interval: 5000
- redis:
- host: 127.0.0.1
- port: 36379
- database: 0
- password: boge14@Level5
-
-octopus:
- message:
- # agent boot up default common exchange
- init_exchange: InitExchange
- # server will send message to agent using this common queue
- init_to_server: InitToServer
- # agent boot up default common exchange routing key
- init_to_server_key: InitToServerKey
- # server will receive message from agent using this common queue
- init_from_server: InitFromServer
- # agent boot up default common exchange routing key
- init_from_server_key: InitFromServerKey
- # initialization register time out (unit ms) default is 5 min
- init_ttl: "3000000"
- # Octopus Exchange Name == server comunicate with agent
- octopus_exchange: OctopusExchange
- # Octopus Message To Server == all agent send info to server queue and topic
- octopus_to_server: OctopusToServer
-
-logging:
- level:
- web: debug
\ No newline at end of file
diff --git a/agent/src/main/resources/bootstrap.yml b/agent/src/main/resources/bootstrap.yml
new file mode 100644
index 0000000..3fbac40
--- /dev/null
+++ b/agent/src/main/resources/bootstrap.yml
@@ -0,0 +1,21 @@
+spring:
+ application:
+ name: octopus-agent
+ profiles:
+ active: local
+ cloud:
+ nacos:
+ config:
+ group: local
+ config-retry-time: 3000
+ file-extension: yaml
+ max-retry: 3
+# server-addr: 43.154.83.213:21060
+# server-addr: 140.238.52.228:21060
+ server-addr: https://nacos.107421.xyz:443
+ timeout: 5000
+ config-long-poll-timeout: 5000
+ extension-configs:
+ - group: local
+ data-id: common-local.yaml
+
diff --git a/agent/src/test/java/io/wdd/agent/InitRabbitMQTest.java b/agent/src/test/java/io/wdd/agent/InitRabbitMQTest.java
index b446cae..0d41104 100644
--- a/agent/src/test/java/io/wdd/agent/InitRabbitMQTest.java
+++ b/agent/src/test/java/io/wdd/agent/InitRabbitMQTest.java
@@ -1,22 +1,37 @@
package io.wdd.agent;
-import io.wdd.agent.excuetor.redis.StreamSenderTest;
-import io.wdd.agent.initialization.bootup.OctopusAgentInitService;
+import io.wdd.agent.excuetor.shell.CommandExecutor;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import javax.annotation.Resource;
+import java.io.IOException;
+import java.util.concurrent.ExecutionException;
@SpringBootTest
public class InitRabbitMQTest {
@Resource
- StreamSenderTest streamSenderTest;
+ CommandExecutor commandExecutor;
+
@Test
- void testInitSendInfo(){
+ void testInitSendInfo() {
+ String homeDirectory = System.getProperty("user.home");
+ try {
+ String format = String.format("C:\\program files\\powershell\\7\\pwsh.exe /c dir %s | findstr \"Desktop\"", homeDirectory);
- streamSenderTest.test();
+ commandExecutor.execute("sasda",
+ "C:\\program files\\powershell\\7\\pwsh.exe",
+ "pwd");
+
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ } catch (InterruptedException e) {
+ throw new RuntimeException(e);
+ } catch (ExecutionException e) {
+ throw new RuntimeException(e);
+ }
}
}
diff --git a/pom.xml b/pom.xml
index 3b2948c..4492b9f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
org.springframework.boot
spring-boot-starter-parent
- 2.7.5
+ 2.3.12.RELEASE
@@ -29,6 +29,8 @@
11
2.1.3
2.7.4
+ Hoxton.SR12
+ 2.2.6.RELEASE
@@ -38,6 +40,33 @@
spring-boot-starter-actuator
+
+
+ org.springframework.cloud
+ spring-cloud-dependencies
+ ${spring-cloud.version}
+ pom
+ import
+
+
+
+ com.alibaba.cloud
+ spring-cloud-alibaba-dependencies
+ ${alibaba-cloud.version}
+ pom
+ import
+
+
+ org.springframework.cloud
+ spring-cloud-starter-bootstrap
+ 3.1.5
+
+
+ com.alibaba.cloud
+ spring-cloud-starter-alibaba-nacos-config
+ ${alibaba-cloud.version}
+
+
org.springframework.boot
spring-boot-starter-quartz
@@ -79,6 +108,12 @@
spring-boot-starter-data-redis
+
+ commons-beanutils
+ commons-beanutils
+ 1.9.4
+
+
org.springframework.boot
spring-boot-devtools
diff --git a/server/src/main/resources/bootstrap.yml b/server/src/main/resources/bootstrap.yml
new file mode 100644
index 0000000..ef43407
--- /dev/null
+++ b/server/src/main/resources/bootstrap.yml
@@ -0,0 +1,20 @@
+spring:
+ application:
+ name: octopus-server
+ profiles:
+ active: local
+ cloud:
+ nacos:
+ config:
+ group: local
+ config-retry-time: 3000
+ file-extension: yaml
+ max-retry: 3
+ # server-addr: 43.154.83.213:21060
+ # server-addr: 140.238.52.228:21060
+ server-addr: https://nacos.107421.xyz:443
+ timeout: 5000
+ config-long-poll-timeout: 5000
+ extension-configs:
+ - group: local
+ data-id: common-local.yaml
\ No newline at end of file
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/.github/workflows/lint-test.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/.github/workflows/lint-test.yaml
new file mode 100644
index 0000000..c82b30a
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/.github/workflows/lint-test.yaml
@@ -0,0 +1,35 @@
+name: Lint and Test Charts
+
+on: pull_request
+
+jobs:
+ lint-test:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+
+ - name: Set up Helm
+ uses: azure/setup-helm@v1
+ with:
+ version: v3.7.2
+
+ - uses: actions/setup-python@v2
+ with:
+ python-version: 3.7
+
+ - name: Set up chart-testing
+ uses: helm/chart-testing-action@v2.2.0
+
+ - name: Run chart-testing (lint)
+ run: ct lint --charts ./
+
+ - name: Create kind cluster
+ uses: helm/kind-action@v1.2.0
+
+ - name: Run chart-testing (install)
+ run: |
+ helm install test . --atomic --timeout 10m
+ helm test test|grep 'Phase:'|grep Succeeded
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/.helmignore b/source/src/main/java/io/wdd/source/nacos-2.1.2/.helmignore
new file mode 100644
index 0000000..f0c1319
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/.helmignore
@@ -0,0 +1,21 @@
+# 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
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/Chart.lock b/source/src/main/java/io/wdd/source/nacos-2.1.2/Chart.lock
new file mode 100644
index 0000000..ccac61a
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/Chart.lock
@@ -0,0 +1,9 @@
+dependencies:
+- name: common
+ repository: https://charts.bitnami.com/bitnami
+ version: 1.16.0
+- name: mysql
+ repository: https://charts.bitnami.com/bitnami
+ version: 8.9.6
+digest: sha256:c09de12ce9c0de62b0099d589caea3dad630f145d4fd39a1be445654384c251b
+generated: "2022-07-08T02:49:22.471726316Z"
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/Chart.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/Chart.yaml
new file mode 100644
index 0000000..b372712
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/Chart.yaml
@@ -0,0 +1,27 @@
+apiVersion: v2
+appVersion: 2.1.0
+dependencies:
+- name: common
+ repository: https://charts.bitnami.com/bitnami
+ tags:
+ - bitnami-common
+ version: 1.x.x
+- condition: mysql.enabled
+ name: mysql
+ repository: https://charts.bitnami.com/bitnami
+ version: 8.x.x
+description: Chart for nacos, an easy-to-use dynamic service discovery, configuration
+ and service management platform for building cloud native applications.
+home: https://nacos.io
+icon: https://nacos.io/img/nacos_colorful.png
+keywords:
+- nacos
+- dynamic service discovery
+- configuration and service management platform
+maintainers:
+- email: ygqygq2@qq.com
+ name: ygqygq2
+name: nacos
+sources:
+- https://github.com/alibaba/nacos
+version: 2.1.2
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/LICENSE b/source/src/main/java/io/wdd/source/nacos-2.1.2/LICENSE
new file mode 100644
index 0000000..f288702
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/LICENSE
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ Copyright (C)
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+.
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/README.md b/source/src/main/java/io/wdd/source/nacos-2.1.2/README.md
new file mode 100644
index 0000000..e46be6f
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/README.md
@@ -0,0 +1,250 @@
+# nacos - an easy-to-use dynamic service discovery, configuration and service management platform for building cloud native applications.
+
+
+
+[Nacos](https://nacos.io) is an easy-to-use platform designed for dynamic service discovery and configuration and service management. It helps you to build cloud native applications and microservices platform easily.
+
+## Introduction
+
+This chart bootstraps nacos statefulset on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
+
+## Prerequisites
+
+- Kubernetes 1.19+
+- Helm 3.2.0+
+
+## Installing the Chart
+
+To install the chart with the release name `my-release`:
+
+```bash
+$ helm install my-release nacos
+```
+
+The command deploys nacos cluster on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.
+
+>tip:
+>The default user is: nacos
+>The default password is: nacos
+
+## Uninstalling the Chart
+
+To uninstall/delete the `my-release` deployment:
+
+```bash
+$ helm uninstall my-release
+```
+
+The command removes all the Kubernetes components associated with the chart and deletes the release.
+
+## Parameters
+
+### Global parameters
+
+| Name | Description | Value |
+| ------------------------- | ----------------------------------------------- | ----- |
+| `global.imageRegistry` | Global Docker image registry | `""` |
+| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` |
+| `global.storageClass` | Global StorageClass for Persistent Volume(s) | `""` |
+
+
+### Common parameters
+
+| Name | Description | Value |
+| ------------------- | ------------------------------------------------------------------------------------- | --------------- |
+| `nameOverride` | String to partially override nginx.fullname template (will maintain the release name) | `""` |
+| `fullnameOverride` | String to fully override nginx.fullname template | `""` |
+| `kubeVersion` | Force target Kubernetes version (using Helm capabilities if not set) | `""` |
+| `clusterDomain` | Kubernetes Cluster Domain | `cluster.local` |
+| `extraDeploy` | Extra objects to deploy (value evaluated as a template) | `[]` |
+| `commonLabels` | Add labels to all the deployed resources | `{}` |
+| `commonAnnotations` | Add annotations to all the deployed resources | `{}` |
+
+
+### nacos parameters
+
+| Name | Description | Value |
+| -------------------- | -------------------------------------------------------------------- | --------------------- |
+| `image.registry` | nacos image registry | `docker.io` |
+| `image.repository` | nacos image repository | `nacos/nacos-server` |
+| `image.tag` | nacos image tag (immutable tags are recommended) | `v2.1.0` |
+| `image.pullPolicy` | nacos image pull policy | `IfNotPresent` |
+| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` |
+| `image.debug` | Set to true if you would like to see extra information on logs | `false` |
+| `hostAliases` | Deployment pod host aliases | `[]` |
+| `command` | Override default container command (useful when using custom images) | `[]` |
+| `args` | Override default container args (useful when using custom images) | `[]` |
+| `extraEnvVars` | Extra environment variables to be set on nacos containers | `[]` |
+| `extraEnvVarsCM` | ConfigMap with extra environment variables | `""` |
+| `extraEnvVarsSecret` | Secret with extra environment variables | `""` |
+
+
+### nacos deployment parameters
+
+| Name | Description | Value |
+| --------------------------------------- | ----------------------------------------------------------------------------------------- | ------- |
+| `replicaCount` | Number of nacos replicas to deploy | `1` |
+| `podLabels` | Additional labels for nacos pods | `{}` |
+| `podAnnotations` | Annotations for nacos pods | `{}` |
+| `podAffinityPreset` | Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
+| `podAntiAffinityPreset` | Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `soft` |
+| `nodeAffinityPreset.type` | Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
+| `nodeAffinityPreset.key` | Node label key to match Ignored if `affinity` is set. | `""` |
+| `nodeAffinityPreset.values` | Node label values to match. Ignored if `affinity` is set. | `[]` |
+| `affinity` | Affinity for pod assignment | `{}` |
+| `nodeSelector` | Node labels for pod assignment. Evaluated as a template. | `{}` |
+| `tolerations` | Tolerations for pod assignment. Evaluated as a template. | `{}` |
+| `priorityClassName` | Priority class name | `""` |
+| `podSecurityContext.enabled` | Enabled nacos pods' Security Context | `false` |
+| `podSecurityContext.fsGroup` | Set nacos pod's Security Context fsGroup | `1001` |
+| `podSecurityContext.sysctls` | sysctl settings of the nacos pods | `[]` |
+| `containerSecurityContext.enabled` | Enabled nacos containers' Security Context | `false` |
+| `containerSecurityContext.runAsUser` | Set nacos container's Security Context runAsUser | `1001` |
+| `containerSecurityContext.runAsNonRoot` | Set nacos container's Security Context runAsNonRoot | `true` |
+| `containerPorts.http` | Sets http port inside nacos container | `8080` |
+| `containerPorts.https` | Sets https port inside nacos container | `""` |
+| `resources.limits` | The resources limits for the nacos container | `{}` |
+| `resources.requests` | The requested resources for the nacos container | `{}` |
+| `customLivenessProbe` | Override default liveness probe | `{}` |
+| `customReadinessProbe` | Override default readiness probe | `{}` |
+| `healthCheck` | 简化的健康检测,支持 tcp、http,具体查看 `values.yaml` | |
+| `autoscaling.enabled` | Enable autoscaling for nacos deployment | `false` |
+| `autoscaling.minReplicas` | Minimum number of replicas to scale back | `""` |
+| `autoscaling.maxReplicas` | Maximum number of replicas to scale out | `""` |
+| `autoscaling.targetCPU` | Target CPU utilization percentage | `""` |
+| `autoscaling.targetMemory` | Target Memory utilization percentage | `""` |
+| `extraVolumes` | Array to add extra volumes | `[]` |
+| `extraVolumeMounts` | Array to add extra mount | `[]` |
+| `serviceAccount.create` | Enable creation of ServiceAccount for nginx pod | `false` |
+| `serviceAccount.name` | The name of the ServiceAccount to use. | `""` |
+| `serviceAccount.annotations` | Annotations for service account. Evaluated as a template. | `{}` |
+| `serviceAccount.autoMount` | Auto-mount the service account token in the pod | `false` |
+| `sidecars` | Sidecar parameters | `[]` |
+| `sidecarSingleProcessNamespace` | Enable sharing the process namespace with sidecars | `false` |
+| `initContainers` | Extra init containers | `[]` |
+| `pdb.create` | Created a PodDisruptionBudget | `false` |
+| `pdb.minAvailable` | Min number of pods that must still be available after the eviction | `1` |
+| `pdb.maxUnavailable` | Max number of pods that can be unavailable after the eviction | `0` |
+
+
+### Traffic Exposure parameters
+
+| Name | Description | Value |
+| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
+| `service.type` | Service type | `LoadBalancer` |
+| `service.port` | Service HTTP port | `80` |
+| `service.httpsPort` | Service HTTPS port | `443` |
+| `service.nodePorts` | Specify the nodePort(s) value(s) for the LoadBalancer and NodePort service types. | `{}` |
+| `service.targetPort` | Target port reference value for the Loadbalancer service types can be specified explicitly. | `{}` |
+| `service.loadBalancerIP` | LoadBalancer service IP address | `""` |
+| `service.annotations` | Service annotations | `{}` |
+| `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` |
+| `ingress.enabled` | Set to true to enable ingress record generation | `false` |
+| `ingress.pathType` | Ingress path type | `ImplementationSpecific` |
+| `ingress.apiVersion` | Force Ingress API version (automatically detected if not set) | `""` |
+| `ingress.hostname` | Default host for the ingress resource | `nginx.local` |
+| `ingress.path` | The Path to Nginx. You may need to set this to '/*' in order to use this with ALB ingress controllers. | `/` |
+| `ingress.annotations` | Additional annotations for the Ingress resource. To enable certificate autogeneration, place here your cert-manager annotations. | `{}` |
+| `ingress.tls` | Create TLS Secret | `false` |
+| `ingress.extraHosts` | The list of additional hostnames to be covered with this ingress record. | `[]` |
+| `ingress.extraPaths` | Any additional arbitrary paths that may need to be added to the ingress under the main host. | `[]` |
+| `ingress.extraTls` | The tls configuration for additional hostnames to be covered with this ingress record. | `[]` |
+| `ingress.secrets` | If you're providing your own certificates, please use this to add the certificates as secrets | `[]` |
+| `healthIngress.enabled` | Set to true to enable health ingress record generation | `false` |
+| `healthIngress.pathType` | Ingress path type | `ImplementationSpecific` |
+| `healthIngress.hostname` | When the health ingress is enabled, a host pointing to this will be created | `example.local` |
+| `healthIngress.annotations` | Additional annotations for the Ingress resource. To enable certificate autogeneration, place here your cert-manager annotations. | `{}` |
+| `healthIngress.tls` | Enable TLS configuration for the hostname defined at `healthIngress.hostname` parameter | `false` |
+| `healthIngress.extraHosts` | The list of additional hostnames to be covered with this health ingress record | `[]` |
+| `healthIngress.extraTls` | TLS configuration for additional hostnames to be covered | `[]` |
+| `healthIngress.secrets` | TLS Secret configuration | `[]` |
+
+
+### Metrics parameters
+
+| Name | Description | Value |
+| ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
+| `metrics.serviceMonitor.enabled` | Creates a Prometheus Operator ServiceMonitor (also requires `metrics.enabled` to be `true`) | `false` |
+| `metrics.serviceMonitor.namespace` | Namespace in which Prometheus is running | `""` |
+| `metrics.serviceMonitor.interval` | Interval at which metrics should be scraped. | `""` |
+| `metrics.serviceMonitor.scrapeTimeout` | Timeout after which the scrape is ended | `""` |
+| `metrics.serviceMonitor.selector` | Prometheus instance selector labels | `{}` |
+| `metrics.serviceMonitor.additionalLabels` | Additional labels that can be used so PodMonitor will be discovered by Prometheus | `{}` |
+| `metrics.serviceMonitor.relabelings` | RelabelConfigs to apply to samples before scraping | `[]` |
+| `metrics.serviceMonitor.metricRelabelings` | MetricRelabelConfigs to apply to samples before ingestion | `[]` |
+| `metrics.prometheusRule.enabled` | if `true`, creates a Prometheus Operator PrometheusRule (also requires `metrics.enabled` to be `true` and `metrics.prometheusRule.rules`) | `false` |
+| `metrics.prometheusRule.namespace` | Namespace for the PrometheusRule Resource (defaults to the Release Namespace) | `""` |
+| `metrics.prometheusRule.additionalLabels` | Additional labels that can be used so PrometheusRule will be discovered by Prometheus | `{}` |
+| `metrics.prometheusRule.rules` | Prometheus Rule definitions | `[]` |
+
+
+Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
+
+```bash
+$ helm install my-release \
+ --set replicaCount=3 \
+ ygqygq2/nacos
+```
+
+The above command sets the `imagePullPolicy` to `Always`.
+
+Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,
+
+```bash
+$ helm install my-release -f values.yaml ygqygq2/nacos
+```
+
+> **Tip**: You can use the default [values.yaml](values.yaml)
+
+## Configuration and installation details
+
+### [Rolling VS Immutable tags](https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/)
+
+It is strongly recommended to use immutable tags in a production environment. This ensures your deployment does not change automatically if the same tag is updated with a different image.
+
+Bitnami will release a new chart updating its containers if a new version of the main container, significant changes, or critical vulnerabilities exist.
+
+### Use a different nacos version
+
+To modify the application version used in this chart, specify a different version of the image using the `image.tag` parameter and/or a different repository using the `image.repository` parameter. Refer to the [chart documentation for more information on these parameters and how to use them with images from a private registry](https://docs.bitnami.com/kubernetes/infrastructure/nginx/configuration/change-image-version/).
+
+### Adding extra environment variables
+
+In case you want to add extra environment variables (useful for advanced operations like custom init scripts), you can use the `extraEnvVars` property.
+
+```yaml
+extraEnvVars:
+ - name: LOG_LEVEL
+ value: error
+```
+
+Alternatively, you can use a ConfigMap or a Secret with the environment variables. To do so, use the `extraEnvVarsCM` or the `extraEnvVarsSecret` values.
+
+### Setting Pod's affinity
+
+This chart allows you to set your custom affinity using the `affinity` parameter. Find more information about Pod's affinity in the [kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity).
+
+As an alternative, you can use of the preset configurations for pod affinity, pod anti-affinity, and node affinity available at the [bitnami/common](https://github.com/bitnami/charts/tree/master/bitnami/common#affinity) chart. To do so, set the `podAffinityPreset`, `podAntiAffinityPreset`, or `nodeAffinityPreset` parameters.
+
+### Deploying extra resources
+
+There are cases where you may want to deploy extra objects, such a ConfigMap containing your app's configuration or some extra deployment with a micro service used by your app. For covering this case, the chart allows adding the full specification of other objects using the `extraDeploy` parameter.
+
+### Ingress
+
+This chart provides support for ingress resources. If you have an ingress controller installed on your cluster, such as [nginx-ingress-controller](https://github.com/bitnami/charts/tree/master/bitnami/nginx-ingress-controller) or [contour](https://github.com/bitnami/charts/tree/master/bitnami/contour) you can utilize the ingress controller to serve your application.
+
+To enable ingress integration, please set `ingress.enabled` to `true`.
+
+#### Hosts
+
+Most likely you will only want to have one hostname that maps to this nacos installation. If that's your case, the property `ingress.hostname` will set it. However, it is possible to have more than one host. To facilitate this, the `ingress.extraHosts` object can be specified as an array. You can also use `ingress.extraTLS` to add the TLS configuration for extra hosts.
+
+For each host indicated at `ingress.extraHosts`, please indicate a `name`, `path`, and any `annotations` that you may want the ingress controller to know about.
+
+For annotations, please see [this document](https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md). Not all annotations are supported by all ingress controllers, but this document does a good job of indicating which annotation is supported by many popular ingress controllers.
+
+## Troubleshooting
+
+Find more information about how to deal with common errors related to Bitnami¡¯s Helm charts in [this troubleshooting guide](https://docs.bitnami.com/general/how-to/troubleshoot-helm-chart-issues).
+
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/.helmignore b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/.helmignore
new file mode 100644
index 0000000..50af031
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/.helmignore
@@ -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/
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/Chart.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/Chart.yaml
new file mode 100644
index 0000000..bd152e3
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/Chart.yaml
@@ -0,0 +1,23 @@
+annotations:
+ category: Infrastructure
+apiVersion: v2
+appVersion: 1.16.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:
+- name: Bitnami
+ url: https://github.com/bitnami/charts
+name: common
+sources:
+- https://github.com/bitnami/charts
+- https://www.bitnami.com/
+type: library
+version: 1.16.0
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/README.md b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/README.md
new file mode 100644
index 0000000..3b5e09c
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/README.md
@@ -0,0 +1,350 @@
+# 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: 1.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.19+
+- Helm 3.2.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.nodes.soft` | Return a soft nodeAffinity definition | `dict "key" "FOO" "values" (list "BAR" "BAZ")` |
+| `common.affinities.nodes.hard` | Return a hard nodeAffinity definition | `dict "key" "FOO" "values" (list "BAR" "BAZ")` |
+| `common.affinities.pods.soft` | Return a soft podAffinity/podAntiAffinity definition | `dict "component" "FOO" "context" $` |
+| `common.affinities.pods.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.cronjob.apiVersion` | Return the appropriate apiVersion for cronjob. | `.` 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 podsecuritypolicy. | `.` Chart context |
+| `common.capabilities.networkPolicy.apiVersion` | Return the appropriate apiVersion for networkpolicy. | `.` Chart context |
+| `common.capabilities.apiService.apiVersion` | Return the appropriate apiVersion for APIService. | `.` Chart context |
+| `common.capabilities.hpa.apiVersion` | Return the appropriate apiVersion for Horizontal Pod Autoscaler | `.` 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 |
+| `common.ingress.certManagerRequest` | Prints "true" if required cert-manager annotations for TLS signed certificates are set in the Ingress annotations | `dict "annotations" .Values.path.to.the.ingress.annotations` |
+
+### Labels
+
+| Helper identifier | Description | Expected Input |
+|-----------------------------|-----------------------------------------------------------------------------|-------------------|
+| `common.labels.standard` | Return Kubernetes standard labels | `.` Chart context |
+| `common.labels.matchLabels` | Labels to use on `deploy.spec.selector.matchLabels` and `svc.spec.selector` | `.` Chart context |
+
+### Names
+
+| Helper identifier | Description | Expected Input |
+|-----------------------------------|-----------------------------------------------------------------------|-------------------|
+| `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.namespace` | Allow the release namespace to be overridden | `.` Chart context |
+| `common.names.fullname.namespace` | Create a fully qualified app name adding the installation's namespace | `.` 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.storage.class` | Return the proper Storage Class | `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.mysql.passwords` | This helper will ensure required password for MySQL are not empty. It returns a shared error for all the values. | `dict "secret" "mysql-secret" "subchart" "true" "context" $` subchart field is optional and could be true or false it depends on where you will use mysql 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® 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® 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 -d)
+
+ '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 -d)
+```
+
+## 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/
+
+## License
+
+Copyright © 2022 Bitnami
+
+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.
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_affinities.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_affinities.tpl
new file mode 100644
index 0000000..189ea40
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_affinities.tpl
@@ -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 -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_capabilities.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_capabilities.tpl
new file mode 100644
index 0000000..9d9b760
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_capabilities.tpl
@@ -0,0 +1,154 @@
+{{/* 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 poddisruptionbudget.
+*/}}
+{{- 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 networkpolicy.
+*/}}
+{{- define "common.capabilities.networkPolicy.apiVersion" -}}
+{{- if semverCompare "<1.7-0" (include "common.capabilities.kubeVersion" .) -}}
+{{- print "extensions/v1beta1" -}}
+{{- else -}}
+{{- print "networking.k8s.io/v1" -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Return the appropriate apiVersion for cronjob.
+*/}}
+{{- define "common.capabilities.cronjob.apiVersion" -}}
+{{- if semverCompare "<1.21-0" (include "common.capabilities.kubeVersion" .) -}}
+{{- print "batch/v1beta1" -}}
+{{- else -}}
+{{- print "batch/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 -}}
+
+{{/*
+Return the appropriate apiVersion for APIService.
+*/}}
+{{- define "common.capabilities.apiService.apiVersion" -}}
+{{- if semverCompare "<1.10-0" (include "common.capabilities.kubeVersion" .) -}}
+{{- print "apiregistration.k8s.io/v1beta1" -}}
+{{- else -}}
+{{- print "apiregistration.k8s.io/v1" -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Return the appropriate apiVersion for Horizontal Pod Autoscaler.
+*/}}
+{{- define "common.capabilities.hpa.apiVersion" -}}
+{{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .context) -}}
+{{- if .beta2 -}}
+{{- print "autoscaling/v2beta2" -}}
+{{- else -}}
+{{- print "autoscaling/v2beta1" -}}
+{{- end -}}
+{{- else -}}
+{{- print "autoscaling/v2" -}}
+{{- 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 -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_errors.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_errors.tpl
new file mode 100644
index 0000000..a79cc2e
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_errors.tpl
@@ -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 -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_images.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_images.tpl
new file mode 100644
index 0000000..42ffbc7
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_images.tpl
@@ -0,0 +1,75 @@
+{{/* 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 -}}
+
+{{/*
+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 -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_ingress.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_ingress.tpl
new file mode 100644
index 0000000..8caf73a
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_ingress.tpl
@@ -0,0 +1,68 @@
+{{/* 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 -}}
+
+{{/*
+Return true if cert-manager required annotations for TLS signed
+certificates are set in the Ingress annotations
+Ref: https://cert-manager.io/docs/usage/ingress/#supported-annotations
+Usage:
+{{ include "common.ingress.certManagerRequest" ( dict "annotations" .Values.path.to.the.ingress.annotations ) }}
+*/}}
+{{- define "common.ingress.certManagerRequest" -}}
+{{ if or (hasKey .annotations "cert-manager.io/cluster-issuer") (hasKey .annotations "cert-manager.io/issuer") }}
+ {{- true -}}
+{{- end -}}
+{{- end -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_labels.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_labels.tpl
new file mode 100644
index 0000000..252066c
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_labels.tpl
@@ -0,0 +1,18 @@
+{{/* vim: set filetype=mustache: */}}
+{{/*
+Kubernetes standard labels
+*/}}
+{{- define "common.labels.standard" -}}
+app.kubernetes.io/name: {{ include "common.names.name" . }}
+helm.sh/chart: {{ include "common.names.chart" . }}
+app.kubernetes.io/instance: {{ .Release.Name }}
+app.kubernetes.io/managed-by: {{ .Release.Service }}
+{{- 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/instance: {{ .Release.Name }}
+{{- end -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_names.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_names.tpl
new file mode 100644
index 0000000..1bdac8b
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_names.tpl
@@ -0,0 +1,70 @@
+{{/* 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 -}}
+
+{{/*
+Create a default fully qualified dependency 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.
+Usage:
+{{ include "common.names.dependency.fullname" (dict "chartName" "dependency-chart-name" "chartValues" .Values.dependency-chart "context" $) }}
+*/}}
+{{- define "common.names.dependency.fullname" -}}
+{{- if .chartValues.fullnameOverride -}}
+{{- .chartValues.fullnameOverride | trunc 63 | trimSuffix "-" -}}
+{{- else -}}
+{{- $name := default .chartName .chartValues.nameOverride -}}
+{{- if contains $name .context.Release.Name -}}
+{{- .context.Release.Name | trunc 63 | trimSuffix "-" -}}
+{{- else -}}
+{{- printf "%s-%s" .context.Release.Name $name | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Allow the release namespace to be overridden for multi-namespace deployments in combined charts.
+*/}}
+{{- define "common.names.namespace" -}}
+{{- if .Values.namespaceOverride -}}
+{{- .Values.namespaceOverride -}}
+{{- else -}}
+{{- .Release.Namespace -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Create a fully qualified app name adding the installation's namespace.
+*/}}
+{{- define "common.names.fullname.namespace" -}}
+{{- printf "%s-%s" (include "common.names.fullname" .) (include "common.names.namespace" .) | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_secrets.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_secrets.tpl
new file mode 100644
index 0000000..a53fb44
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_secrets.tpl
@@ -0,0 +1,140 @@
+{{/* 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 - 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.
+
+The order in which this function returns a secret password:
+ 1. Already existing 'Secret' resource
+ (If a 'Secret' resource is found under the name provided to the 'secret' parameter to this function and that 'Secret' resource contains a key with the name passed as the 'key' parameter to this function then the value of this existing secret password will be returned)
+ 2. Password provided via the values.yaml
+ (If one of the keys passed to the 'providedValues' parameter to this function is a valid path to a key in the values.yaml and has a value, the value of the first key with a value will be returned)
+ 3. Randomly generated secret password
+ (A new random secret password with the length specified in the 'length' parameter will be generated and returned)
+
+*/}}
+{{- 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) }}
+{{- $secretData := (lookup "v1" "Secret" $.context.Release.Namespace .secret).data }}
+{{- if $secretData }}
+ {{- if hasKey $secretData .key }}
+ {{- $password = index $secretData .key }}
+ {{- else }}
+ {{- printf "\nPASSWORDS ERROR: The secret \"%s\" does not contain the key \"%s\"\n" .secret .key | fail -}}
+ {{- 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 -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_storage.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_storage.tpl
new file mode 100644
index 0000000..60e2a84
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_storage.tpl
@@ -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 -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_tplvalues.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_tplvalues.tpl
new file mode 100644
index 0000000..2db1668
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_tplvalues.tpl
@@ -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 -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_utils.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_utils.tpl
new file mode 100644
index 0000000..8c22b2a
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_utils.tpl
@@ -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 -d)
+{{- 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 -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_warnings.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_warnings.tpl
new file mode 100644
index 0000000..ae10fa4
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/_warnings.tpl
@@ -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 -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/validations/_cassandra.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/validations/_cassandra.tpl
new file mode 100644
index 0000000..ded1ae3
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/validations/_cassandra.tpl
@@ -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 (or (not $existingSecret) (eq $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 -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/validations/_mariadb.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/validations/_mariadb.tpl
new file mode 100644
index 0000000..b6906ff
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/validations/_mariadb.tpl
@@ -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 (or (not $existingSecret) (eq $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 -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/validations/_mongodb.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/validations/_mongodb.tpl
new file mode 100644
index 0000000..f820ec1
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/validations/_mongodb.tpl
@@ -0,0 +1,108 @@
+{{/* vim: set filetype=mustache: */}}
+{{/*
+Validate MongoDB® 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® values are stored, e.g: "mongodb-passwords-secret"
+ - subchart - Boolean - Optional. Whether MongoDB® 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 (or (not $existingSecret) (eq $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® 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 MongoDB® 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 -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/validations/_mysql.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/validations/_mysql.tpl
new file mode 100644
index 0000000..74472a0
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/validations/_mysql.tpl
@@ -0,0 +1,103 @@
+{{/* vim: set filetype=mustache: */}}
+{{/*
+Validate MySQL required passwords are not empty.
+
+Usage:
+{{ include "common.validations.values.mysql.passwords" (dict "secret" "secretName" "subchart" false "context" $) }}
+Params:
+ - secret - String - Required. Name of the secret where MySQL values are stored, e.g: "mysql-passwords-secret"
+ - subchart - Boolean - Optional. Whether MySQL is used as subchart or not. Default: false
+*/}}
+{{- define "common.validations.values.mysql.passwords" -}}
+ {{- $existingSecret := include "common.mysql.values.auth.existingSecret" . -}}
+ {{- $enabled := include "common.mysql.values.enabled" . -}}
+ {{- $architecture := include "common.mysql.values.architecture" . -}}
+ {{- $authPrefix := include "common.mysql.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 (or (not $existingSecret) (eq $existingSecret "\"\"")) (eq $enabled "true") -}}
+ {{- $requiredPasswords := list -}}
+
+ {{- $requiredRootPassword := dict "valueKey" $valueKeyRootPassword "secret" .secret "field" "mysql-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" "mysql-password" -}}
+ {{- $requiredPasswords = append $requiredPasswords $requiredPassword -}}
+ {{- end -}}
+
+ {{- if (eq $architecture "replication") -}}
+ {{- $requiredReplicationPassword := dict "valueKey" $valueKeyReplicationPassword "secret" .secret "field" "mysql-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.mysql.values.auth.existingSecret" (dict "context" $) }}
+Params:
+ - subchart - Boolean - Optional. Whether MySQL is used as subchart or not. Default: false
+*/}}
+{{- define "common.mysql.values.auth.existingSecret" -}}
+ {{- if .subchart -}}
+ {{- .context.Values.mysql.auth.existingSecret | quote -}}
+ {{- else -}}
+ {{- .context.Values.auth.existingSecret | quote -}}
+ {{- end -}}
+{{- end -}}
+
+{{/*
+Auxiliary function to get the right value for enabled mysql.
+
+Usage:
+{{ include "common.mysql.values.enabled" (dict "context" $) }}
+*/}}
+{{- define "common.mysql.values.enabled" -}}
+ {{- if .subchart -}}
+ {{- printf "%v" .context.Values.mysql.enabled -}}
+ {{- else -}}
+ {{- printf "%v" (not .context.Values.enabled) -}}
+ {{- end -}}
+{{- end -}}
+
+{{/*
+Auxiliary function to get the right value for architecture
+
+Usage:
+{{ include "common.mysql.values.architecture" (dict "subchart" "true" "context" $) }}
+Params:
+ - subchart - Boolean - Optional. Whether MySQL is used as subchart or not. Default: false
+*/}}
+{{- define "common.mysql.values.architecture" -}}
+ {{- if .subchart -}}
+ {{- .context.Values.mysql.architecture -}}
+ {{- else -}}
+ {{- .context.Values.architecture -}}
+ {{- end -}}
+{{- end -}}
+
+{{/*
+Auxiliary function to get the right value for the key auth
+
+Usage:
+{{ include "common.mysql.values.key.auth" (dict "subchart" "true" "context" $) }}
+Params:
+ - subchart - Boolean - Optional. Whether MySQL is used as subchart or not. Default: false
+*/}}
+{{- define "common.mysql.values.key.auth" -}}
+ {{- if .subchart -}}
+ mysql.auth
+ {{- else -}}
+ auth
+ {{- end -}}
+{{- end -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/validations/_postgresql.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/validations/_postgresql.tpl
new file mode 100644
index 0000000..164ec0d
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/validations/_postgresql.tpl
@@ -0,0 +1,129 @@
+{{/* 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 (or (not $existingSecret) (eq $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 -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/validations/_redis.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/validations/_redis.tpl
new file mode 100644
index 0000000..dcccfc1
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/validations/_redis.tpl
@@ -0,0 +1,76 @@
+
+{{/* vim: set filetype=mustache: */}}
+{{/*
+Validate Redis® 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 (or (not $existingSecret) (eq $existingSecret "\"\"")) (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 -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/validations/_validations.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/validations/_validations.tpl
new file mode 100644
index 0000000..9a814cf
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/templates/validations/_validations.tpl
@@ -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 -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/values.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/values.yaml
new file mode 100644
index 0000000..f2df68e
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/common/values.yaml
@@ -0,0 +1,5 @@
+## bitnami/common
+## It is required by CI/CD tools and processes.
+## @skip exampleValue
+##
+exampleValue: common-chart
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/.helmignore b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/.helmignore
new file mode 100644
index 0000000..f0c1319
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/.helmignore
@@ -0,0 +1,21 @@
+# 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
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/Chart.lock b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/Chart.lock
new file mode 100644
index 0000000..eb4df7f
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/Chart.lock
@@ -0,0 +1,6 @@
+dependencies:
+- name: common
+ repository: https://charts.bitnami.com/bitnami
+ version: 1.13.1
+digest: sha256:1056dac8da880ed967a191e8d9eaf04766f77bda66a5715456d5dd4494a4a942
+generated: "2022-04-26T23:27:43.795807925Z"
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/Chart.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/Chart.yaml
new file mode 100644
index 0000000..f42519b
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/Chart.yaml
@@ -0,0 +1,28 @@
+annotations:
+ category: Database
+apiVersion: v2
+appVersion: 8.0.29
+dependencies:
+- name: common
+ repository: https://charts.bitnami.com/bitnami
+ tags:
+ - bitnami-common
+ version: 1.x.x
+description: MySQL is a fast, reliable, scalable, and easy to use open source relational
+ database system. Designed to handle mission-critical, heavy-load production applications.
+home: https://github.com/bitnami/charts/tree/master/bitnami/mysql
+icon: https://bitnami.com/assets/stacks/mysql/img/mysql-stack-220x234.png
+keywords:
+- mysql
+- database
+- sql
+- cluster
+- high availability
+maintainers:
+- email: containers@bitnami.com
+ name: Bitnami
+name: mysql
+sources:
+- https://github.com/bitnami/bitnami-docker-mysql
+- https://mysql.com
+version: 8.9.6
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/README.md b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/README.md
new file mode 100644
index 0000000..e961827
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/README.md
@@ -0,0 +1,491 @@
+
+
+# MySQL packaged by Bitnami
+
+MySQL is a fast, reliable, scalable, and easy to use open source relational database system. Designed to handle mission-critical, heavy-load production applications.
+
+[Overview of MySQL](http://www.mysql.com)
+
+Trademarks: This software listing is packaged by Bitnami. The respective trademarks mentioned in the offering are owned by the respective companies, and use of them does not imply any affiliation or endorsement.
+
+## TL;DR
+
+```bash
+$ helm repo add bitnami https://charts.bitnami.com/bitnami
+$ helm install my-release bitnami/mysql
+```
+
+## Introduction
+
+This chart bootstraps a [MySQL](https://github.com/bitnami/bitnami-docker-mysql) replication cluster deployment on a [Kubernetes](https://kubernetes.io) cluster using the [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.19+
+- Helm 3.2.0+
+- PV provisioner support in the underlying infrastructure
+
+## Installing the Chart
+
+To install the chart with the release name `my-release`:
+
+```bash
+$ helm repo add bitnami https://charts.bitnami.com/bitnami
+$ helm install my-release bitnami/mysql
+```
+
+These commands deploy MySQL on the Kubernetes cluster in the default configuration. The [Parameters](#parameters) section lists the parameters that can be configured during installation.
+
+> **Tip**: List all releases using `helm list`
+
+## Uninstalling the Chart
+
+To uninstall/delete the `my-release` deployment:
+
+```bash
+$ helm delete my-release
+```
+
+The command removes all the Kubernetes components associated with the chart and deletes the release.
+
+## Parameters
+
+### Global parameters
+
+| Name | Description | Value |
+| ------------------------- | ----------------------------------------------- | ----- |
+| `global.imageRegistry` | Global Docker image registry | `""` |
+| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` |
+| `global.storageClass` | Global StorageClass for Persistent Volume(s) | `""` |
+
+
+### Common parameters
+
+| Name | Description | Value |
+| ------------------------ | --------------------------------------------------------------------------------------------------------- | --------------- |
+| `nameOverride` | String to partially override common.names.fullname template (will maintain the release name) | `""` |
+| `fullnameOverride` | String to fully override common.names.fullname template | `""` |
+| `clusterDomain` | Cluster domain | `cluster.local` |
+| `commonAnnotations` | Common annotations to add to all MySQL resources (sub-charts are not considered). Evaluated as a template | `{}` |
+| `commonLabels` | Common labels to add to all MySQL resources (sub-charts are not considered). Evaluated as a template | `{}` |
+| `extraDeploy` | Array with extra yaml to deploy with the chart. Evaluated as a template | `[]` |
+| `schedulerName` | Use an alternate scheduler, e.g. "stork". | `""` |
+| `diagnosticMode.enabled` | Enable diagnostic mode (all probes will be disabled and the command will be overridden) | `false` |
+| `diagnosticMode.command` | Command to override all containers in the deployment | `["sleep"]` |
+| `diagnosticMode.args` | Args to override all containers in the deployment | `["infinity"]` |
+
+
+### MySQL common parameters
+
+| Name | Description | Value |
+| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- |
+| `image.registry` | MySQL image registry | `docker.io` |
+| `image.repository` | MySQL image repository | `bitnami/mysql` |
+| `image.tag` | MySQL image tag (immutable tags are recommended) | `8.0.29-debian-10-r0` |
+| `image.pullPolicy` | MySQL image pull policy | `IfNotPresent` |
+| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` |
+| `image.debug` | Specify if debug logs should be enabled | `false` |
+| `architecture` | MySQL architecture (`standalone` or `replication`) | `standalone` |
+| `auth.rootPassword` | Password for the `root` user. Ignored if existing secret is provided | `""` |
+| `auth.database` | Name for a custom database to create | `my_database` |
+| `auth.username` | Name for a custom user to create | `""` |
+| `auth.password` | Password for the new user. Ignored if existing secret is provided | `""` |
+| `auth.replicationUser` | MySQL replication user | `replicator` |
+| `auth.replicationPassword` | MySQL replication user password. Ignored if existing secret is provided | `""` |
+| `auth.existingSecret` | Use existing secret for password details. The secret has to contain the keys `mysql-root-password`, `mysql-replication-password` and `mysql-password` | `""` |
+| `auth.forcePassword` | Force users to specify required passwords | `false` |
+| `auth.usePasswordFiles` | Mount credentials as files instead of using an environment variable | `false` |
+| `auth.customPasswordFiles` | Use custom password files when `auth.usePasswordFiles` is set to `true`. Define path for keys `root` and `user`, also define `replicator` if `architecture` is set to `replication` | `{}` |
+| `initdbScripts` | Dictionary of initdb scripts | `{}` |
+| `initdbScriptsConfigMap` | ConfigMap with the initdb scripts (Note: Overrides `initdbScripts`) | `""` |
+
+
+### MySQL Primary parameters
+
+| Name | Description | Value |
+| -------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | ------------------- |
+| `primary.command` | Override default container command on MySQL Primary container(s) (useful when using custom images) | `[]` |
+| `primary.args` | Override default container args on MySQL Primary container(s) (useful when using custom images) | `[]` |
+| `primary.hostAliases` | Deployment pod host aliases | `[]` |
+| `primary.configuration` | Configure MySQL Primary with a custom my.cnf file | `""` |
+| `primary.existingConfigmap` | Name of existing ConfigMap with MySQL Primary configuration. | `""` |
+| `primary.updateStrategy` | Update strategy type for the MySQL primary statefulset | `RollingUpdate` |
+| `primary.rollingUpdatePartition` | Partition update strategy for MySQL Primary statefulset | `""` |
+| `primary.podAnnotations` | Additional pod annotations for MySQL primary pods | `{}` |
+| `primary.podAffinityPreset` | MySQL primary pod affinity preset. Ignored if `primary.affinity` is set. Allowed values: `soft` or `hard` | `""` |
+| `primary.podAntiAffinityPreset` | MySQL primary pod anti-affinity preset. Ignored if `primary.affinity` is set. Allowed values: `soft` or `hard` | `soft` |
+| `primary.nodeAffinityPreset.type` | MySQL primary node affinity preset type. Ignored if `primary.affinity` is set. Allowed values: `soft` or `hard` | `""` |
+| `primary.nodeAffinityPreset.key` | MySQL primary node label key to match Ignored if `primary.affinity` is set. | `""` |
+| `primary.nodeAffinityPreset.values` | MySQL primary node label values to match. Ignored if `primary.affinity` is set. | `[]` |
+| `primary.affinity` | Affinity for MySQL primary pods assignment | `{}` |
+| `primary.nodeSelector` | Node labels for MySQL primary pods assignment | `{}` |
+| `primary.tolerations` | Tolerations for MySQL primary pods assignment | `[]` |
+| `primary.podSecurityContext.enabled` | Enable security context for MySQL primary pods | `true` |
+| `primary.podSecurityContext.fsGroup` | Group ID for the mounted volumes' filesystem | `1001` |
+| `primary.containerSecurityContext.enabled` | MySQL primary container securityContext | `true` |
+| `primary.containerSecurityContext.runAsUser` | User ID for the MySQL primary container | `1001` |
+| `primary.resources.limits` | The resources limits for MySQL primary containers | `{}` |
+| `primary.resources.requests` | The requested resources for MySQL primary containers | `{}` |
+| `primary.livenessProbe.enabled` | Enable livenessProbe | `true` |
+| `primary.livenessProbe.initialDelaySeconds` | Initial delay seconds for livenessProbe | `5` |
+| `primary.livenessProbe.periodSeconds` | Period seconds for livenessProbe | `10` |
+| `primary.livenessProbe.timeoutSeconds` | Timeout seconds for livenessProbe | `1` |
+| `primary.livenessProbe.failureThreshold` | Failure threshold for livenessProbe | `3` |
+| `primary.livenessProbe.successThreshold` | Success threshold for livenessProbe | `1` |
+| `primary.readinessProbe.enabled` | Enable readinessProbe | `true` |
+| `primary.readinessProbe.initialDelaySeconds` | Initial delay seconds for readinessProbe | `5` |
+| `primary.readinessProbe.periodSeconds` | Period seconds for readinessProbe | `10` |
+| `primary.readinessProbe.timeoutSeconds` | Timeout seconds for readinessProbe | `1` |
+| `primary.readinessProbe.failureThreshold` | Failure threshold for readinessProbe | `3` |
+| `primary.readinessProbe.successThreshold` | Success threshold for readinessProbe | `1` |
+| `primary.startupProbe.enabled` | Enable startupProbe | `true` |
+| `primary.startupProbe.initialDelaySeconds` | Initial delay seconds for startupProbe | `15` |
+| `primary.startupProbe.periodSeconds` | Period seconds for startupProbe | `10` |
+| `primary.startupProbe.timeoutSeconds` | Timeout seconds for startupProbe | `1` |
+| `primary.startupProbe.failureThreshold` | Failure threshold for startupProbe | `10` |
+| `primary.startupProbe.successThreshold` | Success threshold for startupProbe | `1` |
+| `primary.customLivenessProbe` | Override default liveness probe for MySQL primary containers | `{}` |
+| `primary.customReadinessProbe` | Override default readiness probe for MySQL primary containers | `{}` |
+| `primary.customStartupProbe` | Override default startup probe for MySQL primary containers | `{}` |
+| `primary.extraFlags` | MySQL primary additional command line flags | `""` |
+| `primary.extraEnvVars` | Extra environment variables to be set on MySQL primary containers | `[]` |
+| `primary.extraEnvVarsCM` | Name of existing ConfigMap containing extra env vars for MySQL primary containers | `""` |
+| `primary.extraEnvVarsSecret` | Name of existing Secret containing extra env vars for MySQL primary containers | `""` |
+| `primary.persistence.enabled` | Enable persistence on MySQL primary replicas using a `PersistentVolumeClaim`. If false, use emptyDir | `true` |
+| `primary.persistence.existingClaim` | Name of an existing `PersistentVolumeClaim` for MySQL primary replicas | `""` |
+| `primary.persistence.storageClass` | MySQL primary persistent volume storage Class | `""` |
+| `primary.persistence.annotations` | MySQL primary persistent volume claim annotations | `{}` |
+| `primary.persistence.accessModes` | MySQL primary persistent volume access Modes | `["ReadWriteOnce"]` |
+| `primary.persistence.size` | MySQL primary persistent volume size | `8Gi` |
+| `primary.persistence.selector` | Selector to match an existing Persistent Volume | `{}` |
+| `primary.extraVolumes` | Optionally specify extra list of additional volumes to the MySQL Primary pod(s) | `[]` |
+| `primary.extraVolumeMounts` | Optionally specify extra list of additional volumeMounts for the MySQL Primary container(s) | `[]` |
+| `primary.initContainers` | Add additional init containers for the MySQL Primary pod(s) | `[]` |
+| `primary.sidecars` | Add additional sidecar containers for the MySQL Primary pod(s) | `[]` |
+| `primary.service.type` | MySQL Primary K8s service type | `ClusterIP` |
+| `primary.service.port` | MySQL Primary K8s service port | `3306` |
+| `primary.service.nodePort` | MySQL Primary K8s service node port | `""` |
+| `primary.service.clusterIP` | MySQL Primary K8s service clusterIP IP | `""` |
+| `primary.service.loadBalancerIP` | MySQL Primary loadBalancerIP if service type is `LoadBalancer` | `""` |
+| `primary.service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` |
+| `primary.service.loadBalancerSourceRanges` | Addresses that are allowed when MySQL Primary service is LoadBalancer | `[]` |
+| `primary.service.annotations` | Provide any additional annotations which may be required | `{}` |
+| `primary.pdb.enabled` | Enable/disable a Pod Disruption Budget creation for MySQL primary pods | `false` |
+| `primary.pdb.minAvailable` | Minimum number/percentage of MySQL primary pods that should remain scheduled | `1` |
+| `primary.pdb.maxUnavailable` | Maximum number/percentage of MySQL primary pods that may be made unavailable | `""` |
+| `primary.podLabels` | MySQL Primary pod label. If labels are same as commonLabels , this will take precedence | `{}` |
+
+
+### MySQL Secondary parameters
+
+| Name | Description | Value |
+| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------- |
+| `secondary.replicaCount` | Number of MySQL secondary replicas | `1` |
+| `secondary.hostAliases` | Deployment pod host aliases | `[]` |
+| `secondary.command` | Override default container command on MySQL Secondary container(s) (useful when using custom images) | `[]` |
+| `secondary.args` | Override default container args on MySQL Secondary container(s) (useful when using custom images) | `[]` |
+| `secondary.configuration` | Configure MySQL Secondary with a custom my.cnf file | `""` |
+| `secondary.existingConfigmap` | Name of existing ConfigMap with MySQL Secondary configuration. | `""` |
+| `secondary.updateStrategy` | Update strategy type for the MySQL secondary statefulset | `RollingUpdate` |
+| `secondary.rollingUpdatePartition` | Partition update strategy for MySQL Secondary statefulset | `""` |
+| `secondary.podAnnotations` | Additional pod annotations for MySQL secondary pods | `{}` |
+| `secondary.podAffinityPreset` | MySQL secondary pod affinity preset. Ignored if `secondary.affinity` is set. Allowed values: `soft` or `hard` | `""` |
+| `secondary.podAntiAffinityPreset` | MySQL secondary pod anti-affinity preset. Ignored if `secondary.affinity` is set. Allowed values: `soft` or `hard` | `soft` |
+| `secondary.nodeAffinityPreset.type` | MySQL secondary node affinity preset type. Ignored if `secondary.affinity` is set. Allowed values: `soft` or `hard` | `""` |
+| `secondary.nodeAffinityPreset.key` | MySQL secondary node label key to match Ignored if `secondary.affinity` is set. | `""` |
+| `secondary.nodeAffinityPreset.values` | MySQL secondary node label values to match. Ignored if `secondary.affinity` is set. | `[]` |
+| `secondary.affinity` | Affinity for MySQL secondary pods assignment | `{}` |
+| `secondary.nodeSelector` | Node labels for MySQL secondary pods assignment | `{}` |
+| `secondary.tolerations` | Tolerations for MySQL secondary pods assignment | `[]` |
+| `secondary.podSecurityContext.enabled` | Enable security context for MySQL secondary pods | `true` |
+| `secondary.podSecurityContext.fsGroup` | Group ID for the mounted volumes' filesystem | `1001` |
+| `secondary.containerSecurityContext.enabled` | MySQL secondary container securityContext | `true` |
+| `secondary.containerSecurityContext.runAsUser` | User ID for the MySQL secondary container | `1001` |
+| `secondary.resources.limits` | The resources limits for MySQL secondary containers | `{}` |
+| `secondary.resources.requests` | The requested resources for MySQL secondary containers | `{}` |
+| `secondary.livenessProbe.enabled` | Enable livenessProbe | `true` |
+| `secondary.livenessProbe.initialDelaySeconds` | Initial delay seconds for livenessProbe | `5` |
+| `secondary.livenessProbe.periodSeconds` | Period seconds for livenessProbe | `10` |
+| `secondary.livenessProbe.timeoutSeconds` | Timeout seconds for livenessProbe | `1` |
+| `secondary.livenessProbe.failureThreshold` | Failure threshold for livenessProbe | `3` |
+| `secondary.livenessProbe.successThreshold` | Success threshold for livenessProbe | `1` |
+| `secondary.readinessProbe.enabled` | Enable readinessProbe | `true` |
+| `secondary.readinessProbe.initialDelaySeconds` | Initial delay seconds for readinessProbe | `5` |
+| `secondary.readinessProbe.periodSeconds` | Period seconds for readinessProbe | `10` |
+| `secondary.readinessProbe.timeoutSeconds` | Timeout seconds for readinessProbe | `1` |
+| `secondary.readinessProbe.failureThreshold` | Failure threshold for readinessProbe | `3` |
+| `secondary.readinessProbe.successThreshold` | Success threshold for readinessProbe | `1` |
+| `secondary.startupProbe.enabled` | Enable startupProbe | `true` |
+| `secondary.startupProbe.initialDelaySeconds` | Initial delay seconds for startupProbe | `15` |
+| `secondary.startupProbe.periodSeconds` | Period seconds for startupProbe | `10` |
+| `secondary.startupProbe.timeoutSeconds` | Timeout seconds for startupProbe | `1` |
+| `secondary.startupProbe.failureThreshold` | Failure threshold for startupProbe | `15` |
+| `secondary.startupProbe.successThreshold` | Success threshold for startupProbe | `1` |
+| `secondary.customLivenessProbe` | Override default liveness probe for MySQL secondary containers | `{}` |
+| `secondary.customReadinessProbe` | Override default readiness probe for MySQL secondary containers | `{}` |
+| `secondary.customStartupProbe` | Override default startup probe for MySQL secondary containers | `{}` |
+| `secondary.extraFlags` | MySQL secondary additional command line flags | `""` |
+| `secondary.extraEnvVars` | An array to add extra environment variables on MySQL secondary containers | `[]` |
+| `secondary.extraEnvVarsCM` | Name of existing ConfigMap containing extra env vars for MySQL secondary containers | `""` |
+| `secondary.extraEnvVarsSecret` | Name of existing Secret containing extra env vars for MySQL secondary containers | `""` |
+| `secondary.persistence.enabled` | Enable persistence on MySQL secondary replicas using a `PersistentVolumeClaim` | `true` |
+| `secondary.persistence.storageClass` | MySQL secondary persistent volume storage Class | `""` |
+| `secondary.persistence.annotations` | MySQL secondary persistent volume claim annotations | `{}` |
+| `secondary.persistence.accessModes` | MySQL secondary persistent volume access Modes | `["ReadWriteOnce"]` |
+| `secondary.persistence.size` | MySQL secondary persistent volume size | `8Gi` |
+| `secondary.persistence.selector` | Selector to match an existing Persistent Volume | `{}` |
+| `secondary.extraVolumes` | Optionally specify extra list of additional volumes to the MySQL secondary pod(s) | `[]` |
+| `secondary.extraVolumeMounts` | Optionally specify extra list of additional volumeMounts for the MySQL secondary container(s) | `[]` |
+| `secondary.initContainers` | Add additional init containers for the MySQL secondary pod(s) | `[]` |
+| `secondary.sidecars` | Add additional sidecar containers for the MySQL secondary pod(s) | `[]` |
+| `secondary.service.type` | MySQL secondary Kubernetes service type | `ClusterIP` |
+| `secondary.service.port` | MySQL secondary Kubernetes service port | `3306` |
+| `secondary.service.nodePort` | MySQL secondary Kubernetes service node port | `""` |
+| `secondary.service.clusterIP` | MySQL secondary Kubernetes service clusterIP IP | `""` |
+| `secondary.service.loadBalancerIP` | MySQL secondary loadBalancerIP if service type is `LoadBalancer` | `""` |
+| `secondary.service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` |
+| `secondary.service.loadBalancerSourceRanges` | Addresses that are allowed when MySQL secondary service is LoadBalancer | `[]` |
+| `secondary.service.annotations` | Provide any additional annotations which may be required | `{}` |
+| `secondary.pdb.enabled` | Enable/disable a Pod Disruption Budget creation for MySQL secondary pods | `false` |
+| `secondary.pdb.minAvailable` | Minimum number/percentage of MySQL secondary pods that should remain scheduled | `1` |
+| `secondary.pdb.maxUnavailable` | Maximum number/percentage of MySQL secondary pods that may be made unavailable | `""` |
+| `secondary.podLabels` | Additional pod labels for MySQL secondary pods | `{}` |
+
+
+### RBAC parameters
+
+| Name | Description | Value |
+| ---------------------------- | ------------------------------------------------------ | ------- |
+| `serviceAccount.create` | Enable the creation of a ServiceAccount for MySQL pods | `true` |
+| `serviceAccount.name` | Name of the created ServiceAccount | `""` |
+| `serviceAccount.annotations` | Annotations for MySQL Service Account | `{}` |
+| `rbac.create` | Whether to create & use RBAC resources or not | `false` |
+
+
+### Network Policy
+
+| Name | Description | Value |
+| ------------------------------------------ | --------------------------------------------------------------------------------------------------------------- | ------- |
+| `networkPolicy.enabled` | Enable creation of NetworkPolicy resources | `false` |
+| `networkPolicy.allowExternal` | The Policy model to apply. | `true` |
+| `networkPolicy.explicitNamespacesSelector` | A Kubernetes LabelSelector to explicitly select namespaces from which ingress traffic could be allowed to MySQL | `{}` |
+
+
+### Volume Permissions parameters
+
+| Name | Description | Value |
+| ------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | ----------------------- |
+| `volumePermissions.enabled` | Enable init container that changes the owner and group of the persistent volume(s) mountpoint to `runAsUser:fsGroup` | `false` |
+| `volumePermissions.image.registry` | Init container volume-permissions image registry | `docker.io` |
+| `volumePermissions.image.repository` | Init container volume-permissions image repository | `bitnami/bitnami-shell` |
+| `volumePermissions.image.tag` | Init container volume-permissions image tag (immutable tags are recommended) | `10-debian-10-r408` |
+| `volumePermissions.image.pullPolicy` | Init container volume-permissions image pull policy | `IfNotPresent` |
+| `volumePermissions.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` |
+| `volumePermissions.resources` | Init container volume-permissions resources | `{}` |
+
+
+### Metrics parameters
+
+| Name | Description | Value |
+| -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------- |
+| `metrics.enabled` | Start a side-car prometheus exporter | `false` |
+| `metrics.image.registry` | Exporter image registry | `docker.io` |
+| `metrics.image.repository` | Exporter image repository | `bitnami/mysqld-exporter` |
+| `metrics.image.tag` | Exporter image tag (immutable tags are recommended) | `0.14.0-debian-10-r52` |
+| `metrics.image.pullPolicy` | Exporter image pull policy | `IfNotPresent` |
+| `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` |
+| `metrics.service.type` | Kubernetes service type for MySQL Prometheus Exporter | `ClusterIP` |
+| `metrics.service.port` | MySQL Prometheus Exporter service port | `9104` |
+| `metrics.service.annotations` | Prometheus exporter service annotations | `{}` |
+| `metrics.extraArgs.primary` | Extra args to be passed to mysqld_exporter on Primary pods | `[]` |
+| `metrics.extraArgs.secondary` | Extra args to be passed to mysqld_exporter on Secondary pods | `[]` |
+| `metrics.resources.limits` | The resources limits for MySQL prometheus exporter containers | `{}` |
+| `metrics.resources.requests` | The requested resources for MySQL prometheus exporter containers | `{}` |
+| `metrics.livenessProbe.enabled` | Enable livenessProbe | `true` |
+| `metrics.livenessProbe.initialDelaySeconds` | Initial delay seconds for livenessProbe | `120` |
+| `metrics.livenessProbe.periodSeconds` | Period seconds for livenessProbe | `10` |
+| `metrics.livenessProbe.timeoutSeconds` | Timeout seconds for livenessProbe | `1` |
+| `metrics.livenessProbe.failureThreshold` | Failure threshold for livenessProbe | `3` |
+| `metrics.livenessProbe.successThreshold` | Success threshold for livenessProbe | `1` |
+| `metrics.readinessProbe.enabled` | Enable readinessProbe | `true` |
+| `metrics.readinessProbe.initialDelaySeconds` | Initial delay seconds for readinessProbe | `30` |
+| `metrics.readinessProbe.periodSeconds` | Period seconds for readinessProbe | `10` |
+| `metrics.readinessProbe.timeoutSeconds` | Timeout seconds for readinessProbe | `1` |
+| `metrics.readinessProbe.failureThreshold` | Failure threshold for readinessProbe | `3` |
+| `metrics.readinessProbe.successThreshold` | Success threshold for readinessProbe | `1` |
+| `metrics.serviceMonitor.enabled` | Create ServiceMonitor Resource for scraping metrics using PrometheusOperator | `false` |
+| `metrics.serviceMonitor.namespace` | Specify the namespace in which the serviceMonitor resource will be created | `""` |
+| `metrics.serviceMonitor.interval` | Specify the interval at which metrics should be scraped | `30s` |
+| `metrics.serviceMonitor.scrapeTimeout` | Specify the timeout after which the scrape is ended | `""` |
+| `metrics.serviceMonitor.relabellings` | Specify Metric Relabellings to add to the scrape endpoint | `[]` |
+| `metrics.serviceMonitor.honorLabels` | Specify honorLabels parameter to add the scrape endpoint | `false` |
+| `metrics.serviceMonitor.additionalLabels` | Used to pass Labels that are used by the Prometheus installed in your cluster to select Service Monitors to work with | `{}` |
+
+
+The above parameters map to the env variables defined in [bitnami/mysql](https://github.com/bitnami/bitnami-docker-mysql). For more information please refer to the [bitnami/mysql](https://github.com/bitnami/bitnami-docker-mysql) image documentation.
+
+Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
+
+```bash
+$ helm install my-release \
+ --set auth.rootPassword=secretpassword,auth.database=app_database \
+ bitnami/mysql
+```
+
+The above command sets the MySQL `root` account password to `secretpassword`. Additionally it creates a database named `app_database`.
+
+> NOTE: Once this chart is deployed, it is not possible to change the application's access credentials, such as usernames or passwords, using Helm. To change these application credentials after deployment, delete any persistent volumes (PVs) used by the chart and re-deploy it, or use the application's built-in administrative tools if available.
+
+Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,
+
+```bash
+$ helm install my-release -f values.yaml bitnami/mysql
+```
+
+> **Tip**: You can use the default [values.yaml](values.yaml)
+
+## Configuration and installation details
+
+### [Rolling VS Immutable tags](https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/)
+
+It is strongly recommended to use immutable tags in a production environment. This ensures your deployment does not change automatically if the same tag is updated with a different image.
+
+Bitnami will release a new chart updating its containers if a new version of the main container, significant changes, or critical vulnerabilities exist.
+
+### Use a different MySQL version
+
+To modify the application version used in this chart, specify a different version of the image using the `image.tag` parameter and/or a different repository using the `image.repository` parameter. Refer to the [chart documentation for more information on these parameters and how to use them with images from a private registry](https://docs.bitnami.com/kubernetes/infrastructure/mysql/configuration/change-image-version/).
+
+### Customize a new MySQL instance
+
+The [Bitnami MySQL](https://github.com/bitnami/bitnami-docker-mysql) image allows you to use your custom scripts to initialize a fresh instance. Custom scripts may be specified using the `initdbScripts` parameter. Alternatively, an external ConfigMap may be created with all the initialization scripts and the ConfigMap passed to the chart via the `initdbScriptsConfigMap` parameter. Note that this will override the `initdbScripts` parameter.
+
+The allowed extensions are `.sh`, `.sql` and `.sql.gz`.
+
+These scripts are treated differently depending on their extension. While `.sh` scripts are executed on all the nodes, `.sql` and `.sql.gz` scripts are only executed on the primary nodes. This is because `.sh` scripts support conditional tests to identify the type of node they are running on, while such tests are not supported in `.sql` or `sql.gz` files.
+
+Refer to the [chart documentation for more information and a usage example](http://docs.bitnami.com/kubernetes/infrastructure/mysql/configuration/customize-new-instance/).
+
+### Sidecars and Init Containers
+
+If you have a need for additional containers to run within the same pod as MySQL, you can do so via the `sidecars` config parameter. Simply define your container according to the Kubernetes container spec.
+
+```yaml
+sidecars:
+ - name: your-image-name
+ image: your-image
+ imagePullPolicy: Always
+ ports:
+ - name: portname
+ containerPort: 1234
+```
+
+Similarly, you can add extra init containers using the `initContainers` parameter.
+
+```yaml
+initContainers:
+ - name: your-image-name
+ image: your-image
+ imagePullPolicy: Always
+ ports:
+ - name: portname
+ containerPort: 1234
+```
+
+## Persistence
+
+The [Bitnami MySQL](https://github.com/bitnami/bitnami-docker-mysql) image stores the MySQL data and configurations at the `/bitnami/mysql` path of the container.
+
+The chart mounts a [Persistent Volume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) volume at this location. The volume is created using dynamic volume provisioning by default. An existing PersistentVolumeClaim can also be defined for this purpose.
+
+If you encounter errors when working with persistent volumes, refer to our [troubleshooting guide for persistent volumes](https://docs.bitnami.com/kubernetes/faq/troubleshooting/troubleshooting-persistence-volumes/).
+
+## Network Policy
+
+To enable network policy for MySQL, install [a networking plugin that implements the Kubernetes NetworkPolicy spec](https://kubernetes.io/docs/tasks/administer-cluster/declare-network-policy#before-you-begin), and set `networkPolicy.enabled` to `true`.
+
+For Kubernetes v1.5 & v1.6, you must also turn on NetworkPolicy by setting the DefaultDeny namespace annotation. Note: this will enforce policy for _all_ pods in the namespace:
+
+```console
+$ kubectl annotate namespace default "net.beta.kubernetes.io/network-policy={\"ingress\":{\"isolation\":\"DefaultDeny\"}}"
+```
+
+With NetworkPolicy enabled, traffic will be limited to just port 3306.
+
+For more precise policy, set `networkPolicy.allowExternal=false`. This will only allow pods with the generated client label to connect to MySQL.
+This label will be displayed in the output of a successful install.
+
+## Pod affinity
+
+This chart allows you to set your custom affinity using the `XXX.affinity` parameter(s). Find more information about Pod affinity in the [Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity).
+
+As an alternative, you can use the preset configurations for pod affinity, pod anti-affinity, and node affinity available at the [bitnami/common](https://github.com/bitnami/charts/tree/master/bitnami/common#affinities) chart. To do so, set the `XXX.podAffinityPreset`, `XXX.podAntiAffinityPreset`, or `XXX.nodeAffinityPreset` parameters.
+
+## Troubleshooting
+
+Find more information about how to deal with common errors related to Bitnami's Helm charts in [this troubleshooting guide](https://docs.bitnami.com/general/how-to/troubleshoot-helm-chart-issues).
+
+## Upgrading
+
+It's necessary to set the `auth.rootPassword` parameter when upgrading for readiness/liveness probes to work properly. When you install this chart for the first time, some notes will be displayed providing the credentials you must use under the 'Administrator credentials' section. Please note down the password and run the command below to upgrade your chart:
+
+```bash
+$ helm upgrade my-release bitnami/mysql --set auth.rootPassword=[ROOT_PASSWORD]
+```
+
+| Note: you need to substitute the placeholder _[ROOT_PASSWORD]_ with the value obtained in the installation notes.
+
+### To 8.0.0
+
+- Several parameters were renamed or disappeared in favor of new ones on this major version:
+ - The terms *master* and *slave* have been replaced by the terms *primary* and *secondary*. Therefore, parameters prefixed with `master` or `slave` are now prefixed with `primary` or `secondary`, respectively.
+ - Credentials parameters are reorganized under the `auth` parameter.
+ - `replication.enabled` parameter is deprecated in favor of `architecture` parameter that accepts two values: `standalone` and `replication`.
+- Chart labels were adapted to follow the [Helm charts standard labels](https://helm.sh/docs/chart_best_practices/labels/#standard-labels).
+- This version also introduces `bitnami/common`, a [library chart](https://helm.sh/docs/topics/library_charts/#helm) as a dependency. More documentation about this new utility could be found [here](https://github.com/bitnami/charts/tree/master/bitnami/common#bitnami-common-library-chart). Please, make sure that you have updated the chart dependencies before executing any upgrade.
+
+Consequences:
+
+- Backwards compatibility is not guaranteed. To upgrade to `8.0.0`, install a new release of the MySQL chart, and migrate the data from your previous release. You have 2 alternatives to do so:
+ - Create a backup of the database, and restore it on the new release using tools such as [mysqldump](https://dev.mysql.com/doc/refman/8.0/en/mysqldump.html).
+ - Reuse the PVC used to hold the master data on your previous release. To do so, use the `primary.persistence.existingClaim` parameter. The following example assumes that the release name is `mysql`:
+
+```bash
+$ helm install mysql bitnami/mysql --set auth.rootPassword=[ROOT_PASSWORD] --set primary.persistence.existingClaim=[EXISTING_PVC]
+```
+
+| Note: you need to substitute the placeholder _[EXISTING_PVC]_ with the name of the PVC used on your previous release, and _[ROOT_PASSWORD]_ with the root password used in your previous release.
+
+### To 7.0.0
+
+[On November 13, 2020, Helm v2 support formally ended](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.
+
+[Learn more about this change and related upgrade considerations](https://docs.bitnami.com/kubernetes/infrastructure/mysql/administration/upgrade-helm3/).
+
+### To 3.0.0
+
+Backwards compatibility is not guaranteed unless you modify the labels used on the chart's deployments.
+Use the workaround below to upgrade from versions previous to 3.0.0. The following example assumes that the release name is mysql:
+
+```console
+$ kubectl delete statefulset mysql-master --cascade=false
+$ kubectl delete statefulset mysql-slave --cascade=false
+```
+
+## License
+
+Copyright © 2022 Bitnami
+
+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.
\ No newline at end of file
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/.helmignore b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/.helmignore
new file mode 100644
index 0000000..50af031
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/.helmignore
@@ -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/
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/Chart.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/Chart.yaml
new file mode 100644
index 0000000..e8d2db9
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/Chart.yaml
@@ -0,0 +1,23 @@
+annotations:
+ category: Infrastructure
+apiVersion: v2
+appVersion: 1.13.1
+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
+- https://www.bitnami.com/
+type: library
+version: 1.13.1
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/README.md b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/README.md
new file mode 100644
index 0000000..88d13b1
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/README.md
@@ -0,0 +1,347 @@
+# 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: 1.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.19+
+- Helm 3.2.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.nodes.soft` | Return a soft nodeAffinity definition | `dict "key" "FOO" "values" (list "BAR" "BAZ")` |
+| `common.affinities.nodes.hard` | Return a hard nodeAffinity definition | `dict "key" "FOO" "values" (list "BAR" "BAZ")` |
+| `common.affinities.pods.soft` | Return a soft podAffinity/podAntiAffinity definition | `dict "component" "FOO" "context" $` |
+| `common.affinities.pods.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.cronjob.apiVersion` | Return the appropriate apiVersion for cronjob. | `.` 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 podsecuritypolicy. | `.` Chart context |
+| `common.capabilities.networkPolicy.apiVersion` | Return the appropriate apiVersion for networkpolicy. | `.` Chart context |
+| `common.capabilities.apiService.apiVersion` | Return the appropriate apiVersion for APIService. | `.` 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 |
+| `common.ingress.certManagerRequest` | Prints "true" if required cert-manager annotations for TLS signed certificates are set in the Ingress annotations | `dict "annotations" .Values.path.to.the.ingress.annotations` |
+
+### Labels
+
+| Helper identifier | Description | Expected Input |
+|-----------------------------|-----------------------------------------------------------------------------|-------------------|
+| `common.labels.standard` | Return Kubernetes standard labels | `.` Chart context |
+| `common.labels.matchLabels` | Labels to use on `deploy.spec.selector.matchLabels` and `svc.spec.selector` | `.` Chart context |
+
+### Names
+
+| Helper identifier | Description | Expected Input |
+|--------------------------|------------------------------------------------------------|-------------------|
+| `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.namespace` | Allow the release namespace to be overridden | `.` 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.storage.class` | Return the proper Storage Class | `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™ 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® 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/
+
+## License
+
+Copyright © 2022 Bitnami
+
+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.
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_affinities.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_affinities.tpl
new file mode 100644
index 0000000..189ea40
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_affinities.tpl
@@ -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 -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_capabilities.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_capabilities.tpl
new file mode 100644
index 0000000..4ec8321
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_capabilities.tpl
@@ -0,0 +1,139 @@
+{{/* 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 poddisruptionbudget.
+*/}}
+{{- 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 networkpolicy.
+*/}}
+{{- define "common.capabilities.networkPolicy.apiVersion" -}}
+{{- if semverCompare "<1.7-0" (include "common.capabilities.kubeVersion" .) -}}
+{{- print "extensions/v1beta1" -}}
+{{- else -}}
+{{- print "networking.k8s.io/v1" -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Return the appropriate apiVersion for cronjob.
+*/}}
+{{- define "common.capabilities.cronjob.apiVersion" -}}
+{{- if semverCompare "<1.21-0" (include "common.capabilities.kubeVersion" .) -}}
+{{- print "batch/v1beta1" -}}
+{{- else -}}
+{{- print "batch/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 -}}
+
+{{/*
+Return the appropriate apiVersion for APIService.
+*/}}
+{{- define "common.capabilities.apiService.apiVersion" -}}
+{{- if semverCompare "<1.10-0" (include "common.capabilities.kubeVersion" .) -}}
+{{- print "apiregistration.k8s.io/v1beta1" -}}
+{{- else -}}
+{{- print "apiregistration.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 -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_errors.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_errors.tpl
new file mode 100644
index 0000000..a79cc2e
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_errors.tpl
@@ -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 -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_images.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_images.tpl
new file mode 100644
index 0000000..42ffbc7
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_images.tpl
@@ -0,0 +1,75 @@
+{{/* 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 -}}
+
+{{/*
+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 -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_ingress.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_ingress.tpl
new file mode 100644
index 0000000..8caf73a
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_ingress.tpl
@@ -0,0 +1,68 @@
+{{/* 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 -}}
+
+{{/*
+Return true if cert-manager required annotations for TLS signed
+certificates are set in the Ingress annotations
+Ref: https://cert-manager.io/docs/usage/ingress/#supported-annotations
+Usage:
+{{ include "common.ingress.certManagerRequest" ( dict "annotations" .Values.path.to.the.ingress.annotations ) }}
+*/}}
+{{- define "common.ingress.certManagerRequest" -}}
+{{ if or (hasKey .annotations "cert-manager.io/cluster-issuer") (hasKey .annotations "cert-manager.io/issuer") }}
+ {{- true -}}
+{{- end -}}
+{{- end -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_labels.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_labels.tpl
new file mode 100644
index 0000000..252066c
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_labels.tpl
@@ -0,0 +1,18 @@
+{{/* vim: set filetype=mustache: */}}
+{{/*
+Kubernetes standard labels
+*/}}
+{{- define "common.labels.standard" -}}
+app.kubernetes.io/name: {{ include "common.names.name" . }}
+helm.sh/chart: {{ include "common.names.chart" . }}
+app.kubernetes.io/instance: {{ .Release.Name }}
+app.kubernetes.io/managed-by: {{ .Release.Service }}
+{{- 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/instance: {{ .Release.Name }}
+{{- end -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_names.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_names.tpl
new file mode 100644
index 0000000..c8574d1
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_names.tpl
@@ -0,0 +1,63 @@
+{{/* 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 -}}
+
+{{/*
+Create a default fully qualified dependency 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.
+Usage:
+{{ include "common.names.dependency.fullname" (dict "chartName" "dependency-chart-name" "chartValues" .Values.dependency-chart "context" $) }}
+*/}}
+{{- define "common.names.dependency.fullname" -}}
+{{- if .chartValues.fullnameOverride -}}
+{{- .chartValues.fullnameOverride | trunc 63 | trimSuffix "-" -}}
+{{- else -}}
+{{- $name := default .chartName .chartValues.nameOverride -}}
+{{- if contains $name .context.Release.Name -}}
+{{- .context.Release.Name | trunc 63 | trimSuffix "-" -}}
+{{- else -}}
+{{- printf "%s-%s" .context.Release.Name $name | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Allow the release namespace to be overridden for multi-namespace deployments in combined charts.
+*/}}
+{{- define "common.names.namespace" -}}
+{{- if .Values.namespaceOverride -}}
+{{- .Values.namespaceOverride -}}
+{{- else -}}
+{{- .Release.Namespace -}}
+{{- end -}}
+{{- end -}}
\ No newline at end of file
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_secrets.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_secrets.tpl
new file mode 100644
index 0000000..a53fb44
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_secrets.tpl
@@ -0,0 +1,140 @@
+{{/* 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 - 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.
+
+The order in which this function returns a secret password:
+ 1. Already existing 'Secret' resource
+ (If a 'Secret' resource is found under the name provided to the 'secret' parameter to this function and that 'Secret' resource contains a key with the name passed as the 'key' parameter to this function then the value of this existing secret password will be returned)
+ 2. Password provided via the values.yaml
+ (If one of the keys passed to the 'providedValues' parameter to this function is a valid path to a key in the values.yaml and has a value, the value of the first key with a value will be returned)
+ 3. Randomly generated secret password
+ (A new random secret password with the length specified in the 'length' parameter will be generated and returned)
+
+*/}}
+{{- 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) }}
+{{- $secretData := (lookup "v1" "Secret" $.context.Release.Namespace .secret).data }}
+{{- if $secretData }}
+ {{- if hasKey $secretData .key }}
+ {{- $password = index $secretData .key }}
+ {{- else }}
+ {{- printf "\nPASSWORDS ERROR: The secret \"%s\" does not contain the key \"%s\"\n" .secret .key | fail -}}
+ {{- 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 -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_storage.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_storage.tpl
new file mode 100644
index 0000000..60e2a84
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_storage.tpl
@@ -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 -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_tplvalues.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_tplvalues.tpl
new file mode 100644
index 0000000..2db1668
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_tplvalues.tpl
@@ -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 -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_utils.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_utils.tpl
new file mode 100644
index 0000000..ea083a2
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_utils.tpl
@@ -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 -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_warnings.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_warnings.tpl
new file mode 100644
index 0000000..ae10fa4
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/_warnings.tpl
@@ -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 -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/validations/_cassandra.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/validations/_cassandra.tpl
new file mode 100644
index 0000000..ded1ae3
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/validations/_cassandra.tpl
@@ -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 (or (not $existingSecret) (eq $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 -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/validations/_mariadb.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/validations/_mariadb.tpl
new file mode 100644
index 0000000..b6906ff
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/validations/_mariadb.tpl
@@ -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 (or (not $existingSecret) (eq $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 -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/validations/_mongodb.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/validations/_mongodb.tpl
new file mode 100644
index 0000000..a071ea4
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/validations/_mongodb.tpl
@@ -0,0 +1,108 @@
+{{/* vim: set filetype=mustache: */}}
+{{/*
+Validate MongoDB® 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® values are stored, e.g: "mongodb-passwords-secret"
+ - subchart - Boolean - Optional. Whether MongoDB® 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 (or (not $existingSecret) (eq $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® 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 -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/validations/_postgresql.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/validations/_postgresql.tpl
new file mode 100644
index 0000000..164ec0d
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/validations/_postgresql.tpl
@@ -0,0 +1,129 @@
+{{/* 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 (or (not $existingSecret) (eq $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 -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/validations/_redis.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/validations/_redis.tpl
new file mode 100644
index 0000000..5d72959
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/validations/_redis.tpl
@@ -0,0 +1,76 @@
+
+{{/* vim: set filetype=mustache: */}}
+{{/*
+Validate Redis™ 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 (or (not $existingSecret) (eq $existingSecret "\"\"")) (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 -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/validations/_validations.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/validations/_validations.tpl
new file mode 100644
index 0000000..9a814cf
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/templates/validations/_validations.tpl
@@ -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 -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/values.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/values.yaml
new file mode 100644
index 0000000..f2df68e
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/charts/common/values.yaml
@@ -0,0 +1,5 @@
+## bitnami/common
+## It is required by CI/CD tools and processes.
+## @skip exampleValue
+##
+exampleValue: common-chart
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/ci/values-production-with-rbac.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/ci/values-production-with-rbac.yaml
new file mode 100644
index 0000000..d3370c9
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/ci/values-production-with-rbac.yaml
@@ -0,0 +1,30 @@
+# Test values file for generating all of the yaml and check that
+# the rendering is correct
+
+architecture: replication
+auth:
+ usePasswordFiles: true
+
+primary:
+ extraEnvVars:
+ - name: TEST
+ value: "3"
+ podDisruptionBudget:
+ create: true
+
+secondary:
+ replicaCount: 2
+ extraEnvVars:
+ - name: TEST
+ value: "2"
+ podDisruptionBudget:
+ create: true
+
+serviceAccount:
+ create: true
+ name: mysql-service-account
+rbac:
+ create: true
+
+metrics:
+ enabled: true
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/NOTES.txt b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/NOTES.txt
new file mode 100644
index 0000000..f42e081
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/NOTES.txt
@@ -0,0 +1,99 @@
+CHART NAME: {{ .Chart.Name }}
+CHART VERSION: {{ .Chart.Version }}
+APP VERSION: {{ .Chart.AppVersion }}
+
+** Please be patient while the chart is being deployed **
+
+{{- if .Values.diagnosticMode.enabled }}
+The chart has been deployed in diagnostic mode. All probes have been disabled and the command has been overwritten with:
+
+ command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 4 }}
+ args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 4 }}
+
+Get the list of pods by executing:
+
+ kubectl get pods --namespace {{ .Release.Namespace }} -l app.kubernetes.io/instance={{ .Release.Name }}
+
+Access the pod you want to debug by executing
+
+ kubectl exec --namespace {{ .Release.Namespace }} -ti -- bash
+
+In order to replicate the container startup scripts execute this command:
+
+ /opt/bitnami/scripts/mysql/entrypoint.sh /opt/bitnami/scripts/mysql/run.sh
+
+{{- else }}
+
+Tip:
+
+ Watch the deployment status using the command: kubectl get pods -w --namespace {{ .Release.Namespace }}
+
+Services:
+
+ echo Primary: {{ include "mysql.primary.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}:{{ .Values.primary.service.port }}
+{{- if eq .Values.architecture "replication" }}
+ echo Secondary: {{ include "mysql.secondary.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}:{{ .Values.secondary.service.port }}
+{{- end }}
+
+Execute the following to get the administrator credentials:
+
+ echo Username: root
+ MYSQL_ROOT_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "mysql.secretName" . }} -o jsonpath="{.data.mysql-root-password}" | base64 --decode)
+
+To connect to your database:
+
+ 1. Run a pod that you can use as a client:
+
+ kubectl run {{ include "common.names.fullname" . }}-client --rm --tty -i --restart='Never' --image {{ template "mysql.image" . }} --namespace {{ .Release.Namespace }} --env MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD --command -- bash
+
+ 2. To connect to primary service (read/write):
+
+ mysql -h {{ include "mysql.primary.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }} -uroot -p"$MYSQL_ROOT_PASSWORD"
+
+{{- if eq .Values.architecture "replication" }}
+
+ 3. To connect to secondary service (read-only):
+
+ mysql -h {{ include "mysql.secondary.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }} -uroot -p"$MYSQL_ROOT_PASSWORD"
+{{- end }}
+
+{{ if and (.Values.networkPolicy.enabled) (not .Values.networkPolicy.allowExternal) }}
+Note: Since NetworkPolicy is enabled, only pods with label {{ template "common.names.fullname" . }}-client=true" will be able to connect to MySQL.
+{{- end }}
+
+{{- if .Values.metrics.enabled }}
+
+To access the MySQL Prometheus metrics from outside the cluster execute the following commands:
+
+ kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ printf "%s-metrics" (include "common.names.fullname" .) }} {{ .Values.metrics.service.port }}:{{ .Values.metrics.service.port }} &
+ curl http://127.0.0.1:{{ .Values.metrics.service.port }}/metrics
+
+{{- end }}
+
+To upgrade this helm chart:
+
+ 1. Obtain the password as described on the 'Administrator credentials' section and set the 'root.password' parameter as shown below:
+
+ ROOT_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ include "common.names.fullname" . }} -o jsonpath="{.data.mysql-root-password}" | base64 --decode)
+ helm upgrade --namespace {{ .Release.Namespace }} {{ .Release.Name }} bitnami/mysql --set auth.rootPassword=$ROOT_PASSWORD
+
+{{ include "mysql.validateValues" . }}
+{{ include "mysql.checkRollingTags" . }}
+{{- if and (not .Values.auth.existingSecret) (not .Values.auth.customPasswordFiles) -}}
+ {{- $secretName := include "mysql.secretName" . -}}
+ {{- $requiredPasswords := list -}}
+
+ {{- $requiredRootPassword := dict "valueKey" "auth.rootPassword" "secret" $secretName "field" "mysql-root-password" -}}
+ {{- $requiredPasswords = append $requiredPasswords $requiredRootPassword -}}
+
+ {{- if not (empty .Values.auth.username) -}}
+ {{- $requiredPassword := dict "valueKey" "auth.password" "secret" $secretName "field" "mysql-password" -}}
+ {{- $requiredPasswords = append $requiredPasswords $requiredPassword -}}
+ {{- end -}}
+
+ {{- if (eq .Values.architecture "replication") -}}
+ {{- $requiredReplicationPassword := dict "valueKey" "auth.replicationPassword" "secret" $secretName "field" "mysql-replication-password" -}}
+ {{- $requiredPasswords = append $requiredPasswords $requiredReplicationPassword -}}
+ {{- end -}}
+{{- end }}
+{{- end }}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/_helpers.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/_helpers.tpl
new file mode 100644
index 0000000..98b2346
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/_helpers.tpl
@@ -0,0 +1,192 @@
+{{/* vim: set filetype=mustache: */}}
+
+{{- define "mysql.primary.fullname" -}}
+{{- if eq .Values.architecture "replication" }}
+{{- printf "%s-%s" (include "common.names.fullname" .) "primary" | trunc 63 | trimSuffix "-" -}}
+{{- else -}}
+{{- include "common.names.fullname" . -}}
+{{- end -}}
+{{- end -}}
+
+{{- define "mysql.secondary.fullname" -}}
+{{- printf "%s-%s" (include "common.names.fullname" .) "secondary" | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+{{/*
+Return the proper MySQL image name
+*/}}
+{{- define "mysql.image" -}}
+{{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }}
+{{- end -}}
+
+{{/*
+Return the proper metrics image name
+*/}}
+{{- define "mysql.metrics.image" -}}
+{{ include "common.images.image" (dict "imageRoot" .Values.metrics.image "global" .Values.global) }}
+{{- end -}}
+
+{{/*
+Return the proper image name (for the init container volume-permissions image)
+*/}}
+{{- define "mysql.volumePermissions.image" -}}
+{{ include "common.images.image" (dict "imageRoot" .Values.volumePermissions.image "global" .Values.global) }}
+{{- end -}}
+
+{{/*
+Return the proper Docker Image Registry Secret Names
+*/}}
+{{- define "mysql.imagePullSecrets" -}}
+{{ include "common.images.pullSecrets" (dict "images" (list .Values.image .Values.metrics.image .Values.volumePermissions.image) "global" .Values.global) }}
+{{- end -}}
+
+{{ template "mysql.initdbScriptsCM" . }}
+{{/*
+Get the initialization scripts ConfigMap name.
+*/}}
+{{- define "mysql.initdbScriptsCM" -}}
+{{- if .Values.initdbScriptsConfigMap -}}
+ {{- printf "%s" (tpl .Values.initdbScriptsConfigMap $) -}}
+{{- else -}}
+ {{- printf "%s-init-scripts" (include "mysql.primary.fullname" .) -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+ Returns the proper service account name depending if an explicit service account name is set
+ in the values file. If the name is not set it will default to either mysql.fullname if serviceAccount.create
+ is true or default otherwise.
+*/}}
+{{- define "mysql.serviceAccountName" -}}
+ {{- if .Values.serviceAccount.create -}}
+ {{ default (include "common.names.fullname" .) .Values.serviceAccount.name }}
+ {{- else -}}
+ {{ default "default" .Values.serviceAccount.name }}
+ {{- end -}}
+{{- end -}}
+
+{{/*
+Return the configmap with the MySQL Primary configuration
+*/}}
+{{- define "mysql.primary.configmapName" -}}
+{{- if .Values.primary.existingConfigmap -}}
+ {{- printf "%s" (tpl .Values.primary.existingConfigmap $) -}}
+{{- else -}}
+ {{- printf "%s" (include "mysql.primary.fullname" .) -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Return true if a configmap object should be created for MySQL Secondary
+*/}}
+{{- define "mysql.primary.createConfigmap" -}}
+{{- if and .Values.primary.configuration (not .Values.primary.existingConfigmap) }}
+ {{- true -}}
+{{- else -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Return the configmap with the MySQL Primary configuration
+*/}}
+{{- define "mysql.secondary.configmapName" -}}
+{{- if .Values.secondary.existingConfigmap -}}
+ {{- printf "%s" (tpl .Values.secondary.existingConfigmap $) -}}
+{{- else -}}
+ {{- printf "%s" (include "mysql.secondary.fullname" .) -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Return true if a configmap object should be created for MySQL Secondary
+*/}}
+{{- define "mysql.secondary.createConfigmap" -}}
+{{- if and (eq .Values.architecture "replication") .Values.secondary.configuration (not .Values.secondary.existingConfigmap) }}
+ {{- true -}}
+{{- else -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Return the secret with MySQL credentials
+*/}}
+{{- define "mysql.secretName" -}}
+ {{- if .Values.auth.existingSecret -}}
+ {{- printf "%s" (tpl .Values.auth.existingSecret $) -}}
+ {{- else -}}
+ {{- printf "%s" (include "common.names.fullname" .) -}}
+ {{- end -}}
+{{- end -}}
+
+{{/*
+Return true if a secret object should be created for MySQL
+*/}}
+{{- define "mysql.createSecret" -}}
+{{- if and (not .Values.auth.existingSecret) (not .Values.auth.customPasswordFiles) }}
+ {{- true -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Returns the available value for certain key in an existing secret (if it exists),
+otherwise it generates a random value.
+*/}}
+{{- define "getValueFromSecret" }}
+ {{- $len := (default 16 .Length) | int -}}
+ {{- $obj := (lookup "v1" "Secret" .Namespace .Name).data -}}
+ {{- if $obj }}
+ {{- index $obj .Key | b64dec -}}
+ {{- else -}}
+ {{- randAlphaNum $len -}}
+ {{- end -}}
+{{- end }}
+
+{{- define "mysql.root.password" -}}
+ {{- if not (empty .Values.auth.rootPassword) }}
+ {{- .Values.auth.rootPassword }}
+ {{- else if (not .Values.auth.forcePassword) }}
+ {{- include "getValueFromSecret" (dict "Namespace" .Release.Namespace "Name" (include "common.names.fullname" .) "Length" 10 "Key" "mysql-root-password") }}
+ {{- else }}
+ {{- required "A MySQL Root Password is required!" .Values.auth.rootPassword }}
+ {{- end }}
+{{- end -}}
+
+{{- define "mysql.password" -}}
+ {{- if and (not (empty .Values.auth.username)) (not (empty .Values.auth.password)) }}
+ {{- .Values.auth.password }}
+ {{- else if (not .Values.auth.forcePassword) }}
+ {{- include "getValueFromSecret" (dict "Namespace" .Release.Namespace "Name" (include "common.names.fullname" .) "Length" 10 "Key" "mysql-password") }}
+ {{- else }}
+ {{- required "A MySQL Database Password is required!" .Values.auth.password }}
+ {{- end }}
+{{- end -}}
+
+{{- define "mysql.replication.password" -}}
+ {{- if not (empty .Values.auth.replicationPassword) }}
+ {{- .Values.auth.replicationPassword }}
+ {{- else if (not .Values.auth.forcePassword) }}
+ {{- include "getValueFromSecret" (dict "Namespace" .Release.Namespace "Name" (include "common.names.fullname" .) "Length" 10 "Key" "mysql-replication-password") }}
+ {{- else }}
+ {{- required "A MySQL Replication Password is required!" .Values.auth.replicationPassword }}
+ {{- end }}
+{{- end -}}
+
+{{/* Check if there are rolling tags in the images */}}
+{{- define "mysql.checkRollingTags" -}}
+{{- include "common.warnings.rollingTag" .Values.image }}
+{{- include "common.warnings.rollingTag" .Values.metrics.image }}
+{{- include "common.warnings.rollingTag" .Values.volumePermissions.image }}
+{{- end -}}
+
+{{/*
+Compile all warnings into a single message, and call fail.
+*/}}
+{{- define "mysql.validateValues" -}}
+{{- $messages := list -}}
+{{- $messages := without $messages "" -}}
+{{- $message := join "\n" $messages -}}
+
+{{- if $message -}}
+{{- printf "\nVALUES VALIDATION:\n%s" $message | fail -}}
+{{- end -}}
+{{- end -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/extra-list.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/extra-list.yaml
new file mode 100644
index 0000000..9ac65f9
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/extra-list.yaml
@@ -0,0 +1,4 @@
+{{- range .Values.extraDeploy }}
+---
+{{ include "common.tplvalues.render" (dict "value" . "context" $) }}
+{{- end }}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/metrics-svc.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/metrics-svc.yaml
new file mode 100644
index 0000000..fb0d9d7
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/metrics-svc.yaml
@@ -0,0 +1,29 @@
+{{- if .Values.metrics.enabled }}
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ printf "%s-metrics" (include "common.names.fullname" .) }}
+ namespace: {{ .Release.Namespace }}
+ labels: {{- include "common.labels.standard" . | nindent 4 }}
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ app.kubernetes.io/component: metrics
+ {{- if or .Values.metrics.service.annotations .Values.commonAnnotations }}
+ annotations:
+ {{- if .Values.metrics.service.annotations }}
+ {{- include "common.tplvalues.render" (dict "value" .Values.metrics.service.annotations "context" $) | nindent 4 }}
+ {{- end }}
+ {{- if .Values.commonAnnotations }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- end }}
+spec:
+ type: {{ .Values.metrics.service.type }}
+ ports:
+ - port: {{ .Values.metrics.service.port }}
+ targetPort: metrics
+ protocol: TCP
+ name: metrics
+ selector: {{- include "common.labels.matchLabels" $ | nindent 4 }}
+{{- end }}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/networkpolicy.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/networkpolicy.yaml
new file mode 100644
index 0000000..a0d1d01
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/networkpolicy.yaml
@@ -0,0 +1,38 @@
+{{- if .Values.networkPolicy.enabled }}
+kind: NetworkPolicy
+apiVersion: {{ template "common.capabilities.networkPolicy.apiVersion" . }}
+metadata:
+ name: {{ template "common.names.fullname" . }}
+ labels:
+ {{- include "common.labels.standard" . | nindent 4 }}
+ {{- if .Values.commonAnnotations }}
+ annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+ namespace: {{ .Release.Namespace }}
+spec:
+ podSelector:
+ matchLabels:
+ {{- include "common.labels.matchLabels" . | nindent 6 }}
+ ingress:
+ # Allow inbound connections
+ - ports:
+ - port: {{ .Values.primary.service.port }}
+ {{- if not .Values.networkPolicy.allowExternal }}
+ from:
+ - podSelector:
+ matchLabels:
+ {{ template "common.names.fullname" . }}-client: "true"
+ {{- if .Values.networkPolicy.explicitNamespacesSelector }}
+ namespaceSelector:
+{{ toYaml .Values.networkPolicy.explicitNamespacesSelector | indent 12 }}
+ {{- end }}
+ - podSelector:
+ matchLabels:
+ {{- include "common.labels.matchLabels" . | nindent 14 }}
+ {{- end }}
+ {{- if .Values.metrics.enabled }}
+ # Allow prometheus scrapes
+ - ports:
+ - port: 9104
+ {{- end }}
+{{- end }}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/primary/configmap.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/primary/configmap.yaml
new file mode 100644
index 0000000..540b7b9
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/primary/configmap.yaml
@@ -0,0 +1,18 @@
+{{- if (include "mysql.primary.createConfigmap" .) }}
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: {{ include "mysql.primary.fullname" . }}
+ namespace: {{ .Release.Namespace }}
+ labels: {{- include "common.labels.standard" . | nindent 4 }}
+ app.kubernetes.io/component: primary
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- if .Values.commonAnnotations }}
+ annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+data:
+ my.cnf: |-
+ {{ .Values.primary.configuration | nindent 4 }}
+{{- end -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/primary/initialization-configmap.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/primary/initialization-configmap.yaml
new file mode 100644
index 0000000..83cbaea
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/primary/initialization-configmap.yaml
@@ -0,0 +1,14 @@
+{{- if and .Values.initdbScripts (not .Values.initdbScriptsConfigMap) }}
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: {{ printf "%s-init-scripts" (include "mysql.primary.fullname" .) }}
+ namespace: {{ .Release.Namespace }}
+ labels: {{- include "common.labels.standard" . | nindent 4 }}
+ app.kubernetes.io/component: primary
+ {{- if .Values.commonAnnotations }}
+ annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+data:
+{{- include "common.tplvalues.render" (dict "value" .Values.initdbScripts "context" .) | nindent 2 }}
+{{ end }}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/primary/pdb.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/primary/pdb.yaml
new file mode 100644
index 0000000..106ad52
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/primary/pdb.yaml
@@ -0,0 +1,25 @@
+{{- if .Values.primary.pdb.enabled }}
+apiVersion: {{ include "common.capabilities.policy.apiVersion" . }}
+kind: PodDisruptionBudget
+metadata:
+ name: {{ include "mysql.primary.fullname" . }}
+ namespace: {{ .Release.Namespace }}
+ labels: {{- include "common.labels.standard" . | nindent 4 }}
+ app.kubernetes.io/component: primary
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- if .Values.commonAnnotations }}
+ annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+spec:
+ {{- if .Values.primary.pdb.minAvailable }}
+ minAvailable: {{ .Values.primary.pdb.minAvailable }}
+ {{- end }}
+ {{- if .Values.primary.pdb.maxUnavailable }}
+ maxUnavailable: {{ .Values.primary.pdb.maxUnavailable }}
+ {{- end }}
+ selector:
+ matchLabels: {{ include "common.labels.matchLabels" . | nindent 6 }}
+ app.kubernetes.io/component: primary
+{{- end }}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/primary/statefulset.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/primary/statefulset.yaml
new file mode 100644
index 0000000..6f9c99e
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/primary/statefulset.yaml
@@ -0,0 +1,368 @@
+apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }}
+kind: StatefulSet
+metadata:
+ name: {{ include "mysql.primary.fullname" . }}
+ namespace: {{ .Release.Namespace }}
+ labels: {{- include "common.labels.standard" . | nindent 4 }}
+ app.kubernetes.io/component: primary
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- if .Values.primary.podLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.primary.podLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- if .Values.commonAnnotations }}
+ annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+spec:
+ replicas: 1
+ selector:
+ matchLabels: {{ include "common.labels.matchLabels" . | nindent 6 }}
+ app.kubernetes.io/component: primary
+ serviceName: {{ include "mysql.primary.fullname" . }}
+ updateStrategy:
+ type: {{ .Values.primary.updateStrategy }}
+ {{- if (eq "Recreate" .Values.primary.updateStrategy) }}
+ rollingUpdate: null
+ {{- else if .Values.primary.rollingUpdatePartition }}
+ rollingUpdate:
+ partition: {{ .Values.primary.rollingUpdatePartition }}
+ {{- end }}
+ template:
+ metadata:
+ annotations:
+ {{- if (include "mysql.primary.createConfigmap" .) }}
+ checksum/configuration: {{ include (print $.Template.BasePath "/primary/configmap.yaml") . | sha256sum }}
+ {{- end }}
+ {{- if .Values.primary.podAnnotations }}
+ {{- include "common.tplvalues.render" (dict "value" .Values.primary.podAnnotations "context" $) | nindent 8 }}
+ {{- end }}
+ labels: {{- include "common.labels.standard" . | nindent 8 }}
+ app.kubernetes.io/component: primary
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 8 }}
+ {{- end }}
+ {{- if .Values.primary.podLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.primary.podLabels "context" $ ) | nindent 8 }}
+ {{- end }}
+ spec:
+ {{- include "mysql.imagePullSecrets" . | nindent 6 }}
+ {{- if .Values.primary.hostAliases }}
+ hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.primary.hostAliases "context" $) | nindent 8 }}
+ {{- end }}
+ {{- if .Values.schedulerName }}
+ schedulerName: {{ .Values.schedulerName | quote }}
+ {{- end }}
+ serviceAccountName: {{ template "mysql.serviceAccountName" . }}
+ {{- if .Values.primary.affinity }}
+ affinity: {{- include "common.tplvalues.render" (dict "value" .Values.primary.affinity "context" $) | nindent 8 }}
+ {{- else }}
+ affinity:
+ podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.primary.podAffinityPreset "component" "primary" "context" $) | nindent 10 }}
+ podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.primary.podAntiAffinityPreset "component" "primary" "context" $) | nindent 10 }}
+ nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.primary.nodeAffinityPreset.type "key" .Values.primary.nodeAffinityPreset.key "values" .Values.primary.nodeAffinityPreset.values) | nindent 10 }}
+ {{- end }}
+ {{- if .Values.primary.nodeSelector }}
+ nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.primary.nodeSelector "context" $) | nindent 8 }}
+ {{- end }}
+ {{- if .Values.primary.tolerations }}
+ tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.primary.tolerations "context" $) | nindent 8 }}
+ {{- end }}
+ {{- if .Values.priorityClassName }}
+ priorityClassName: {{ .Values.priorityClassName | quote }}
+ {{- end }}
+ {{- if .Values.primary.podSecurityContext.enabled }}
+ securityContext: {{- omit .Values.primary.podSecurityContext "enabled" | toYaml | nindent 8 }}
+ {{- end }}
+ {{- if or .Values.primary.initContainers (and .Values.primary.podSecurityContext.enabled .Values.volumePermissions.enabled .Values.primary.persistence.enabled) }}
+ initContainers:
+ {{- if .Values.primary.initContainers }}
+ {{- include "common.tplvalues.render" (dict "value" .Values.primary.initContainers "context" $) | nindent 8 }}
+ {{- end }}
+ {{- if and .Values.primary.podSecurityContext.enabled .Values.volumePermissions.enabled .Values.primary.persistence.enabled }}
+ - name: volume-permissions
+ image: {{ include "mysql.volumePermissions.image" . }}
+ imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }}
+ command:
+ - /bin/bash
+ - -ec
+ - |
+ chown -R {{ .Values.primary.containerSecurityContext.runAsUser }}:{{ .Values.primary.podSecurityContext.fsGroup }} /bitnami/mysql
+ securityContext:
+ runAsUser: 0
+ {{- if .Values.volumePermissions.resources }}
+ resources: {{- toYaml .Values.volumePermissions.resources | nindent 12 }}
+ {{- end }}
+ volumeMounts:
+ - name: data
+ mountPath: /bitnami/mysql
+ {{- end }}
+ {{- end }}
+ containers:
+ - name: mysql
+ image: {{ include "mysql.image" . }}
+ imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
+ {{- if .Values.primary.containerSecurityContext.enabled }}
+ securityContext: {{- omit .Values.primary.containerSecurityContext "enabled" | toYaml | nindent 12 }}
+ {{- end }}
+ {{- if .Values.diagnosticMode.enabled }}
+ command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
+ {{- else if .Values.primary.command }}
+ command: {{- include "common.tplvalues.render" (dict "value" .Values.primary.command "context" $) | nindent 12 }}
+ {{- end }}
+ {{- if .Values.diagnosticMode.enabled }}
+ args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
+ {{- else if .Values.primary.args }}
+ args: {{- include "common.tplvalues.render" (dict "value" .Values.primary.args "context" $) | nindent 12 }}
+ {{- end }}
+ env:
+ - name: BITNAMI_DEBUG
+ value: {{ ternary "true" "false" (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }}
+ {{- if .Values.auth.usePasswordFiles }}
+ - name: MYSQL_ROOT_PASSWORD_FILE
+ value: {{ default "/opt/bitnami/mysql/secrets/mysql-root-password" .Values.auth.customPasswordFiles.root }}
+ {{- else }}
+ - name: MYSQL_ROOT_PASSWORD
+ valueFrom:
+ secretKeyRef:
+ name: {{ template "mysql.secretName" . }}
+ key: mysql-root-password
+ {{- end }}
+ {{- if not (empty .Values.auth.username) }}
+ - name: MYSQL_USER
+ value: {{ .Values.auth.username | quote }}
+ {{- if .Values.auth.usePasswordFiles }}
+ - name: MYSQL_PASSWORD_FILE
+ value: {{ default "/opt/bitnami/mysql/secrets/mysql-password" .Values.auth.customPasswordFiles.user }}
+ {{- else }}
+ - name: MYSQL_PASSWORD
+ valueFrom:
+ secretKeyRef:
+ name: {{ template "mysql.secretName" . }}
+ key: mysql-password
+ {{- end }}
+ {{- end }}
+ - name: MYSQL_DATABASE
+ value: {{ .Values.auth.database | quote }}
+ {{- if eq .Values.architecture "replication" }}
+ - name: MYSQL_REPLICATION_MODE
+ value: "master"
+ - name: MYSQL_REPLICATION_USER
+ value: {{ .Values.auth.replicationUser | quote }}
+ {{- if .Values.auth.usePasswordFiles }}
+ - name: MYSQL_REPLICATION_PASSWORD_FILE
+ value: {{ default "/opt/bitnami/mysql/secrets/mysql-replication-password" .Values.auth.customPasswordFiles.replicator }}
+ {{- else }}
+ - name: MYSQL_REPLICATION_PASSWORD
+ valueFrom:
+ secretKeyRef:
+ name: {{ template "mysql.secretName" . }}
+ key: mysql-replication-password
+ {{- end }}
+ {{- end }}
+ {{- if .Values.primary.extraFlags }}
+ - name: MYSQL_EXTRA_FLAGS
+ value: "{{ .Values.primary.extraFlags }}"
+ {{- end }}
+ {{- if .Values.primary.extraEnvVars }}
+ {{- include "common.tplvalues.render" (dict "value" .Values.primary.extraEnvVars "context" $) | nindent 12 }}
+ {{- end }}
+ {{- if or .Values.primary.extraEnvVarsCM .Values.primary.extraEnvVarsSecret }}
+ envFrom:
+ {{- if .Values.primary.extraEnvVarsCM }}
+ - configMapRef:
+ name: {{ .Values.primary.extraEnvVarsCM }}
+ {{- end }}
+ {{- if .Values.primary.extraEnvVarsSecret }}
+ - secretRef:
+ name: {{ .Values.primary.extraEnvVarsSecret }}
+ {{- end }}
+ {{- end }}
+ ports:
+ - name: mysql
+ containerPort: 3306
+ {{- if not .Values.diagnosticMode.enabled }}
+ {{- if .Values.primary.livenessProbe.enabled }}
+ livenessProbe: {{- omit .Values.primary.livenessProbe "enabled" | toYaml | nindent 12 }}
+ exec:
+ command:
+ - /bin/bash
+ - -ec
+ - |
+ password_aux="${MYSQL_ROOT_PASSWORD:-}"
+ if [[ -f "${MYSQL_ROOT_PASSWORD_FILE:-}" ]]; then
+ password_aux=$(cat "$MYSQL_ROOT_PASSWORD_FILE")
+ fi
+ mysqladmin status -uroot -p"${password_aux}"
+ {{- else if .Values.primary.customLivenessProbe }}
+ livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.primary.customLivenessProbe "context" $) | nindent 12 }}
+ {{- end }}
+ {{- if .Values.primary.readinessProbe.enabled }}
+ readinessProbe: {{- omit .Values.primary.readinessProbe "enabled" | toYaml | nindent 12 }}
+ exec:
+ command:
+ - /bin/bash
+ - -ec
+ - |
+ password_aux="${MYSQL_ROOT_PASSWORD:-}"
+ if [[ -f "${MYSQL_ROOT_PASSWORD_FILE:-}" ]]; then
+ password_aux=$(cat "$MYSQL_ROOT_PASSWORD_FILE")
+ fi
+ mysqladmin status -uroot -p"${password_aux}"
+ {{- else if .Values.primary.customReadinessProbe }}
+ readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.primary.customReadinessProbe "context" $) | nindent 12 }}
+ {{- end }}
+ {{- if .Values.primary.startupProbe.enabled }}
+ startupProbe: {{- omit .Values.primary.startupProbe "enabled" | toYaml | nindent 12 }}
+ exec:
+ command:
+ - /bin/bash
+ - -ec
+ - |
+ password_aux="${MYSQL_ROOT_PASSWORD:-}"
+ if [[ -f "${MYSQL_ROOT_PASSWORD_FILE:-}" ]]; then
+ password_aux=$(cat "$MYSQL_ROOT_PASSWORD_FILE")
+ fi
+ mysqladmin status -uroot -p"${password_aux}"
+ {{- else if .Values.primary.customStartupProbe }}
+ startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.primary.customStartupProbe "context" $) | nindent 12 }}
+ {{- end }}
+ {{- end }}
+ {{- if .Values.primary.resources }}
+ resources: {{ toYaml .Values.primary.resources | nindent 12 }}
+ {{- end }}
+ volumeMounts:
+ - name: data
+ mountPath: /bitnami/mysql
+ {{- if or .Values.initdbScriptsConfigMap .Values.initdbScripts }}
+ - name: custom-init-scripts
+ mountPath: /docker-entrypoint-initdb.d
+ {{- end }}
+ {{- if or .Values.primary.configuration .Values.primary.existingConfigmap }}
+ - name: config
+ mountPath: /opt/bitnami/mysql/conf/my.cnf
+ subPath: my.cnf
+ {{- end }}
+ {{- if and .Values.auth.usePasswordFiles (not .Values.auth.customPasswordFiles) }}
+ - name: mysql-credentials
+ mountPath: /opt/bitnami/mysql/secrets/
+ {{- end }}
+ {{- if .Values.primary.extraVolumeMounts }}
+ {{- include "common.tplvalues.render" (dict "value" .Values.primary.extraVolumeMounts "context" $) | nindent 12 }}
+ {{- end }}
+ {{- if .Values.metrics.enabled }}
+ - name: metrics
+ image: {{ include "mysql.metrics.image" . }}
+ imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }}
+ env:
+ {{- if .Values.auth.usePasswordFiles }}
+ - name: MYSQL_ROOT_PASSWORD_FILE
+ value: {{ default "/opt/bitnami/mysqld-exporter/secrets/mysql-root-password" .Values.auth.customPasswordFiles.root }}
+ {{- else }}
+ - name: MYSQL_ROOT_PASSWORD
+ valueFrom:
+ secretKeyRef:
+ name: {{ include "mysql.secretName" . }}
+ key: mysql-root-password
+ {{- end }}
+ {{- if .Values.diagnosticMode.enabled }}
+ command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
+ args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
+ {{- else }}
+ command:
+ - /bin/bash
+ - -ec
+ - |
+ password_aux="${MYSQL_ROOT_PASSWORD:-}"
+ if [[ -f "${MYSQL_ROOT_PASSWORD_FILE:-}" ]]; then
+ password_aux=$(cat "$MYSQL_ROOT_PASSWORD_FILE")
+ fi
+ DATA_SOURCE_NAME="root:${password_aux}@(localhost:3306)/" /bin/mysqld_exporter {{- range .Values.metrics.extraArgs.primary }} {{ . }} {{- end }}
+ {{- end }}
+ ports:
+ - name: metrics
+ containerPort: 9104
+ {{- if not .Values.diagnosticMode.enabled }}
+ {{- if .Values.metrics.livenessProbe.enabled }}
+ livenessProbe: {{- omit .Values.metrics.livenessProbe "enabled" | toYaml | nindent 12 }}
+ httpGet:
+ path: /metrics
+ port: metrics
+ {{- end }}
+ {{- if .Values.metrics.readinessProbe.enabled }}
+ readinessProbe: {{- omit .Values.metrics.readinessProbe "enabled" | toYaml | nindent 12 }}
+ httpGet:
+ path: /metrics
+ port: metrics
+ {{- end }}
+ {{- end }}
+ {{- if .Values.metrics.resources }}
+ resources: {{- toYaml .Values.metrics.resources | nindent 12 }}
+ {{- end }}
+ {{- if and .Values.auth.usePasswordFiles (not .Values.auth.customPasswordFiles) }}
+ volumeMounts:
+ - name: mysql-credentials
+ mountPath: /opt/bitnami/mysqld-exporter/secrets/
+ {{- end }}
+ {{- end }}
+ {{- if .Values.primary.sidecars }}
+ {{- include "common.tplvalues.render" (dict "value" .Values.primary.sidecars "context" $) | nindent 8 }}
+ {{- end }}
+ volumes:
+ {{- if or .Values.primary.configuration .Values.primary.existingConfigmap }}
+ - name: config
+ configMap:
+ name: {{ include "mysql.primary.configmapName" . }}
+ {{- end }}
+ {{- if or .Values.initdbScriptsConfigMap .Values.initdbScripts }}
+ - name: custom-init-scripts
+ configMap:
+ name: {{ include "mysql.initdbScriptsCM" . }}
+ {{- end }}
+ {{- if and .Values.auth.usePasswordFiles (not .Values.auth.customPasswordFiles) }}
+ - name: mysql-credentials
+ secret:
+ secretName: {{ include "mysql.secretName" . }}
+ items:
+ - key: mysql-root-password
+ path: mysql-root-password
+ - key: mysql-password
+ path: mysql-password
+ {{- if eq .Values.architecture "replication" }}
+ - key: mysql-replication-password
+ path: mysql-replication-password
+ {{- end }}
+ {{- end }}
+ {{- if .Values.primary.extraVolumes }}
+ {{- include "common.tplvalues.render" (dict "value" .Values.primary.extraVolumes "context" $) | nindent 8 }}
+ {{- end }}
+ {{- if and .Values.primary.persistence.enabled .Values.primary.persistence.existingClaim }}
+ - name: data
+ persistentVolumeClaim:
+ claimName: {{ tpl .Values.primary.persistence.existingClaim . }}
+ {{- else if not .Values.primary.persistence.enabled }}
+ - name: data
+ emptyDir: {}
+ {{- else if and .Values.primary.persistence.enabled (not .Values.primary.persistence.existingClaim) }}
+ volumeClaimTemplates:
+ - metadata:
+ name: data
+ labels: {{ include "common.labels.matchLabels" . | nindent 10 }}
+ app.kubernetes.io/component: primary
+ {{- if .Values.primary.persistence.annotations }}
+ annotations:
+ {{- toYaml .Values.primary.persistence.annotations | nindent 10 }}
+ {{- end }}
+ spec:
+ accessModes:
+ {{- range .Values.primary.persistence.accessModes }}
+ - {{ . | quote }}
+ {{- end }}
+ resources:
+ requests:
+ storage: {{ .Values.primary.persistence.size | quote }}
+ {{ include "common.storage.class" (dict "persistence" .Values.primary.persistence "global" .Values.global) }}
+ {{- if .Values.primary.persistence.selector }}
+ selector: {{- include "common.tplvalues.render" (dict "value" .Values.primary.persistence.selector "context" $) | nindent 10 }}
+ {{- end -}}
+ {{- end }}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/primary/svc-headless.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/primary/svc-headless.yaml
new file mode 100644
index 0000000..49e6e57
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/primary/svc-headless.yaml
@@ -0,0 +1,24 @@
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ include "mysql.primary.fullname" . }}-headless
+ namespace: {{ .Release.Namespace }}
+ labels: {{- include "common.labels.standard" . | nindent 4 }}
+ app.kubernetes.io/component: primary
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ annotations:
+ {{- if .Values.commonAnnotations }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+spec:
+ type: ClusterIP
+ clusterIP: None
+ publishNotReadyAddresses: true
+ ports:
+ - name: mysql
+ port: {{ .Values.primary.service.port }}
+ targetPort: mysql
+ selector: {{ include "common.labels.matchLabels" . | nindent 4 }}
+ app.kubernetes.io/component: primary
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/primary/svc.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/primary/svc.yaml
new file mode 100644
index 0000000..b46e6fa
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/primary/svc.yaml
@@ -0,0 +1,41 @@
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ include "mysql.primary.fullname" . }}
+ namespace: {{ .Release.Namespace }}
+ labels: {{- include "common.labels.standard" . | nindent 4 }}
+ app.kubernetes.io/component: primary
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ annotations:
+ {{- if .Values.commonAnnotations }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- if .Values.primary.service.annotations }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.primary.service.annotations "context" $ ) | nindent 4 }}
+ {{- end }}
+spec:
+ type: {{ .Values.primary.service.type }}
+ {{- if and (eq .Values.primary.service.type "ClusterIP") .Values.primary.service.clusterIP }}
+ clusterIP: {{ .Values.primary.service.clusterIP }}
+ {{- end }}
+ {{- if and .Values.primary.service.loadBalancerIP (eq .Values.primary.service.type "LoadBalancer") }}
+ loadBalancerIP: {{ .Values.primary.service.loadBalancerIP }}
+ externalTrafficPolicy: {{ .Values.primary.service.externalTrafficPolicy | quote }}
+ {{- end }}
+ {{- if and (eq .Values.primary.service.type "LoadBalancer") .Values.primary.service.loadBalancerSourceRanges }}
+ loadBalancerSourceRanges: {{- toYaml .Values.primary.service.loadBalancerSourceRanges | nindent 4 }}
+ {{- end }}
+ ports:
+ - name: mysql
+ port: {{ .Values.primary.service.port }}
+ protocol: TCP
+ targetPort: mysql
+ {{- if (and (or (eq .Values.primary.service.type "NodePort") (eq .Values.primary.service.type "LoadBalancer")) .Values.primary.service.nodePort) }}
+ nodePort: {{ .Values.primary.service.nodePort }}
+ {{- else if eq .Values.primary.service.type "ClusterIP" }}
+ nodePort: null
+ {{- end }}
+ selector: {{ include "common.labels.matchLabels" . | nindent 4 }}
+ app.kubernetes.io/component: primary
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/role.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/role.yaml
new file mode 100644
index 0000000..4cbdd5c
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/role.yaml
@@ -0,0 +1,21 @@
+{{- if and .Values.serviceAccount.create .Values.rbac.create }}
+apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }}
+kind: Role
+metadata:
+ name: {{ include "common.names.fullname" . }}
+ namespace: {{ .Release.Namespace }}
+ labels: {{- include "common.labels.standard" . | nindent 4 }}
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- if .Values.commonAnnotations }}
+ annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+rules:
+ - apiGroups:
+ - ""
+ resources:
+ - endpoints
+ verbs:
+ - get
+{{- end }}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/rolebinding.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/rolebinding.yaml
new file mode 100644
index 0000000..90ede32
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/rolebinding.yaml
@@ -0,0 +1,21 @@
+{{- if and .Values.serviceAccount.create .Values.rbac.create }}
+kind: RoleBinding
+apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }}
+metadata:
+ name: {{ include "common.names.fullname" . }}
+ namespace: {{ .Release.Namespace }}
+ labels: {{- include "common.labels.standard" . | nindent 4 }}
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- if .Values.commonAnnotations }}
+ annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+subjects:
+ - kind: ServiceAccount
+ name: {{ include "mysql.serviceAccountName" . }}
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: Role
+ name: {{ include "common.names.fullname" . -}}
+{{- end }}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/secondary/configmap.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/secondary/configmap.yaml
new file mode 100644
index 0000000..682e3e1
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/secondary/configmap.yaml
@@ -0,0 +1,18 @@
+{{- if (include "mysql.secondary.createConfigmap" .) }}
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: {{ include "mysql.secondary.fullname" . }}
+ namespace: {{ .Release.Namespace }}
+ labels: {{- include "common.labels.standard" . | nindent 4 }}
+ app.kubernetes.io/component: secondary
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- if .Values.commonAnnotations }}
+ annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+data:
+ my.cnf: |-
+ {{ .Values.secondary.configuration | nindent 4 }}
+{{- end -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/secondary/pdb.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/secondary/pdb.yaml
new file mode 100644
index 0000000..49c7e16
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/secondary/pdb.yaml
@@ -0,0 +1,25 @@
+{{- if and (eq .Values.architecture "replication") .Values.secondary.pdb.enabled }}
+apiVersion: {{ include "common.capabilities.policy.apiVersion" . }}
+kind: PodDisruptionBudget
+metadata:
+ name: {{ include "mysql.secondary.fullname" . }}
+ namespace: {{ .Release.Namespace }}
+ labels: {{- include "common.labels.standard" . | nindent 4 }}
+ app.kubernetes.io/component: secondary
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- if .Values.commonAnnotations }}
+ annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+spec:
+ {{- if .Values.secondary.pdb.minAvailable }}
+ minAvailable: {{ .Values.secondary.pdb.minAvailable }}
+ {{- end }}
+ {{- if .Values.secondary.pdb.maxUnavailable }}
+ maxUnavailable: {{ .Values.secondary.pdb.maxUnavailable }}
+ {{- end }}
+ selector:
+ matchLabels: {{ include "common.labels.matchLabels" . | nindent 6 }}
+ app.kubernetes.io/component: secondary
+{{- end }}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/secondary/statefulset.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/secondary/statefulset.yaml
new file mode 100644
index 0000000..ef196eb
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/secondary/statefulset.yaml
@@ -0,0 +1,338 @@
+{{- if eq .Values.architecture "replication" }}
+apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }}
+kind: StatefulSet
+metadata:
+ name: {{ include "mysql.secondary.fullname" . }}
+ namespace: {{ .Release.Namespace }}
+ labels: {{- include "common.labels.standard" . | nindent 4 }}
+ app.kubernetes.io/component: secondary
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- if .Values.secondary.podLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.secondary.podLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- if .Values.commonAnnotations }}
+ annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+spec:
+ replicas: {{ .Values.secondary.replicaCount }}
+ selector:
+ matchLabels: {{ include "common.labels.matchLabels" . | nindent 6 }}
+ app.kubernetes.io/component: secondary
+ serviceName: {{ include "mysql.secondary.fullname" . }}
+ updateStrategy:
+ type: {{ .Values.secondary.updateStrategy }}
+ {{- if (eq "Recreate" .Values.secondary.updateStrategy) }}
+ rollingUpdate: null
+ {{- else if .Values.secondary.rollingUpdatePartition }}
+ rollingUpdate:
+ partition: {{ .Values.secondary.rollingUpdatePartition }}
+ {{- end }}
+ template:
+ metadata:
+ annotations:
+ {{- if (include "mysql.secondary.createConfigmap" .) }}
+ checksum/configuration: {{ include (print $.Template.BasePath "/secondary/configmap.yaml") . | sha256sum }}
+ {{- end }}
+ {{- if .Values.secondary.podAnnotations }}
+ {{- include "common.tplvalues.render" (dict "value" .Values.secondary.podAnnotations "context" $) | nindent 8 }}
+ {{- end }}
+ labels: {{- include "common.labels.standard" . | nindent 8 }}
+ app.kubernetes.io/component: secondary
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 8 }}
+ {{- end }}
+ {{- if .Values.secondary.podLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.secondary.podLabels "context" $ ) | nindent 8 }}
+ {{- end }}
+ spec:
+ {{- include "mysql.imagePullSecrets" . | nindent 6 }}
+ {{- if .Values.secondary.hostAliases }}
+ hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.hostAliases "context" $) | nindent 8 }}
+ {{- end }}
+ {{- if .Values.schedulerName }}
+ schedulerName: {{ .Values.schedulerName | quote }}
+ {{- end }}
+ serviceAccountName: {{ include "mysql.serviceAccountName" . }}
+ {{- if .Values.secondary.affinity }}
+ affinity: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.affinity "context" $) | nindent 8 }}
+ {{- else }}
+ affinity:
+ podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.secondary.podAffinityPreset "component" "secondary" "context" $) | nindent 10 }}
+ podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.secondary.podAntiAffinityPreset "component" "secondary" "context" $) | nindent 10 }}
+ nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.secondary.nodeAffinityPreset.type "key" .Values.secondary.nodeAffinityPreset.key "values" .Values.secondary.nodeAffinityPreset.values) | nindent 10 }}
+ {{- end }}
+ {{- if .Values.secondary.nodeSelector }}
+ nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.nodeSelector "context" $) | nindent 8 }}
+ {{- end }}
+ {{- if .Values.secondary.tolerations }}
+ tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.tolerations "context" $) | nindent 8 }}
+ {{- end }}
+ {{- if .Values.priorityClassName }}
+ priorityClassName: {{ .Values.priorityClassName | quote }}
+ {{- end }}
+ {{- if .Values.secondary.podSecurityContext.enabled }}
+ securityContext: {{- omit .Values.secondary.podSecurityContext "enabled" | toYaml | nindent 8 }}
+ {{- end }}
+ {{- if or .Values.secondary.initContainers (and .Values.secondary.podSecurityContext.enabled .Values.volumePermissions.enabled .Values.secondary.persistence.enabled) }}
+ initContainers:
+ {{- if .Values.secondary.initContainers }}
+ {{- include "common.tplvalues.render" (dict "value" .Values.secondary.initContainers "context" $) | nindent 8 }}
+ {{- end }}
+ {{- if and .Values.secondary.podSecurityContext.enabled .Values.volumePermissions.enabled .Values.secondary.persistence.enabled }}
+ - name: volume-permissions
+ image: {{ include "mysql.volumePermissions.image" . }}
+ imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }}
+ command:
+ - /bin/bash
+ - -ec
+ - |
+ chown -R {{ .Values.secondary.containerSecurityContext.runAsUser }}:{{ .Values.secondary.podSecurityContext.fsGroup }} /bitnami/mysql
+ securityContext:
+ runAsUser: 0
+ {{- if .Values.volumePermissions.resources }}
+ resources: {{- toYaml .Values.volumePermissions.resources | nindent 12 }}
+ {{- end }}
+ volumeMounts:
+ - name: data
+ mountPath: /bitnami/mysql
+ {{- end }}
+ {{- end }}
+ containers:
+ - name: mysql
+ image: {{ include "mysql.image" . }}
+ imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
+ {{- if .Values.secondary.containerSecurityContext.enabled }}
+ securityContext: {{- omit .Values.secondary.containerSecurityContext "enabled" | toYaml | nindent 12 }}
+ {{- end }}
+ {{- if .Values.diagnosticMode.enabled }}
+ command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
+ {{- else if .Values.secondary.command }}
+ command: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.command "context" $) | nindent 12 }}
+ {{- end }}
+ {{- if .Values.diagnosticMode.enabled }}
+ args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
+ {{- else if .Values.secondary.args }}
+ args: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.args "context" $) | nindent 12 }}
+ {{- end }}
+ env:
+ - name: BITNAMI_DEBUG
+ value: {{ ternary "true" "false" (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }}
+ - name: MYSQL_REPLICATION_MODE
+ value: "slave"
+ - name: MYSQL_MASTER_HOST
+ value: {{ include "mysql.primary.fullname" . }}
+ - name: MYSQL_MASTER_PORT_NUMBER
+ value: {{ .Values.primary.service.port | quote }}
+ - name: MYSQL_MASTER_ROOT_USER
+ value: "root"
+ - name: MYSQL_REPLICATION_USER
+ value: {{ .Values.auth.replicationUser | quote }}
+ {{- if .Values.auth.usePasswordFiles }}
+ - name: MYSQL_MASTER_ROOT_PASSWORD_FILE
+ value: {{ default "/opt/bitnami/mysql/secrets/mysql-root-password" .Values.auth.customPasswordFiles.root }}
+ - name: MYSQL_REPLICATION_PASSWORD_FILE
+ value: {{ default "/opt/bitnami/mysql/secrets/mysql-replication-password" .Values.auth.customPasswordFiles.replicator }}
+ {{- else }}
+ - name: MYSQL_MASTER_ROOT_PASSWORD
+ valueFrom:
+ secretKeyRef:
+ name: {{ template "mysql.secretName" . }}
+ key: mysql-root-password
+ - name: MYSQL_REPLICATION_PASSWORD
+ valueFrom:
+ secretKeyRef:
+ name: {{ template "mysql.secretName" . }}
+ key: mysql-replication-password
+ {{- end }}
+ {{- if .Values.secondary.extraFlags }}
+ - name: MYSQL_EXTRA_FLAGS
+ value: "{{ .Values.secondary.extraFlags }}"
+ {{- end }}
+ {{- if .Values.secondary.extraEnvVars }}
+ {{- include "common.tplvalues.render" (dict "value" .Values.secondary.extraEnvVars "context" $) | nindent 12 }}
+ {{- end }}
+ {{- if or .Values.secondary.extraEnvVarsCM .Values.secondary.extraEnvVarsSecret }}
+ envFrom:
+ {{- if .Values.secondary.extraEnvVarsCM }}
+ - configMapRef:
+ name: {{ .Values.secondary.extraEnvVarsCM }}
+ {{- end }}
+ {{- if .Values.secondary.extraEnvVarsSecret }}
+ - secretRef:
+ name: {{ .Values.secondary.extraEnvVarsSecret }}
+ {{- end }}
+ {{- end }}
+ ports:
+ - name: mysql
+ containerPort: 3306
+ {{- if not .Values.diagnosticMode.enabled }}
+ {{- if .Values.secondary.livenessProbe.enabled }}
+ livenessProbe: {{- omit .Values.secondary.livenessProbe "enabled" | toYaml | nindent 12 }}
+ exec:
+ command:
+ - /bin/bash
+ - -ec
+ - |
+ password_aux="${MYSQL_MASTER_ROOT_PASSWORD:-}"
+ if [[ -f "${MYSQL_MASTER_ROOT_PASSWORD_FILE:-}" ]]; then
+ password_aux=$(cat "$MYSQL_MASTER_ROOT_PASSWORD_FILE")
+ fi
+ mysqladmin status -uroot -p"${password_aux}"
+ {{- else if .Values.secondary.customLivenessProbe }}
+ livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.customLivenessProbe "context" $) | nindent 12 }}
+ {{- end }}
+ {{- if .Values.secondary.readinessProbe.enabled }}
+ readinessProbe: {{- omit .Values.secondary.readinessProbe "enabled" | toYaml | nindent 12 }}
+ exec:
+ command:
+ - /bin/bash
+ - -ec
+ - |
+ password_aux="${MYSQL_MASTER_ROOT_PASSWORD:-}"
+ if [[ -f "${MYSQL_MASTER_ROOT_PASSWORD_FILE:-}" ]]; then
+ password_aux=$(cat "$MYSQL_MASTER_ROOT_PASSWORD_FILE")
+ fi
+ mysqladmin status -uroot -p"${password_aux}"
+ {{- else if .Values.secondary.customReadinessProbe }}
+ readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.customReadinessProbe "context" $) | nindent 12 }}
+ {{- end }}
+ {{- if .Values.secondary.startupProbe.enabled }}
+ startupProbe: {{- omit .Values.secondary.startupProbe "enabled" | toYaml | nindent 12 }}
+ exec:
+ command:
+ - /bin/bash
+ - -ec
+ - |
+ password_aux="${MYSQL_MASTER_ROOT_PASSWORD:-}"
+ if [[ -f "${MYSQL_MASTER_ROOT_PASSWORD_FILE:-}" ]]; then
+ password_aux=$(cat "$MYSQL_MASTER_ROOT_PASSWORD_FILE")
+ fi
+ mysqladmin status -uroot -p"${password_aux}"
+ {{- else if .Values.secondary.customStartupProbe }}
+ startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.customStartupProbe "context" $) | nindent 12 }}
+ {{- end }}
+ {{- end }}
+ {{- if .Values.secondary.resources }}
+ resources: {{ toYaml .Values.secondary.resources | nindent 12 }}
+ {{- end }}
+ volumeMounts:
+ - name: data
+ mountPath: /bitnami/mysql
+ {{- if or .Values.secondary.configuration .Values.secondary.existingConfigmap }}
+ - name: config
+ mountPath: /opt/bitnami/mysql/conf/my.cnf
+ subPath: my.cnf
+ {{- end }}
+ {{- if and .Values.auth.usePasswordFiles (not .Values.auth.customPasswordFiles) }}
+ - name: mysql-credentials
+ mountPath: /opt/bitnami/mysql/secrets/
+ {{- end }}
+ {{- if .Values.secondary.extraVolumeMounts }}
+ {{- include "common.tplvalues.render" (dict "value" .Values.secondary.extraVolumeMounts "context" $) | nindent 12 }}
+ {{- end }}
+ {{- if .Values.metrics.enabled }}
+ - name: metrics
+ image: {{ include "mysql.metrics.image" . }}
+ imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }}
+ env:
+ {{- if .Values.auth.usePasswordFiles }}
+ - name: MYSQL_ROOT_PASSWORD_FILE
+ value: {{ default "/opt/bitnami/mysqld-exporter/secrets/mysql-root-password" .Values.auth.customPasswordFiles.root }}
+ {{- else }}
+ - name: MYSQL_ROOT_PASSWORD
+ valueFrom:
+ secretKeyRef:
+ name: {{ template "mysql.secretName" . }}
+ key: mysql-root-password
+ {{- end }}
+ {{- if .Values.diagnosticMode.enabled }}
+ command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
+ args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
+ {{- else }}
+ command:
+ - /bin/bash
+ - -ec
+ - |
+ password_aux="${MYSQL_ROOT_PASSWORD:-}"
+ if [[ -f "${MYSQL_ROOT_PASSWORD_FILE:-}" ]]; then
+ password_aux=$(cat "$MYSQL_ROOT_PASSWORD_FILE")
+ fi
+ DATA_SOURCE_NAME="root:${password_aux}@(localhost:3306)/" /bin/mysqld_exporter {{- range .Values.metrics.extraArgs.secondary }} {{ . }} {{- end }}
+ {{- end }}
+ ports:
+ - name: metrics
+ containerPort: 9104
+ {{- if not .Values.diagnosticMode.enabled }}
+ {{- if .Values.metrics.livenessProbe.enabled }}
+ livenessProbe: {{- omit .Values.metrics.livenessProbe "enabled" | toYaml | nindent 12 }}
+ httpGet:
+ path: /metrics
+ port: metrics
+ {{- end }}
+ {{- if .Values.metrics.readinessProbe.enabled }}
+ readinessProbe: {{- omit .Values.metrics.readinessProbe "enabled" | toYaml | nindent 12 }}
+ httpGet:
+ path: /metrics
+ port: metrics
+ {{- end }}
+ {{- end }}
+ {{- if .Values.metrics.resources }}
+ resources: {{- toYaml .Values.metrics.resources | nindent 12 }}
+ {{- end }}
+ {{- if and .Values.auth.usePasswordFiles (not .Values.auth.customPasswordFiles) }}
+ volumeMounts:
+ - name: mysql-credentials
+ mountPath: /opt/bitnami/mysqld-exporter/secrets/
+ {{- end }}
+ {{- end }}
+ {{- if .Values.secondary.sidecars }}
+ {{- include "common.tplvalues.render" (dict "value" .Values.secondary.sidecars "context" $) | nindent 8 }}
+ {{- end }}
+ volumes:
+ {{- if or .Values.secondary.configuration .Values.secondary.existingConfigmap }}
+ - name: config
+ configMap:
+ name: {{ include "mysql.secondary.configmapName" . }}
+ {{- end }}
+ {{- if and .Values.auth.usePasswordFiles (not .Values.auth.customPasswordFiles) }}
+ - name: mysql-credentials
+ secret:
+ secretName: {{ template "mysql.secretName" . }}
+ items:
+ - key: mysql-root-password
+ path: mysql-root-password
+ - key: mysql-replication-password
+ path: mysql-replication-password
+ {{- end }}
+ {{- if .Values.secondary.extraVolumes }}
+ {{- include "common.tplvalues.render" (dict "value" .Values.secondary.extraVolumes "context" $) | nindent 8 }}
+ {{- end }}
+ {{- if not .Values.secondary.persistence.enabled }}
+ - name: data
+ emptyDir: {}
+ {{- else }}
+ volumeClaimTemplates:
+ - metadata:
+ name: data
+ labels: {{ include "common.labels.matchLabels" . | nindent 10 }}
+ app.kubernetes.io/component: secondary
+ {{- if .Values.secondary.persistence.annotations }}
+ annotations:
+ {{- toYaml .Values.secondary.persistence.annotations | nindent 10 }}
+ {{- end }}
+ spec:
+ accessModes:
+ {{- range .Values.secondary.persistence.accessModes }}
+ - {{ . | quote }}
+ {{- end }}
+ resources:
+ requests:
+ storage: {{ .Values.secondary.persistence.size | quote }}
+ {{ include "common.storage.class" (dict "persistence" .Values.secondary.persistence "global" .Values.global) }}
+ {{- if .Values.secondary.persistence.selector }}
+ selector: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.persistence.selector "context" $) | nindent 10 }}
+ {{- end -}}
+ {{- end }}
+{{- end }}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/secondary/svc-headless.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/secondary/svc-headless.yaml
new file mode 100644
index 0000000..703d8e7
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/secondary/svc-headless.yaml
@@ -0,0 +1,26 @@
+{{- if eq .Values.architecture "replication" }}
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ include "mysql.secondary.fullname" . }}-headless
+ namespace: {{ .Release.Namespace }}
+ labels: {{- include "common.labels.standard" . | nindent 4 }}
+ app.kubernetes.io/component: secondary
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ annotations:
+ {{- if .Values.commonAnnotations }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+spec:
+ type: ClusterIP
+ clusterIP: None
+ publishNotReadyAddresses: true
+ ports:
+ - name: mysql
+ port: {{ .Values.secondary.service.port }}
+ targetPort: mysql
+ selector: {{ include "common.labels.matchLabels" . | nindent 4 }}
+ app.kubernetes.io/component: secondary
+{{- end }}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/secondary/svc.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/secondary/svc.yaml
new file mode 100644
index 0000000..74a4c6e
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/secondary/svc.yaml
@@ -0,0 +1,43 @@
+{{- if eq .Values.architecture "replication" }}
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ include "mysql.secondary.fullname" . }}
+ namespace: {{ .Release.Namespace }}
+ labels: {{- include "common.labels.standard" . | nindent 4 }}
+ app.kubernetes.io/component: secondary
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ annotations:
+ {{- if .Values.commonAnnotations }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- if .Values.secondary.service.annotations }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.secondary.service.annotations "context" $ ) | nindent 4 }}
+ {{- end }}
+spec:
+ type: {{ .Values.secondary.service.type }}
+ {{- if and (eq .Values.secondary.service.type "ClusterIP") .Values.secondary.service.clusterIP }}
+ clusterIP: {{ .Values.secondary.service.clusterIP }}
+ {{- end }}
+ {{- if and .Values.secondary.service.loadBalancerIP (eq .Values.secondary.service.type "LoadBalancer") }}
+ loadBalancerIP: {{ .Values.secondary.service.loadBalancerIP }}
+ externalTrafficPolicy: {{ .Values.secondary.service.externalTrafficPolicy | quote }}
+ {{- end }}
+ {{- if and (eq .Values.secondary.service.type "LoadBalancer") .Values.secondary.service.loadBalancerSourceRanges }}
+ loadBalancerSourceRanges: {{- toYaml .Values.secondary.service.loadBalancerSourceRanges | nindent 4 }}
+ {{- end }}
+ ports:
+ - name: mysql
+ port: {{ .Values.secondary.service.port }}
+ protocol: TCP
+ targetPort: mysql
+ {{- if (and (or (eq .Values.secondary.service.type "NodePort") (eq .Values.secondary.service.type "LoadBalancer")) .Values.secondary.service.nodePort) }}
+ nodePort: {{ .Values.secondary.service.nodePort }}
+ {{- else if eq .Values.secondary.service.type "ClusterIP" }}
+ nodePort: null
+ {{- end }}
+ selector: {{ include "common.labels.matchLabels" . | nindent 4 }}
+ app.kubernetes.io/component: secondary
+{{- end }}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/secrets.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/secrets.yaml
new file mode 100644
index 0000000..9412fc3
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/secrets.yaml
@@ -0,0 +1,21 @@
+{{- if eq (include "mysql.createSecret" .) "true" }}
+apiVersion: v1
+kind: Secret
+metadata:
+ name: {{ include "common.names.fullname" . }}
+ namespace: {{ .Release.Namespace }}
+ labels: {{- include "common.labels.standard" . | nindent 4 }}
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- if .Values.commonAnnotations }}
+ annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+type: Opaque
+data:
+ mysql-root-password: {{ include "mysql.root.password" . | b64enc | quote }}
+ mysql-password: {{ include "mysql.password" . | b64enc | quote }}
+ {{- if eq .Values.architecture "replication" }}
+ mysql-replication-password: {{ include "mysql.replication.password" . | b64enc | quote }}
+ {{- end }}
+{{- end }}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/serviceaccount.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/serviceaccount.yaml
new file mode 100644
index 0000000..59eb104
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/serviceaccount.yaml
@@ -0,0 +1,22 @@
+{{- if .Values.serviceAccount.create }}
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+ name: {{ include "mysql.serviceAccountName" . }}
+ namespace: {{ .Release.Namespace }}
+ labels: {{- include "common.labels.standard" . | nindent 4 }}
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ annotations:
+ {{- if .Values.serviceAccount.annotations }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.serviceAccount.annotations "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- if .Values.commonAnnotations }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+{{- if (not .Values.auth.customPasswordFiles) }}
+secrets:
+ - name: {{ template "mysql.secretName" . }}
+{{- end }}
+{{- end }}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/servicemonitor.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/servicemonitor.yaml
new file mode 100644
index 0000000..f082dd5
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/templates/servicemonitor.yaml
@@ -0,0 +1,42 @@
+{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }}
+apiVersion: monitoring.coreos.com/v1
+kind: ServiceMonitor
+metadata:
+ name: {{ include "common.names.fullname" . }}
+ {{- if .Values.metrics.serviceMonitor.namespace }}
+ namespace: {{ .Values.metrics.serviceMonitor.namespace }}
+ {{- else }}
+ namespace: {{ .Release.Namespace }}
+ {{- end }}
+ labels: {{- include "common.labels.standard" . | nindent 4 }}
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- if .Values.metrics.serviceMonitor.additionalLabels }}
+ {{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.additionalLabels "context" $) | nindent 4 }}
+ {{- end }}
+ {{- if .Values.commonAnnotations }}
+ annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+spec:
+ endpoints:
+ - port: metrics
+ {{- if .Values.metrics.serviceMonitor.interval }}
+ interval: {{ .Values.metrics.serviceMonitor.interval }}
+ {{- end }}
+ {{- if .Values.metrics.serviceMonitor.scrapeTimeout }}
+ scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }}
+ {{- end }}
+ {{- if .Values.metrics.serviceMonitor.honorLabels }}
+ honorLabels: {{ .Values.metrics.serviceMonitor.honorLabels }}
+ {{- end }}
+ {{- if .Values.metrics.serviceMonitor.relabellings }}
+ metricRelabelings: {{- toYaml .Values.metrics.serviceMonitor.relabellings | nindent 6 }}
+ {{- end }}
+ namespaceSelector:
+ matchNames:
+ - {{ .Release.Namespace }}
+ selector:
+ matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
+ app.kubernetes.io/component: metrics
+{{- end }}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/values.schema.json b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/values.schema.json
new file mode 100644
index 0000000..8021a46
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/values.schema.json
@@ -0,0 +1,178 @@
+{
+ "$schema": "http://json-schema.org/schema#",
+ "type": "object",
+ "properties": {
+ "architecture": {
+ "type": "string",
+ "title": "MySQL architecture",
+ "form": true,
+ "description": "Allowed values: `standalone` or `replication`",
+ "enum": ["standalone", "replication"]
+ },
+ "auth": {
+ "type": "object",
+ "title": "Authentication configuration",
+ "form": true,
+ "required": ["database", "username", "password"],
+ "properties": {
+ "rootPassword": {
+ "type": "string",
+ "title": "MySQL root password",
+ "description": "Defaults to a random 10-character alphanumeric string if not set"
+ },
+ "database": {
+ "type": "string",
+ "title": "MySQL custom database name"
+ },
+ "username": {
+ "type": "string",
+ "title": "MySQL custom username"
+ },
+ "password": {
+ "type": "string",
+ "title": "MySQL custom password"
+ },
+ "replicationUser": {
+ "type": "string",
+ "title": "MySQL replication username"
+ },
+ "replicationPassword": {
+ "type": "string",
+ "title": "MySQL replication password"
+ }
+ }
+ },
+ "primary": {
+ "type": "object",
+ "title": "Primary database configuration",
+ "form": true,
+ "properties": {
+ "podSecurityContext": {
+ "type": "object",
+ "title": "MySQL primary Pod security context",
+ "properties": {
+ "enabled": {
+ "type": "boolean",
+ "default": false
+ },
+ "fsGroup": {
+ "type": "integer",
+ "default": 1001,
+ "hidden": {
+ "value": false,
+ "path": "primary/podSecurityContext/enabled"
+ }
+ }
+ }
+ },
+ "containerSecurityContext": {
+ "type": "object",
+ "title": "MySQL primary container security context",
+ "properties": {
+ "enabled": {
+ "type": "boolean",
+ "default": false
+ },
+ "runAsUser": {
+ "type": "integer",
+ "default": 1001,
+ "hidden": {
+ "value": false,
+ "path": "primary/containerSecurityContext/enabled"
+ }
+ }
+ }
+ },
+ "persistence": {
+ "type": "object",
+ "title": "Enable persistence using Persistent Volume Claims",
+ "properties": {
+ "enabled": {
+ "type": "boolean",
+ "default": true,
+ "title": "If true, use a Persistent Volume Claim, If false, use emptyDir"
+ },
+ "size": {
+ "type": "string",
+ "title": "Persistent Volume Size",
+ "form": true,
+ "render": "slider",
+ "sliderMin": 1,
+ "sliderUnit": "Gi",
+ "hidden": {
+ "value": false,
+ "path": "primary/persistence/enabled"
+ }
+ }
+ }
+ }
+ }
+ },
+ "secondary": {
+ "type": "object",
+ "title": "Secondary database configuration",
+ "form": true,
+ "properties": {
+ "podSecurityContext": {
+ "type": "object",
+ "title": "MySQL secondary Pod security context",
+ "properties": {
+ "enabled": {
+ "type": "boolean",
+ "default": false
+ },
+ "fsGroup": {
+ "type": "integer",
+ "default": 1001,
+ "hidden": {
+ "value": false,
+ "path": "secondary/podSecurityContext/enabled"
+ }
+ }
+ }
+ },
+ "containerSecurityContext": {
+ "type": "object",
+ "title": "MySQL secondary container security context",
+ "properties": {
+ "enabled": {
+ "type": "boolean",
+ "default": false
+ },
+ "runAsUser": {
+ "type": "integer",
+ "default": 1001,
+ "hidden": {
+ "value": false,
+ "path": "secondary/containerSecurityContext/enabled"
+ }
+ }
+ }
+ },
+ "persistence": {
+ "type": "object",
+ "title": "Enable persistence using Persistent Volume Claims",
+ "properties": {
+ "enabled": {
+ "type": "boolean",
+ "default": true,
+ "title": "If true, use a Persistent Volume Claim, If false, use emptyDir"
+ },
+ "size": {
+ "type": "string",
+ "title": "Persistent Volume Size",
+ "form": true,
+ "render": "slider",
+ "sliderMin": 1,
+ "sliderUnit": "Gi",
+ "hidden": {
+ "value": false,
+ "path": "secondary/persistence/enabled"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/values.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/values.yaml
new file mode 100644
index 0000000..3ff7a0e
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/charts/mysql/values.yaml
@@ -0,0 +1,1026 @@
+## @section Global parameters
+## Global Docker image parameters
+## Please, note that this will override the image parameters, including dependencies, configured to use the global value
+## Current available global Docker image parameters: imageRegistry, imagePullSecrets and storageClass
+
+## @param global.imageRegistry Global Docker image registry
+## @param global.imagePullSecrets [array] Global Docker registry secret names as an array
+## @param global.storageClass Global StorageClass for Persistent Volume(s)
+##
+global:
+ imageRegistry: ""
+ ## E.g.
+ ## imagePullSecrets:
+ ## - myRegistryKeySecretName
+ ##
+ imagePullSecrets: []
+ storageClass: ""
+
+## @section Common parameters
+
+## @param nameOverride String to partially override common.names.fullname template (will maintain the release name)
+##
+nameOverride: ""
+## @param fullnameOverride String to fully override common.names.fullname template
+##
+fullnameOverride: ""
+## @param clusterDomain Cluster domain
+##
+clusterDomain: cluster.local
+## @param commonAnnotations [object] Common annotations to add to all MySQL resources (sub-charts are not considered). Evaluated as a template
+##
+commonAnnotations: {}
+## @param commonLabels [object] Common labels to add to all MySQL resources (sub-charts are not considered). Evaluated as a template
+##
+commonLabels: {}
+## @param extraDeploy [array] Array with extra yaml to deploy with the chart. Evaluated as a template
+##
+extraDeploy: []
+## @param schedulerName Use an alternate scheduler, e.g. "stork".
+## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/
+##
+schedulerName: ""
+
+## Enable diagnostic mode in the deployment
+##
+diagnosticMode:
+ ## @param diagnosticMode.enabled Enable diagnostic mode (all probes will be disabled and the command will be overridden)
+ ##
+ enabled: false
+ ## @param diagnosticMode.command Command to override all containers in the deployment
+ ##
+ command:
+ - sleep
+ ## @param diagnosticMode.args Args to override all containers in the deployment
+ ##
+ args:
+ - infinity
+
+## @section MySQL common parameters
+
+## Bitnami MySQL image
+## ref: https://hub.docker.com/r/bitnami/mysql/tags/
+## @param image.registry MySQL image registry
+## @param image.repository MySQL image repository
+## @param image.tag MySQL image tag (immutable tags are recommended)
+## @param image.pullPolicy MySQL image pull policy
+## @param image.pullSecrets [array] Specify docker-registry secret names as an array
+## @param image.debug Specify if debug logs should be enabled
+##
+image:
+ registry: docker.io
+ repository: bitnami/mysql
+ tag: 8.0.29-debian-10-r2
+ ## Specify a imagePullPolicy
+ ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
+ ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images
+ ##
+ pullPolicy: IfNotPresent
+ ## Optionally specify an array of imagePullSecrets (secrets must be manually created in the namespace)
+ ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
+ ## Example:
+ ## pullSecrets:
+ ## - myRegistryKeySecretName
+ ##
+ pullSecrets: []
+ ## Set to true if you would like to see extra information on logs
+ ## It turns BASH and/or NAMI debugging in the image
+ ##
+ debug: false
+## @param architecture MySQL architecture (`standalone` or `replication`)
+##
+architecture: standalone
+## MySQL Authentication parameters
+##
+auth:
+ ## @param auth.rootPassword Password for the `root` user. Ignored if existing secret is provided
+ ## ref: https://github.com/bitnami/bitnami-docker-mysql#setting-the-root-password-on-first-run
+ ##
+ rootPassword: ""
+ ## @param auth.database Name for a custom database to create
+ ## ref: https://github.com/bitnami/bitnami-docker-mysql/blob/master/README.md#creating-a-database-on-first-run
+ ##
+ database: my_database
+ ## @param auth.username Name for a custom user to create
+ ## ref: https://github.com/bitnami/bitnami-docker-mysql/blob/master/README.md#creating-a-database-user-on-first-run
+ ##
+ username: ""
+ ## @param auth.password Password for the new user. Ignored if existing secret is provided
+ ##
+ password: ""
+ ## @param auth.replicationUser MySQL replication user
+ ## ref: https://github.com/bitnami/bitnami-docker-mysql#setting-up-a-replication-cluster
+ ##
+ replicationUser: replicator
+ ## @param auth.replicationPassword MySQL replication user password. Ignored if existing secret is provided
+ ##
+ replicationPassword: ""
+ ## @param auth.existingSecret Use existing secret for password details. The secret has to contain the keys `mysql-root-password`, `mysql-replication-password` and `mysql-password`
+ ## NOTE: When it's set the auth.rootPassword, auth.password, auth.replicationPassword are ignored.
+ ##
+ existingSecret: ""
+ ## @param auth.forcePassword Force users to specify required passwords
+ ##
+ forcePassword: false
+ ## @param auth.usePasswordFiles Mount credentials as files instead of using an environment variable
+ ##
+ usePasswordFiles: false
+ ## @param auth.customPasswordFiles [object] Use custom password files when `auth.usePasswordFiles` is set to `true`. Define path for keys `root` and `user`, also define `replicator` if `architecture` is set to `replication`
+ ## Example:
+ ## customPasswordFiles:
+ ## root: /vault/secrets/mysql-root
+ ## user: /vault/secrets/mysql-user
+ ## replicator: /vault/secrets/mysql-replicator
+ ##
+ customPasswordFiles: {}
+## @param initdbScripts [object] Dictionary of initdb scripts
+## Specify dictionary of scripts to be run at first boot
+## Example:
+## initdbScripts:
+## my_init_script.sh: |
+## #!/bin/bash
+## echo "Do something."
+##
+initdbScripts: {}
+## @param initdbScriptsConfigMap ConfigMap with the initdb scripts (Note: Overrides `initdbScripts`)
+##
+initdbScriptsConfigMap: ""
+
+## @section MySQL Primary parameters
+
+primary:
+ ## @param primary.command [array] Override default container command on MySQL Primary container(s) (useful when using custom images)
+ ##
+ command: []
+ ## @param primary.args [array] Override default container args on MySQL Primary container(s) (useful when using custom images)
+ ##
+ args: []
+ ## @param primary.hostAliases [array] Deployment pod host aliases
+ ## https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/
+ ##
+ hostAliases: []
+ ## @param primary.configuration [string] Configure MySQL Primary with a custom my.cnf file
+ ## ref: https://mysql.com/kb/en/mysql/configuring-mysql-with-mycnf/#example-of-configuration-file
+ ##
+ configuration: |-
+ [mysqld]
+ default_authentication_plugin=mysql_native_password
+ skip-name-resolve
+ explicit_defaults_for_timestamp
+ basedir=/opt/bitnami/mysql
+ plugin_dir=/opt/bitnami/mysql/lib/plugin
+ port=3306
+ socket=/opt/bitnami/mysql/tmp/mysql.sock
+ datadir=/bitnami/mysql/data
+ tmpdir=/opt/bitnami/mysql/tmp
+ max_allowed_packet=16M
+ bind-address=0.0.0.0
+ pid-file=/opt/bitnami/mysql/tmp/mysqld.pid
+ log-error=/opt/bitnami/mysql/logs/mysqld.log
+ character-set-server=UTF8
+ collation-server=utf8_general_ci
+ slow_query_log=0
+ slow_query_log_file=/opt/bitnami/mysql/logs/mysqld.log
+ long_query_time=10.0
+
+ [client]
+ port=3306
+ socket=/opt/bitnami/mysql/tmp/mysql.sock
+ default-character-set=UTF8
+ plugin_dir=/opt/bitnami/mysql/lib/plugin
+
+ [manager]
+ port=3306
+ socket=/opt/bitnami/mysql/tmp/mysql.sock
+ pid-file=/opt/bitnami/mysql/tmp/mysqld.pid
+ ## @param primary.existingConfigmap Name of existing ConfigMap with MySQL Primary configuration.
+ ## NOTE: When it's set the 'configuration' parameter is ignored
+ ##
+ existingConfigmap: ""
+ ## @param primary.updateStrategy Update strategy type for the MySQL primary statefulset
+ ## ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#update-strategies
+ ##
+ updateStrategy: RollingUpdate
+ ## @param primary.rollingUpdatePartition Partition update strategy for MySQL Primary statefulset
+ ## https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#partitions
+ ##
+ rollingUpdatePartition: ""
+ ## @param primary.podAnnotations [object] Additional pod annotations for MySQL primary pods
+ ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
+ ##
+ podAnnotations: {}
+ ## @param primary.podAffinityPreset MySQL primary pod affinity preset. Ignored if `primary.affinity` is set. Allowed values: `soft` or `hard`
+ ## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
+ ##
+ podAffinityPreset: ""
+ ## @param primary.podAntiAffinityPreset MySQL primary pod anti-affinity preset. Ignored if `primary.affinity` is set. Allowed values: `soft` or `hard`
+ ## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
+ ##
+ podAntiAffinityPreset: soft
+ ## MySQL Primary node affinity preset
+ ## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
+ ##
+ nodeAffinityPreset:
+ ## @param primary.nodeAffinityPreset.type MySQL primary node affinity preset type. Ignored if `primary.affinity` is set. Allowed values: `soft` or `hard`
+ ##
+ type: ""
+ ## @param primary.nodeAffinityPreset.key MySQL primary node label key to match Ignored if `primary.affinity` is set.
+ ## E.g.
+ ## key: "kubernetes.io/e2e-az-name"
+ ##
+ key: ""
+ ## @param primary.nodeAffinityPreset.values [array] MySQL primary node label values to match. Ignored if `primary.affinity` is set.
+ ## E.g.
+ ## values:
+ ## - e2e-az1
+ ## - e2e-az2
+ ##
+ values: []
+ ## @param primary.affinity [object] Affinity for MySQL primary pods assignment
+ ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
+ ## Note: podAffinityPreset, podAntiAffinityPreset, and nodeAffinityPreset will be ignored when it's set
+ ##
+ affinity: {}
+ ## @param primary.nodeSelector [object] Node labels for MySQL primary pods assignment
+ ## ref: https://kubernetes.io/docs/user-guide/node-selection/
+ ##
+ nodeSelector: {}
+ ## @param primary.tolerations [array] Tolerations for MySQL primary pods assignment
+ ## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
+ ##
+ tolerations: []
+ ## MySQL primary Pod security context
+ ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod
+ ## @param primary.podSecurityContext.enabled Enable security context for MySQL primary pods
+ ## @param primary.podSecurityContext.fsGroup Group ID for the mounted volumes' filesystem
+ ##
+ podSecurityContext:
+ enabled: true
+ fsGroup: 1001
+ ## MySQL primary container security context
+ ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container
+ ## @param primary.containerSecurityContext.enabled MySQL primary container securityContext
+ ## @param primary.containerSecurityContext.runAsUser User ID for the MySQL primary container
+ ##
+ containerSecurityContext:
+ enabled: true
+ runAsUser: 1001
+ ## MySQL primary container's resource requests and limits
+ ## ref: https://kubernetes.io/docs/user-guide/compute-resources/
+ ## We usually recommend not to specify default resources and to leave this as a conscious
+ ## choice for the user. This also increases chances charts run on environments with little
+ ## resources, such as Minikube. If you do want to specify resources, uncomment the following
+ ## lines, adjust them as necessary, and remove the curly braces after 'resources:'.
+ ## @param primary.resources.limits [object] The resources limits for MySQL primary containers
+ ## @param primary.resources.requests [object] The requested resources for MySQL primary containers
+ ##
+ resources:
+ ## Example:
+ ## limits:
+ ## cpu: 250m
+ ## memory: 256Mi
+ limits: {}
+ ## Examples:
+ ## requests:
+ ## cpu: 250m
+ ## memory: 256Mi
+ requests: {}
+ ## Configure extra options for liveness probe
+ ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes
+ ## @param primary.livenessProbe.enabled Enable livenessProbe
+ ## @param primary.livenessProbe.initialDelaySeconds Initial delay seconds for livenessProbe
+ ## @param primary.livenessProbe.periodSeconds Period seconds for livenessProbe
+ ## @param primary.livenessProbe.timeoutSeconds Timeout seconds for livenessProbe
+ ## @param primary.livenessProbe.failureThreshold Failure threshold for livenessProbe
+ ## @param primary.livenessProbe.successThreshold Success threshold for livenessProbe
+ ##
+ livenessProbe:
+ enabled: true
+ initialDelaySeconds: 5
+ periodSeconds: 10
+ timeoutSeconds: 1
+ failureThreshold: 3
+ successThreshold: 1
+ ## Configure extra options for readiness probe
+ ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes
+ ## @param primary.readinessProbe.enabled Enable readinessProbe
+ ## @param primary.readinessProbe.initialDelaySeconds Initial delay seconds for readinessProbe
+ ## @param primary.readinessProbe.periodSeconds Period seconds for readinessProbe
+ ## @param primary.readinessProbe.timeoutSeconds Timeout seconds for readinessProbe
+ ## @param primary.readinessProbe.failureThreshold Failure threshold for readinessProbe
+ ## @param primary.readinessProbe.successThreshold Success threshold for readinessProbe
+ ##
+ readinessProbe:
+ enabled: true
+ initialDelaySeconds: 5
+ periodSeconds: 10
+ timeoutSeconds: 1
+ failureThreshold: 3
+ successThreshold: 1
+ ## Configure extra options for startupProbe probe
+ ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes
+ ## @param primary.startupProbe.enabled Enable startupProbe
+ ## @param primary.startupProbe.initialDelaySeconds Initial delay seconds for startupProbe
+ ## @param primary.startupProbe.periodSeconds Period seconds for startupProbe
+ ## @param primary.startupProbe.timeoutSeconds Timeout seconds for startupProbe
+ ## @param primary.startupProbe.failureThreshold Failure threshold for startupProbe
+ ## @param primary.startupProbe.successThreshold Success threshold for startupProbe
+ ##
+ startupProbe:
+ enabled: true
+ initialDelaySeconds: 15
+ periodSeconds: 10
+ timeoutSeconds: 1
+ failureThreshold: 10
+ successThreshold: 1
+ ## @param primary.customLivenessProbe [object] Override default liveness probe for MySQL primary containers
+ ##
+ customLivenessProbe: {}
+ ## @param primary.customReadinessProbe [object] Override default readiness probe for MySQL primary containers
+ ##
+ customReadinessProbe: {}
+ ## @param primary.customStartupProbe [object] Override default startup probe for MySQL primary containers
+ ##
+ customStartupProbe: {}
+ ## @param primary.extraFlags MySQL primary additional command line flags
+ ## Can be used to specify command line flags, for example:
+ ## E.g.
+ ## extraFlags: "--max-connect-errors=1000 --max_connections=155"
+ ##
+ extraFlags: ""
+ ## @param primary.extraEnvVars [array] Extra environment variables to be set on MySQL primary containers
+ ## E.g.
+ ## extraEnvVars:
+ ## - name: TZ
+ ## value: "Europe/Paris"
+ ##
+ extraEnvVars: []
+ ## @param primary.extraEnvVarsCM Name of existing ConfigMap containing extra env vars for MySQL primary containers
+ ##
+ extraEnvVarsCM: ""
+ ## @param primary.extraEnvVarsSecret Name of existing Secret containing extra env vars for MySQL primary containers
+ ##
+ extraEnvVarsSecret: ""
+ ## Enable persistence using Persistent Volume Claims
+ ## ref: https://kubernetes.io/docs/user-guide/persistent-volumes/
+ ##
+ persistence:
+ ## @param primary.persistence.enabled Enable persistence on MySQL primary replicas using a `PersistentVolumeClaim`. If false, use emptyDir
+ ##
+ enabled: true
+ ## @param primary.persistence.existingClaim Name of an existing `PersistentVolumeClaim` for MySQL primary replicas
+ ## NOTE: When it's set the rest of persistence parameters are ignored
+ ##
+ existingClaim: ""
+ ## @param primary.persistence.storageClass MySQL primary persistent volume storage Class
+ ## If defined, storageClassName:
+ ## If set to "-", storageClassName: "", which disables dynamic provisioning
+ ## If undefined (the default) or set to null, no storageClassName spec is
+ ## set, choosing the default provisioner. (gp2 on AWS, standard on
+ ## GKE, AWS & OpenStack)
+ ##
+ storageClass: ""
+ ## @param primary.persistence.annotations [object] MySQL primary persistent volume claim annotations
+ ##
+ annotations: {}
+ ## @param primary.persistence.accessModes MySQL primary persistent volume access Modes
+ ##
+ accessModes:
+ - ReadWriteOnce
+ ## @param primary.persistence.size MySQL primary persistent volume size
+ ##
+ size: 8Gi
+ ## @param primary.persistence.selector [object] Selector to match an existing Persistent Volume
+ ## selector:
+ ## matchLabels:
+ ## app: my-app
+ ##
+ selector: {}
+ ## @param primary.extraVolumes [array] Optionally specify extra list of additional volumes to the MySQL Primary pod(s)
+ ##
+ extraVolumes: []
+ ## @param primary.extraVolumeMounts [array] Optionally specify extra list of additional volumeMounts for the MySQL Primary container(s)
+ ##
+ extraVolumeMounts: []
+ ## @param primary.initContainers [array] Add additional init containers for the MySQL Primary pod(s)
+ ##
+ initContainers: []
+ ## @param primary.sidecars [array] Add additional sidecar containers for the MySQL Primary pod(s)
+ ##
+ sidecars: []
+ ## MySQL Primary Service parameters
+ ##
+ service:
+ ## @param primary.service.type MySQL Primary K8s service type
+ ##
+ type: ClusterIP
+ ## @param primary.service.port MySQL Primary K8s service port
+ ##
+ port: 3306
+ ## @param primary.service.nodePort MySQL Primary K8s service node port
+ ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
+ ##
+ nodePort: ""
+ ## @param primary.service.clusterIP MySQL Primary K8s service clusterIP IP
+ ## e.g:
+ ## clusterIP: None
+ ##
+ clusterIP: ""
+ ## @param primary.service.loadBalancerIP MySQL Primary loadBalancerIP if service type is `LoadBalancer`
+ ## Set the LoadBalancer service type to internal only
+ ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
+ ##
+ loadBalancerIP: ""
+ ## @param primary.service.externalTrafficPolicy Enable client source IP preservation
+ ## ref https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip
+ ##
+ externalTrafficPolicy: Cluster
+ ## @param primary.service.loadBalancerSourceRanges [array] Addresses that are allowed when MySQL Primary service is LoadBalancer
+ ## https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service
+ ## E.g.
+ ## loadBalancerSourceRanges:
+ ## - 10.10.10.0/24
+ ##
+ loadBalancerSourceRanges: []
+ ## @param primary.service.annotations [object] Provide any additional annotations which may be required
+ ##
+ annotations: {}
+ ## MySQL primary Pod Disruption Budget configuration
+ ## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/
+ ##
+ pdb:
+ ## @param primary.pdb.enabled Enable/disable a Pod Disruption Budget creation for MySQL primary pods
+ ##
+ enabled: false
+ ## @param primary.pdb.minAvailable Minimum number/percentage of MySQL primary pods that should remain scheduled
+ ##
+ minAvailable: 1
+ ## @param primary.pdb.maxUnavailable Maximum number/percentage of MySQL primary pods that may be made unavailable
+ ##
+ maxUnavailable: ""
+ ## @param primary.podLabels [object] MySQL Primary pod label. If labels are same as commonLabels , this will take precedence
+ ##
+ podLabels: {}
+
+## @section MySQL Secondary parameters
+
+secondary:
+ ## @param secondary.replicaCount Number of MySQL secondary replicas
+ ##
+ replicaCount: 1
+ ## @param secondary.hostAliases [array] Deployment pod host aliases
+ ## https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/
+ ##
+ hostAliases: []
+ ## @param secondary.command [array] Override default container command on MySQL Secondary container(s) (useful when using custom images)
+ ##
+ command: []
+ ## @param secondary.args [array] Override default container args on MySQL Secondary container(s) (useful when using custom images)
+ ##
+ args: []
+ ## @param secondary.configuration [string] Configure MySQL Secondary with a custom my.cnf file
+ ## ref: https://mysql.com/kb/en/mysql/configuring-mysql-with-mycnf/#example-of-configuration-file
+ ##
+ configuration: |-
+ [mysqld]
+ default_authentication_plugin=mysql_native_password
+ skip-name-resolve
+ explicit_defaults_for_timestamp
+ basedir=/opt/bitnami/mysql
+ port=3306
+ socket=/opt/bitnami/mysql/tmp/mysql.sock
+ datadir=/bitnami/mysql/data
+ tmpdir=/opt/bitnami/mysql/tmp
+ max_allowed_packet=16M
+ bind-address=0.0.0.0
+ pid-file=/opt/bitnami/mysql/tmp/mysqld.pid
+ log-error=/opt/bitnami/mysql/logs/mysqld.log
+ character-set-server=UTF8
+ collation-server=utf8_general_ci
+ slow_query_log=0
+ slow_query_log_file=/opt/bitnami/mysql/logs/mysqld.log
+ long_query_time=10.0
+
+ [client]
+ port=3306
+ socket=/opt/bitnami/mysql/tmp/mysql.sock
+ default-character-set=UTF8
+
+ [manager]
+ port=3306
+ socket=/opt/bitnami/mysql/tmp/mysql.sock
+ pid-file=/opt/bitnami/mysql/tmp/mysqld.pid
+ ## @param secondary.existingConfigmap Name of existing ConfigMap with MySQL Secondary configuration.
+ ## NOTE: When it's set the 'configuration' parameter is ignored
+ ##
+ existingConfigmap: ""
+ ## @param secondary.updateStrategy Update strategy type for the MySQL secondary statefulset
+ ## ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#update-strategies
+ ##
+ updateStrategy: RollingUpdate
+ ## @param secondary.rollingUpdatePartition Partition update strategy for MySQL Secondary statefulset
+ ## https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#partitions
+ ##
+ rollingUpdatePartition: ""
+ ## @param secondary.podAnnotations [object] Additional pod annotations for MySQL secondary pods
+ ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
+ ##
+ podAnnotations: {}
+ ## @param secondary.podAffinityPreset MySQL secondary pod affinity preset. Ignored if `secondary.affinity` is set. Allowed values: `soft` or `hard`
+ ## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
+ ##
+ podAffinityPreset: ""
+ ## @param secondary.podAntiAffinityPreset MySQL secondary pod anti-affinity preset. Ignored if `secondary.affinity` is set. Allowed values: `soft` or `hard`
+ ## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
+ ## Allowed values: soft, hard
+ ##
+ podAntiAffinityPreset: soft
+ ## MySQL Secondary node affinity preset
+ ## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
+ ##
+ nodeAffinityPreset:
+ ## @param secondary.nodeAffinityPreset.type MySQL secondary node affinity preset type. Ignored if `secondary.affinity` is set. Allowed values: `soft` or `hard`
+ ##
+ type: ""
+ ## @param secondary.nodeAffinityPreset.key MySQL secondary node label key to match Ignored if `secondary.affinity` is set.
+ ## E.g.
+ ## key: "kubernetes.io/e2e-az-name"
+ ##
+ key: ""
+ ## @param secondary.nodeAffinityPreset.values [array] MySQL secondary node label values to match. Ignored if `secondary.affinity` is set.
+ ## E.g.
+ ## values:
+ ## - e2e-az1
+ ## - e2e-az2
+ ##
+ values: []
+ ## @param secondary.affinity [object] Affinity for MySQL secondary pods assignment
+ ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
+ ## Note: podAffinityPreset, podAntiAffinityPreset, and nodeAffinityPreset will be ignored when it's set
+ ##
+ affinity: {}
+ ## @param secondary.nodeSelector [object] Node labels for MySQL secondary pods assignment
+ ## ref: https://kubernetes.io/docs/user-guide/node-selection/
+ ##
+ nodeSelector: {}
+ ## @param secondary.tolerations [array] Tolerations for MySQL secondary pods assignment
+ ## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
+ ##
+ tolerations: []
+ ## MySQL secondary Pod security context
+ ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod
+ ## @param secondary.podSecurityContext.enabled Enable security context for MySQL secondary pods
+ ## @param secondary.podSecurityContext.fsGroup Group ID for the mounted volumes' filesystem
+ ##
+ podSecurityContext:
+ enabled: true
+ fsGroup: 1001
+ ## MySQL secondary container security context
+ ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container
+ ## @param secondary.containerSecurityContext.enabled MySQL secondary container securityContext
+ ## @param secondary.containerSecurityContext.runAsUser User ID for the MySQL secondary container
+ ##
+ containerSecurityContext:
+ enabled: true
+ runAsUser: 1001
+ ## MySQL secondary container's resource requests and limits
+ ## ref: https://kubernetes.io/docs/user-guide/compute-resources/
+ ## We usually recommend not to specify default resources and to leave this as a conscious
+ ## choice for the user. This also increases chances charts run on environments with little
+ ## resources, such as Minikube. If you do want to specify resources, uncomment the following
+ ## lines, adjust them as necessary, and remove the curly braces after 'resources:'.
+ ## @param secondary.resources.limits [object] The resources limits for MySQL secondary containers
+ ## @param secondary.resources.requests [object] The requested resources for MySQL secondary containers
+ ##
+ resources:
+ ## Example:
+ ## limits:
+ ## cpu: 250m
+ ## memory: 256Mi
+ limits: {}
+ ## Examples:
+ ## requests:
+ ## cpu: 250m
+ ## memory: 256Mi
+ requests: {}
+ ## Configure extra options for liveness probe
+ ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes
+ ## @param secondary.livenessProbe.enabled Enable livenessProbe
+ ## @param secondary.livenessProbe.initialDelaySeconds Initial delay seconds for livenessProbe
+ ## @param secondary.livenessProbe.periodSeconds Period seconds for livenessProbe
+ ## @param secondary.livenessProbe.timeoutSeconds Timeout seconds for livenessProbe
+ ## @param secondary.livenessProbe.failureThreshold Failure threshold for livenessProbe
+ ## @param secondary.livenessProbe.successThreshold Success threshold for livenessProbe
+ ##
+ livenessProbe:
+ enabled: true
+ initialDelaySeconds: 5
+ periodSeconds: 10
+ timeoutSeconds: 1
+ failureThreshold: 3
+ successThreshold: 1
+ ## Configure extra options for readiness probe
+ ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes
+ ## @param secondary.readinessProbe.enabled Enable readinessProbe
+ ## @param secondary.readinessProbe.initialDelaySeconds Initial delay seconds for readinessProbe
+ ## @param secondary.readinessProbe.periodSeconds Period seconds for readinessProbe
+ ## @param secondary.readinessProbe.timeoutSeconds Timeout seconds for readinessProbe
+ ## @param secondary.readinessProbe.failureThreshold Failure threshold for readinessProbe
+ ## @param secondary.readinessProbe.successThreshold Success threshold for readinessProbe
+ ##
+ readinessProbe:
+ enabled: true
+ initialDelaySeconds: 5
+ periodSeconds: 10
+ timeoutSeconds: 1
+ failureThreshold: 3
+ successThreshold: 1
+ ## Configure extra options for startupProbe probe
+ ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes
+ ## @param secondary.startupProbe.enabled Enable startupProbe
+ ## @param secondary.startupProbe.initialDelaySeconds Initial delay seconds for startupProbe
+ ## @param secondary.startupProbe.periodSeconds Period seconds for startupProbe
+ ## @param secondary.startupProbe.timeoutSeconds Timeout seconds for startupProbe
+ ## @param secondary.startupProbe.failureThreshold Failure threshold for startupProbe
+ ## @param secondary.startupProbe.successThreshold Success threshold for startupProbe
+ ##
+ startupProbe:
+ enabled: true
+ initialDelaySeconds: 15
+ periodSeconds: 10
+ timeoutSeconds: 1
+ failureThreshold: 15
+ successThreshold: 1
+ ## @param secondary.customLivenessProbe [object] Override default liveness probe for MySQL secondary containers
+ ##
+ customLivenessProbe: {}
+ ## @param secondary.customReadinessProbe [object] Override default readiness probe for MySQL secondary containers
+ ##
+ customReadinessProbe: {}
+ ## @param secondary.customStartupProbe [object] Override default startup probe for MySQL secondary containers
+ ##
+ customStartupProbe: {}
+ ## @param secondary.extraFlags MySQL secondary additional command line flags
+ ## Can be used to specify command line flags, for example:
+ ## E.g.
+ ## extraFlags: "--max-connect-errors=1000 --max_connections=155"
+ ##
+ extraFlags: ""
+ ## @param secondary.extraEnvVars [array] An array to add extra environment variables on MySQL secondary containers
+ ## E.g.
+ ## extraEnvVars:
+ ## - name: TZ
+ ## value: "Europe/Paris"
+ ##
+ extraEnvVars: []
+ ## @param secondary.extraEnvVarsCM Name of existing ConfigMap containing extra env vars for MySQL secondary containers
+ ##
+ extraEnvVarsCM: ""
+ ## @param secondary.extraEnvVarsSecret Name of existing Secret containing extra env vars for MySQL secondary containers
+ ##
+ extraEnvVarsSecret: ""
+ ## Enable persistence using Persistent Volume Claims
+ ## ref: https://kubernetes.io/docs/user-guide/persistent-volumes/
+ ##
+ persistence:
+ ## @param secondary.persistence.enabled Enable persistence on MySQL secondary replicas using a `PersistentVolumeClaim`
+ ##
+ enabled: true
+ ## @param secondary.persistence.storageClass MySQL secondary persistent volume storage Class
+ ## If defined, storageClassName:
+ ## If set to "-", storageClassName: "", which disables dynamic provisioning
+ ## If undefined (the default) or set to null, no storageClassName spec is
+ ## set, choosing the default provisioner. (gp2 on AWS, standard on
+ ## GKE, AWS & OpenStack)
+ ##
+ storageClass: ""
+ ## @param secondary.persistence.annotations [object] MySQL secondary persistent volume claim annotations
+ ##
+ annotations: {}
+ ## @param secondary.persistence.accessModes MySQL secondary persistent volume access Modes
+ ##
+ accessModes:
+ - ReadWriteOnce
+ ## @param secondary.persistence.size MySQL secondary persistent volume size
+ ##
+ size: 8Gi
+ ## @param secondary.persistence.selector [object] Selector to match an existing Persistent Volume
+ ## selector:
+ ## matchLabels:
+ ## app: my-app
+ ##
+ selector: {}
+ ## @param secondary.extraVolumes [array] Optionally specify extra list of additional volumes to the MySQL secondary pod(s)
+ ##
+ extraVolumes: []
+ ## @param secondary.extraVolumeMounts [array] Optionally specify extra list of additional volumeMounts for the MySQL secondary container(s)
+ ##
+ extraVolumeMounts: []
+ ## @param secondary.initContainers [array] Add additional init containers for the MySQL secondary pod(s)
+ ##
+ initContainers: []
+ ## @param secondary.sidecars [array] Add additional sidecar containers for the MySQL secondary pod(s)
+ ##
+ sidecars: []
+ ## MySQL Secondary Service parameters
+ ##
+ service:
+ ## @param secondary.service.type MySQL secondary Kubernetes service type
+ ##
+ type: ClusterIP
+ ## @param secondary.service.port MySQL secondary Kubernetes service port
+ ##
+ port: 3306
+ ## @param secondary.service.nodePort MySQL secondary Kubernetes service node port
+ ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
+ ##
+ nodePort: ""
+ ## @param secondary.service.clusterIP MySQL secondary Kubernetes service clusterIP IP
+ ## e.g:
+ ## clusterIP: None
+ ##
+ clusterIP: ""
+ ## @param secondary.service.loadBalancerIP MySQL secondary loadBalancerIP if service type is `LoadBalancer`
+ ## Set the LoadBalancer service type to internal only
+ ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
+ ##
+ loadBalancerIP: ""
+ ## @param secondary.service.externalTrafficPolicy Enable client source IP preservation
+ ## ref https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip
+ ##
+ externalTrafficPolicy: Cluster
+ ## @param secondary.service.loadBalancerSourceRanges [array] Addresses that are allowed when MySQL secondary service is LoadBalancer
+ ## https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service
+ ## E.g.
+ ## loadBalancerSourceRanges:
+ ## - 10.10.10.0/24
+ ##
+ loadBalancerSourceRanges: []
+ ## @param secondary.service.annotations [object] Provide any additional annotations which may be required
+ ##
+ annotations: {}
+ ## MySQL secondary Pod Disruption Budget configuration
+ ## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/
+ ##
+ pdb:
+ ## @param secondary.pdb.enabled Enable/disable a Pod Disruption Budget creation for MySQL secondary pods
+ ##
+ enabled: false
+ ## @param secondary.pdb.minAvailable Minimum number/percentage of MySQL secondary pods that should remain scheduled
+ ##
+ minAvailable: 1
+ ## @param secondary.pdb.maxUnavailable Maximum number/percentage of MySQL secondary pods that may be made unavailable
+ ##
+ maxUnavailable: ""
+ ## @param secondary.podLabels [object] Additional pod labels for MySQL secondary pods
+ ##
+ podLabels: {}
+
+## @section RBAC parameters
+
+## MySQL pods ServiceAccount
+## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
+##
+serviceAccount:
+ ## @param serviceAccount.create Enable the creation of a ServiceAccount for MySQL pods
+ ##
+ create: true
+ ## @param serviceAccount.name Name of the created ServiceAccount
+ ## If not set and create is true, a name is generated using the mysql.fullname template
+ ##
+ name: ""
+ ## @param serviceAccount.annotations [object] Annotations for MySQL Service Account
+ ##
+ annotations: {}
+## Role Based Access
+## ref: https://kubernetes.io/docs/admin/authorization/rbac/
+##
+rbac:
+ ## @param rbac.create Whether to create & use RBAC resources or not
+ ##
+ create: false
+
+## @section Network Policy
+
+## MySQL Nework Policy configuration
+##
+networkPolicy:
+ ## @param networkPolicy.enabled Enable creation of NetworkPolicy resources
+ ##
+ enabled: false
+ ## @param networkPolicy.allowExternal The Policy model to apply.
+ ## When set to false, only pods with the correct
+ ## client label will have network access to the port MySQL is listening
+ ## on. When true, MySQL will accept connections from any source
+ ## (with the correct destination port).
+ ##
+ allowExternal: true
+ ## @param networkPolicy.explicitNamespacesSelector [object] A Kubernetes LabelSelector to explicitly select namespaces from which ingress traffic could be allowed to MySQL
+ ## If explicitNamespacesSelector is missing or set to {}, only client Pods that are in the networkPolicy's namespace
+ ## and that match other criteria, the ones that have the good label, can reach the DB.
+ ## But sometimes, we want the DB to be accessible to clients from other namespaces, in this case, we can use this
+ ## LabelSelector to select these namespaces, note that the networkPolicy's namespace should also be explicitly added.
+ ##
+ ## Example:
+ ## explicitNamespacesSelector:
+ ## matchLabels:
+ ## role: frontend
+ ## matchExpressions:
+ ## - {key: role, operator: In, values: [frontend]}
+ ##
+ explicitNamespacesSelector: {}
+
+## @section Volume Permissions parameters
+
+## Init containers parameters:
+## volumePermissions: Change the owner and group of the persistent volume mountpoint to runAsUser:fsGroup values from the securityContext section.
+##
+volumePermissions:
+ ## @param volumePermissions.enabled Enable init container that changes the owner and group of the persistent volume(s) mountpoint to `runAsUser:fsGroup`
+ ##
+ enabled: false
+ ## @param volumePermissions.image.registry Init container volume-permissions image registry
+ ## @param volumePermissions.image.repository Init container volume-permissions image repository
+ ## @param volumePermissions.image.tag Init container volume-permissions image tag (immutable tags are recommended)
+ ## @param volumePermissions.image.pullPolicy Init container volume-permissions image pull policy
+ ## @param volumePermissions.image.pullSecrets [array] Specify docker-registry secret names as an array
+ ##
+ image:
+ registry: docker.io
+ repository: bitnami/bitnami-shell
+ tag: 10-debian-10-r409
+ pullPolicy: IfNotPresent
+ ## Optionally specify an array of imagePullSecrets.
+ ## Secrets must be manually created in the namespace.
+ ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
+ ## e.g:
+ ## pullSecrets:
+ ## - myRegistryKeySecretName
+ ##
+ pullSecrets: []
+ ## @param volumePermissions.resources [object] Init container volume-permissions resources
+ ##
+ resources: {}
+
+## @section Metrics parameters
+
+## Mysqld Prometheus exporter parameters
+##
+metrics:
+ ## @param metrics.enabled Start a side-car prometheus exporter
+ ##
+ enabled: false
+ ## @param metrics.image.registry Exporter image registry
+ ## @param metrics.image.repository Exporter image repository
+ ## @param metrics.image.tag Exporter image tag (immutable tags are recommended)
+ ## @param metrics.image.pullPolicy Exporter image pull policy
+ ## @param metrics.image.pullSecrets [array] Specify docker-registry secret names as an array
+ ##
+ image:
+ registry: docker.io
+ repository: bitnami/mysqld-exporter
+ tag: 0.14.0-debian-10-r53
+ pullPolicy: IfNotPresent
+ ## Optionally specify an array of imagePullSecrets.
+ ## Secrets must be manually created in the namespace.
+ ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
+ ## e.g:
+ ## pullSecrets:
+ ## - myRegistryKeySecretName
+ ##
+ pullSecrets: []
+ ## MySQL Prometheus exporter service parameters
+ ## Mysqld Prometheus exporter liveness and readiness probes
+ ## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes
+ ## @param metrics.service.type Kubernetes service type for MySQL Prometheus Exporter
+ ## @param metrics.service.port MySQL Prometheus Exporter service port
+ ## @param metrics.service.annotations [object] Prometheus exporter service annotations
+ ##
+ service:
+ type: ClusterIP
+ port: 9104
+ annotations:
+ prometheus.io/scrape: "true"
+ prometheus.io/port: "{{ .Values.metrics.service.port }}"
+ ## @param metrics.extraArgs.primary [array] Extra args to be passed to mysqld_exporter on Primary pods
+ ## @param metrics.extraArgs.secondary [array] Extra args to be passed to mysqld_exporter on Secondary pods
+ ## ref: https://github.com/prometheus/mysqld_exporter/
+ ## E.g.
+ ## - --collect.auto_increment.columns
+ ## - --collect.binlog_size
+ ## - --collect.engine_innodb_status
+ ## - --collect.engine_tokudb_status
+ ## - --collect.global_status
+ ## - --collect.global_variables
+ ## - --collect.info_schema.clientstats
+ ## - --collect.info_schema.innodb_metrics
+ ## - --collect.info_schema.innodb_tablespaces
+ ## - --collect.info_schema.innodb_cmp
+ ## - --collect.info_schema.innodb_cmpmem
+ ## - --collect.info_schema.processlist
+ ## - --collect.info_schema.processlist.min_time
+ ## - --collect.info_schema.query_response_time
+ ## - --collect.info_schema.tables
+ ## - --collect.info_schema.tables.databases
+ ## - --collect.info_schema.tablestats
+ ## - --collect.info_schema.userstats
+ ## - --collect.perf_schema.eventsstatements
+ ## - --collect.perf_schema.eventsstatements.digest_text_limit
+ ## - --collect.perf_schema.eventsstatements.limit
+ ## - --collect.perf_schema.eventsstatements.timelimit
+ ## - --collect.perf_schema.eventswaits
+ ## - --collect.perf_schema.file_events
+ ## - --collect.perf_schema.file_instances
+ ## - --collect.perf_schema.indexiowaits
+ ## - --collect.perf_schema.tableiowaits
+ ## - --collect.perf_schema.tablelocks
+ ## - --collect.perf_schema.replication_group_member_stats
+ ## - --collect.slave_status
+ ## - --collect.slave_hosts
+ ## - --collect.heartbeat
+ ## - --collect.heartbeat.database
+ ## - --collect.heartbeat.table
+ ##
+ extraArgs:
+ primary: []
+ secondary: []
+ ## Mysqld Prometheus exporter resource requests and limits
+ ## ref: https://kubernetes.io/docs/user-guide/compute-resources/
+ ## We usually recommend not to specify default resources and to leave this as a conscious
+ ## choice for the user. This also increases chances charts run on environments with little
+ ## resources, such as Minikube. If you do want to specify resources, uncomment the following
+ ## lines, adjust them as necessary, and remove the curly braces after 'resources:'.
+ ## @param metrics.resources.limits [object] The resources limits for MySQL prometheus exporter containers
+ ## @param metrics.resources.requests [object] The requested resources for MySQL prometheus exporter containers
+ ##
+ resources:
+ ## Example:
+ ## limits:
+ ## cpu: 100m
+ ## memory: 256Mi
+ limits: {}
+ ## Examples:
+ ## requests:
+ ## cpu: 100m
+ ## memory: 256Mi
+ requests: {}
+ ## Mysqld Prometheus exporter liveness probe
+ ## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes
+ ## @param metrics.livenessProbe.enabled Enable livenessProbe
+ ## @param metrics.livenessProbe.initialDelaySeconds Initial delay seconds for livenessProbe
+ ## @param metrics.livenessProbe.periodSeconds Period seconds for livenessProbe
+ ## @param metrics.livenessProbe.timeoutSeconds Timeout seconds for livenessProbe
+ ## @param metrics.livenessProbe.failureThreshold Failure threshold for livenessProbe
+ ## @param metrics.livenessProbe.successThreshold Success threshold for livenessProbe
+ ##
+ livenessProbe:
+ enabled: true
+ initialDelaySeconds: 120
+ periodSeconds: 10
+ timeoutSeconds: 1
+ successThreshold: 1
+ failureThreshold: 3
+ ## Mysqld Prometheus exporter readiness probe
+ ## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes
+ ## @param metrics.readinessProbe.enabled Enable readinessProbe
+ ## @param metrics.readinessProbe.initialDelaySeconds Initial delay seconds for readinessProbe
+ ## @param metrics.readinessProbe.periodSeconds Period seconds for readinessProbe
+ ## @param metrics.readinessProbe.timeoutSeconds Timeout seconds for readinessProbe
+ ## @param metrics.readinessProbe.failureThreshold Failure threshold for readinessProbe
+ ## @param metrics.readinessProbe.successThreshold Success threshold for readinessProbe
+ ##
+ readinessProbe:
+ enabled: true
+ initialDelaySeconds: 30
+ periodSeconds: 10
+ timeoutSeconds: 1
+ successThreshold: 1
+ failureThreshold: 3
+ ## Prometheus Service Monitor
+ ## ref: https://github.com/coreos/prometheus-operator
+ ##
+ serviceMonitor:
+ ## @param metrics.serviceMonitor.enabled Create ServiceMonitor Resource for scraping metrics using PrometheusOperator
+ ##
+ enabled: false
+ ## @param metrics.serviceMonitor.namespace Specify the namespace in which the serviceMonitor resource will be created
+ ##
+ namespace: ""
+ ## @param metrics.serviceMonitor.interval Specify the interval at which metrics should be scraped
+ ##
+ interval: 30s
+ ## @param metrics.serviceMonitor.scrapeTimeout Specify the timeout after which the scrape is ended
+ ## e.g:
+ ## scrapeTimeout: 30s
+ ##
+ scrapeTimeout: ""
+ ## @param metrics.serviceMonitor.relabellings [array] Specify Metric Relabellings to add to the scrape endpoint
+ ##
+ relabellings: []
+ ## @param metrics.serviceMonitor.honorLabels Specify honorLabels parameter to add the scrape endpoint
+ ##
+ honorLabels: false
+ ## @param metrics.serviceMonitor.additionalLabels [object] Used to pass Labels that are used by the Prometheus installed in your cluster to select Service Monitors to work with
+ ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#prometheusspec
+ ##
+ additionalLabels: {}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/NOTES.txt b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/NOTES.txt
new file mode 100644
index 0000000..5556419
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/NOTES.txt
@@ -0,0 +1,41 @@
+The nacos has been installed.
+
+Nacos can be accessed:
+
+ {{ if .Values.ingress.enabled }}
+ * The application URL:
+ {{- range .Values.ingress.hosts }}
+ http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }}
+ {{- end }}
+ {{- end }}
+
+ * Within your cluster, at the following DNS name at port {{ .Values.service.ingressPort }}:
+
+ {{ include "common.names.fullname" . }}.{{ .Release.Namespace }}.svc
+
+ * From outside the cluster, run these commands in the same shell:
+ {{- if contains "NodePort" .Values.service.type }}
+
+ export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.names.fullname" . }})
+ export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
+ echo http://$NODE_IP:$NODE_PORT
+ {{- else if contains "LoadBalancer" .Values.service.type }}
+
+ WARNING: You have likely exposed your nacos direct to the internet.
+ Nacos does not implement any security for public facing clusters by default.
+ As a minimum level of security; switch to ClusterIP/NodePort and place an Nginx gateway infront of the cluster in order to lock down access to dangerous HTTP endpoints and verbs.
+
+ NOTE: It may take a few minutes for the LoadBalancer IP to be available.
+ You can watch the status of by running 'kubectl get svc -w {{ include "common.names.fullname" . }}'
+
+ export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "common.names.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
+ echo http://$SERVICE_IP:{{ .Values.service.ports.http.port }}
+ {{- else if contains "ClusterIP" .Values.service.type }}
+
+ export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
+ echo "Visit http://127.0.0.1:{{ .Values.service.ports.http.port }} to use nacos"
+ kubectl port-forward --namespace {{ .Release.Namespace }} $POD_NAME {{ .Values.service.ports.http.port }}:{{ .Values.service.ports.http.port }}
+ {{- end }}
+
+ # The default user is: nacos
+ # The default password is: nacos
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/_helpers.tpl b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/_helpers.tpl
new file mode 100644
index 0000000..c354d91
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/_helpers.tpl
@@ -0,0 +1,105 @@
+{{/* vim: set filetype=mustache: */}}
+{{/*
+Return the proper Nacos image name
+*/}}
+{{- define "nacos.image" -}}
+{{- include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) -}}
+{{- end -}}
+
+{{/*
+Return the proper Nacos initDB image name
+*/}}
+{{- define "nacos.initDB.image" -}}
+{{- include "common.images.image" (dict "imageRoot" .Values.initDB.image "global" .Values.global) -}}
+{{- end -}}
+
+{{/*
+Return the proper Docker Image Registry Secret Names
+*/}}
+{{- define "nacos.imagePullSecrets" -}}
+{{- include "common.images.pullSecrets" (dict "images" (list .Values.initDB.image) "global" .Values.global) -}}
+{{- end -}}
+
+{{/*
+Expand the name of the chart.
+*/}}
+{{- define "nacos.pvc" -}}
+{{- coalesce .Values.persistence.existingClaim (include "common.names.fullname" .) -}}
+{{- end -}}
+
+{{/*
+Create the name of the service account to use
+*/}}
+{{- define "nacos.serviceAccountName" -}}
+{{- if .Values.serviceAccount.create -}}
+ {{ default (include "common.names.fullname" .) .Values.serviceAccount.name }}
+{{- else -}}
+ {{ default "default" .Values.serviceAccount.name }}
+{{- end -}}
+{{- end -}}
+
+{{/* Check if there are rolling tags in the images */}}
+{{- define "nacos.checkRollingTags" -}}
+{{- include "common.warnings.rollingTag" .Values.image }}
+{{- include "common.warnings.rollingTag" .Values.initDB.image }}
+{{- include "common.warnings.rollingTag" .Values.volumePermissions.image }}
+{{- end -}}
+
+{{/*
+Return the secret containing TLS certificates
+*/}}
+{{- define "nacos.tlsSecretName" -}}
+{{- $secretName := coalesce .Values.tls.existingSecret .Values.tls.secretName -}}
+{{- if $secretName -}}
+ {{- printf "%s" (tpl $secretName $) -}}
+{{- else -}}
+ {{- printf "%s-crt" (include "common.names.fullname" .) -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Return true if a TLS secret object should be created
+*/}}
+{{- define "nacos.createTlsSecret" -}}
+{{- if and .Values.tls.enabled .Values.tls.autoGenerated (not .Values.tls.secretName) (not .Values.tls.existingSecret) }}
+ {{- true -}}
+{{- end -}}
+{{- 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).
+*/}}
+{{- define "nacos.mysql.fullname" -}}
+{{- printf "%s-%s" .Release.Name "mysql" | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+{{/*
+Return the mysql primary Hostname
+*/}}
+{{- define "nacos.mysql.primaryHost" -}}
+{{- if .Values.mysql.enabled }}
+ {{- if eq .Values.mysql.architecture "replication" }}
+ {{- printf "%s-%s" (include "nacos.mysql.fullname" .) "primary" | trunc 63 | trimSuffix "-" -}}
+ {{- else -}}
+ {{- printf "%s" (include "nacos.mysql.fullname" .) -}}
+ {{- end -}}
+{{- else -}}
+ {{- printf "%s" .Values.mysql.external.mysqlMasterHost -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Return the mysql secondary Hostname
+*/}}
+{{- define "nacos.mysql.secondaryHost" -}}
+{{- if .Values.mysql.enabled }}
+ {{- if eq .Values.mysql.architecture "replication" }}
+ {{- printf "%s-%s" (include "nacos.mysql.fullname" .) "secondary" | trunc 63 | trimSuffix "-" -}}
+ {{- else -}}
+ {{- printf "%s" (include "nacos.mysql.fullname" .) -}}
+ {{- end -}}
+{{- else -}}
+ {{- printf "%s" .Values.mysql.external.mysqlSlaveHost -}}
+{{- end -}}
+{{- end -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/configmap.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/configmap.yaml
new file mode 100644
index 0000000..1277350
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/configmap.yaml
@@ -0,0 +1,17 @@
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: {{ template "common.names.fullname" . }}
+ namespace: {{ .Release.Namespace }}
+ labels: {{- include "common.labels.standard" . | nindent 4 }}
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- if .Values.commonAnnotations }}
+ annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+data:
+ sql_files: "https://raw.githubusercontent.com/alibaba/nacos/{{ .Chart.AppVersion }}/distribution/conf/nacos-mysql.sql"
+{{- if .Values.config.enabled -}}
+ {{- toYaml .Values.config.data | nindent 2 }}
+{{- end -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/deployment-statefulset.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/deployment-statefulset.yaml
new file mode 100644
index 0000000..23ceed7
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/deployment-statefulset.yaml
@@ -0,0 +1,310 @@
+{{- $root := . -}}
+{{- if .Values.statefulset.enabled }}
+apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }}
+kind: StatefulSet
+{{- else }}
+apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
+kind: Deployment
+{{- end }}
+metadata:
+ name: {{ include "common.names.fullname" . }}
+ namespace: {{ .Release.Namespace }}
+ labels: {{- include "common.labels.standard" . | nindent 4 }}
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+spec:
+ selector:
+ matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
+ replicas: {{ .Values.replicaCount }}
+ {{- if .Values.statefulset.enabled }}
+ serviceName: {{ include "common.names.fullname" . }}-headless
+ podManagementPolicy: {{ .Values.podManagementPolicy }}
+ {{- end }}
+ {{- if .Values.updateStrategy }}
+ strategy: {{- toYaml .Values.updateStrategy | nindent 4 }}
+ {{- end }}
+ template:
+ metadata:
+ labels: {{- include "common.labels.standard" . | nindent 8 }}
+ {{- if .Values.podLabels }}
+ {{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }}
+ {{- end }}
+ annotations:
+ {{- if .Values.podAnnotations }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.podAnnotations "context" $) | nindent 8 }}
+ {{- end }}
+ {{- if and .Values.metrics.enabled .Values.metrics.podAnnotations }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.podAnnotations "context" $) | nindent 8 }}
+ {{- end }}
+ spec:
+ automountServiceAccountToken: {{ .Values.serviceAccount.autoMount }}
+ shareProcessNamespace: {{ .Values.sidecarSingleProcessNamespace }}
+ serviceAccountName: {{ template "nacos.serviceAccountName" . }}
+ {{- if .Values.hostAliases }}
+ hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.hostAliases "context" $) | nindent 8 }}
+ {{- end }}
+ {{- if .Values.affinity }}
+ affinity: {{- include "common.tplvalues.render" (dict "value" .Values.affinity "context" $) | nindent 8 }}
+ {{- else }}
+ affinity:
+ podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "context" $) | nindent 10 }}
+ podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "context" $) | nindent 10 }}
+ nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }}
+ {{- end }}
+ hostNetwork: {{ .Values.hostNetwork }}
+ hostIPC: {{ .Values.hostIPC }}
+ {{- if .Values.priorityClassName }}
+ priorityClassName: {{ .Values.priorityClassName | quote }}
+ {{- end }}
+ {{- if .Values.nodeSelector }}
+ nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }}
+ {{- end }}
+ {{- if .Values.tolerations }}
+ tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" $) | nindent 8 }}
+ {{- end }}
+ {{- if .Values.podSecurityContext.enabled }}
+ securityContext: {{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 }}
+ {{- end }}
+ {{- if .Values.dnsPolicy }}
+ dnsPolicy: {{ .Values.dnsPolicy | quote }}
+ {{- end }}
+ {{- include "nacos.imagePullSecrets" . | nindent 6 }}
+ initContainers:
+ - name: peer-finder-plugin-install
+ image: nacos/nacos-peer-finder-plugin:latest
+ imagePullPolicy: Always
+ volumeMounts:
+ {{- if .Values.persistence.mountPaths }}
+ {{- toYaml .Values.persistence.mountPaths | nindent 12 }}
+ {{- end }}
+ {{- if .Values.extraVolumeMounts }}
+ {{- toYaml .Values.extraVolumeMounts | nindent 12 }}
+ {{- end }}
+ {{- if .Values.initContainers }}
+ {{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }}
+ volumeMounts:
+ {{- if .Values.persistence.mountPaths }}
+ {{ toYaml .Values.persistence.mountPaths | nindent 12 }}
+ {{- end }}
+ {{- if .Values.extraVolumeMounts }}
+ {{ toYaml .Values.extraVolumeMounts | nindent 12 }}
+ {{- end }}
+ {{- end }}
+ containers:
+ - name: {{ include "common.names.name" . }}
+ image: {{ template "nacos.image" . }}
+ imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
+ {{- if .Values.containerSecurityContext.enabled }}
+ securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }}
+ {{- end }}
+ {{- if .Values.lifecycle }}
+ lifecycle:
+ {{- toYaml .Values.lifecycle | nindent 12 }}
+ {{- end }}
+ {{- if .Values.command }}
+ command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 12 }}
+ {{- end }}
+ {{- if .Values.args }}
+ args: {{- include "common.tplvalues.render" (dict "value" .Values.args "context" $) | nindent 12 }}
+ {{- end }}
+ env:
+ - name: NACOS_REPLICAS
+ value: "{{ .Values.replicaCount }}"
+ - name: NACOS_SERVERS
+ value: {{ range $i, $e := until (int $.Values.replicaCount) -}}
+ {{- $nacosPodName := (printf "%s-%d.%s-headless" (include "common.names.fullname" $root) $i (include "common.names.fullname" $root)) -}}
+ {{- $nacosPodName -}}:8848{{ printf " " }}
+ {{- end }}
+ - name: DOMAIN_NAME
+ value: {{ .Values.clusterDomain | quote }}
+ - name: SERVICE_NAME
+ value: {{ include "common.names.fullname" . }}-headless
+ - name: POD_NAMESPACE
+ valueFrom:
+ fieldRef:
+ apiVersion: v1
+ fieldPath: metadata.namespace
+ - name: MYSQL_SERVICE_HOST
+ valueFrom:
+ secretKeyRef:
+ name: {{ include "common.names.fullname" . }}
+ key: mysqlMasterHost
+ - name: MYSQL_SERVICE_DB_NAME
+ valueFrom:
+ secretKeyRef:
+ name: {{ include "common.names.fullname" . }}
+ key: mysqlDatabase
+ - name: MYSQL_SERVICE_PORT
+ valueFrom:
+ secretKeyRef:
+ name: {{ include "common.names.fullname" . }}
+ key: mysqlMasterPort
+ - name: MYSQL_SERVICE_USER
+ valueFrom:
+ secretKeyRef:
+ name: {{ include "common.names.fullname" . }}
+ key: mysqlMasterUser
+ - name: MYSQL_SERVICE_PASSWORD
+ valueFrom:
+ secretKeyRef:
+ name: {{ include "common.names.fullname" . }}
+ key: mysqlMasterPassword
+ - name: NACOS_SERVER_PORT
+ value: "8848"
+ - name: NACOS_APPLICATION_PORT
+ value: "8848"
+ {{- if .Values.extraEnvVars }}
+ {{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }}
+ {{- end }}
+ envFrom:
+ {{- if .Values.extraEnvVarsCM }}
+ - configMapRef:
+ name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsCM "context" $) }}
+ {{- end }}
+ {{- if .Values.extraEnvVarsSecret }}
+ - secretRef:
+ name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }}
+ {{- end }}
+ {{- if .Values.resources }}
+ resources: {{- toYaml .Values.resources | nindent 12 }}
+ {{- end }}
+ ports:
+ {{- range $key, $value := .Values.service.ports }}
+ - name: {{ $key }}
+ containerPort: {{ $value.port }}
+ protocol: {{ $value.protocol }}
+ {{- end }}
+ {{- if .Values.healthCheck.livenessProbe.enabled }}
+ livenessProbe:
+ {{- if eq .Values.healthCheck.type "http" }}
+ httpGet:
+ path: {{ .Values.healthCheck.livenessProbe.httpPath }}
+ port: {{ .Values.healthCheck.port }}
+ {{- else }}
+ tcpSocket:
+ port: {{ .Values.healthCheck.port }}
+ {{- end }}
+ initialDelaySeconds: {{ .Values.healthCheck.livenessProbe.initialDelaySeconds }}
+ periodSeconds: {{ .Values.healthCheck.livenessProbe.periodSeconds }}
+ timeoutSeconds: {{ .Values.healthCheck.livenessProbe.timeoutSeconds }}
+ successThreshold: {{ .Values.healthCheck.livenessProbe.successThreshold }}
+ failureThreshold: {{ .Values.healthCheck.livenessProbe.failureThreshold }}
+ {{- else if .Values.customLivenessProbe }}
+ livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customLivenessProbe "context" $) | nindent 12 }}
+ {{- end }}
+ {{- if .Values.healthCheck.readinessProbe.enabled }}
+ readinessProbe:
+ {{- if eq .Values.healthCheck.type "http" }}
+ httpGet:
+ path: {{ .Values.healthCheck.readinessProbe.httpPath }}
+ port: {{ .Values.healthCheck.port }}
+ {{- else }}
+ tcpSocket:
+ port: {{ .Values.healthCheck.port }}
+ {{- end }}
+ initialDelaySeconds: {{ .Values.healthCheck.readinessProbe.initialDelaySeconds }}
+ periodSeconds: {{ .Values.healthCheck.readinessProbe.periodSeconds }}
+ timeoutSeconds: {{ .Values.healthCheck.readinessProbe.timeoutSeconds }}
+ successThreshold: {{ .Values.healthCheck.readinessProbe.successThreshold }}
+ failureThreshold: {{ .Values.healthCheck.readinessProbe.failureThreshold }}
+ {{- else if .Values.customReadinessProbe }}
+ readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customReadinessProbe "context" $) | nindent 12 }}
+ {{- end }}
+ volumeMounts:
+ {{- if .Values.config.enabled }}
+ - name: {{ include "common.names.name" . }}-conf
+ mountPath: {{ .Values.config.mountPath }}
+ subPath: {{ .Values.config.subPath }}
+ readOnly: {{ .Values.config.readOnly }}
+ {{- end }}
+ {{- if .Values.existConfig.enabled }}
+ - name: {{ include "common.names.name" . }}-exist-conf
+ mountPath: {{ .Values.existConfig.mountPath }}
+ subPath: {{ .Values.existConfig.subPath }}
+ readOnly: {{ .Values.existConfig.readOnly }}
+ {{- end }}
+ {{- if .Values.secret.enabled }}
+ - name: {{ include "common.names.name" . }}-secret
+ mountPath: {{ .Values.secret.mountPath }}
+ subPath: {{ .Values.secret.subPath }}
+ readOnly: {{ .Values.secret.readOnly }}
+ {{- end }}
+ {{- if .Values.existSecret.enabled }}
+ - name: {{ include "common.names.name" . }}-exist-secret
+ mountPath: {{ .Values.existSecret.mountPath }}
+ subPath: {{ .Values.existSecret.subPath }}
+ readOnly: {{ .Values.existSecret.readOnly }}
+ {{- end }}
+ {{- if .Values.persistence.mountPaths }}
+ {{- toYaml .Values.persistence.mountPaths | nindent 12 }}
+ {{- end }}
+ {{- if .Values.extraVolumeMounts }}
+ {{- toYaml .Values.extraVolumeMounts | nindent 12 }}
+ {{- end }}
+ {{- if .Values.sidecars }}
+ {{- include "common.tplvalues.render" (dict "value" .Values.sidecars "context" $) | nindent 8 }}
+ {{- end }}
+ volumes:
+ {{- if .Values.config.enabled }}
+ - name: {{ include "common.names.name" . }}-conf
+ configMap:
+ name: {{ include "common.names.fullname" . }}
+ {{- end }}
+ {{- if .Values.existConfig.enabled }}
+ - name: {{ include "common.names.name" . }}-exist-conf
+ configMap:
+ name: {{ .Values.existConfig.name }}
+ {{- end }}
+ {{- if .Values.secret.enabled }}
+ - name: {{ include "common.names.name" . }}-secret
+ secret:
+ secretName: {{ include "common.names.fullname" . }}
+ {{- end }}
+ {{- if .Values.existSecret.enabled }}
+ - name: {{ include "common.names.name" . }}-exist-secret
+ secret:
+ secretName: {{ .Values.existSecret.name }}
+ {{- end }}
+ {{- if .Values.extraVolumes }}
+ {{- toYaml .Values.extraVolumes | nindent 8 }}
+ {{- end }}
+{{- if not .Values.statefulset.enabled }}
+ {{- if .Values.persistence.enabled }}
+ - name: data-storage
+ persistentVolumeClaim:
+ claimName: {{ .Values.persistence.existingClaim | default (include "common.names.fullname" .) }}
+ {{- else }}
+ - name: data-storage
+ emptyDir: {}
+ {{- end }}
+{{- else }}
+ {{- if .Values.persistence.enabled }}
+ volumeClaimTemplates:
+ - metadata:
+ name: data-storage
+ {{- if .Values.persistence.annotations }}
+ annotations: {{- toYaml .Values.persistence.annotations | nindent 10 }}
+ {{- end }}
+ spec:
+ accessModes:
+ - {{ .Values.persistence.accessMode | quote }}
+ annotations:
+ {{- range $key, $value := $.Values.persistence.annotations }}
+ {{ $key }}: {{ $value }}
+ {{- end }}
+ resources:
+ requests:
+ storage: {{ .Values.persistence.size }}
+ {{- if .Values.persistence.storageClass }}
+ {{- if (eq "-" .Values.persistence.storageClass) }}
+ storageClassName: ""
+ {{- else }}
+ storageClassName: "{{ .Values.persistence.storageClass }}"
+ {{- end }}
+ {{- end }}
+ {{- else }}
+ - name: data-storage
+ emptyDir: {}
+ {{- end }}
+{{- end -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/extra-list.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/extra-list.yaml
new file mode 100644
index 0000000..9ac65f9
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/extra-list.yaml
@@ -0,0 +1,4 @@
+{{- range .Values.extraDeploy }}
+---
+{{ include "common.tplvalues.render" (dict "value" . "context" $) }}
+{{- end }}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/hpa.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/hpa.yaml
new file mode 100644
index 0000000..d837da3
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/hpa.yaml
@@ -0,0 +1,46 @@
+{{- if .Values.autoscaling.enabled }}
+apiVersion: {{ include "common.capabilities.hpa.apiVersion" ( dict "context" $ ) }}
+kind: HorizontalPodAutoscaler
+metadata:
+ name: {{ template "common.names.fullname" . }}
+ namespace: {{ .Release.Namespace | quote }}
+ labels: {{- include "common.labels.standard" . | nindent 4 }}
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- if .Values.commonAnnotations }}
+ annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+spec:
+ scaleTargetRef:
+ apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
+ kind: Deployment
+ name: {{ template "common.names.fullname" . }}
+ minReplicas: {{ .Values.autoscaling.minReplicas }}
+ maxReplicas: {{ .Values.autoscaling.maxReplicas }}
+ metrics:
+ {{- if .Values.autoscaling.targetMemory }}
+ - type: Resource
+ resource:
+ name: memory
+ {{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }}
+ targetAverageUtilization: {{ .Values.autoscaling.targetMemory }}
+ {{- else }}
+ target:
+ type: Utilization
+ averageUtilization: {{ .Values.autoscaling.targetMemory }}
+ {{- end }}
+ {{- end }}
+ {{- if .Values.autoscaling.targetCPU }}
+ - type: Resource
+ resource:
+ name: cpu
+ {{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }}
+ targetAverageUtilization: {{ .Values.autoscaling.targetCPU }}
+ {{- else }}
+ target:
+ type: Utilization
+ averageUtilization: {{ .Values.autoscaling.targetCPU }}
+ {{- end }}
+ {{- end }}
+{{- end }}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/ingress.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/ingress.yaml
new file mode 100644
index 0000000..c5ec875
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/ingress.yaml
@@ -0,0 +1,60 @@
+{{- if .Values.ingress.enabled }}
+apiVersion: {{ include "common.capabilities.ingress.apiVersion" . }}
+kind: Ingress
+metadata:
+ name: {{ include "common.names.fullname" . }}
+ namespace: {{ include "common.names.namespace" . | quote }}
+ labels: {{- include "common.labels.standard" . | nindent 4 }}
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ annotations:
+ {{- if .Values.ingress.annotations }}
+ {{- include "common.tplvalues.render" (dict "value" .Values.ingress.annotations "context" $) | nindent 4 }}
+ {{- end }}
+ {{- if .Values.commonAnnotations }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+spec:
+ {{- if and .Values.ingress.ingressClassName (eq "true" (include "common.ingress.supportsIngressClassname" .)) }}
+ ingressClassName: {{ .Values.ingress.ingressClassName | quote }}
+ {{- end }}
+ rules:
+ {{- if .Values.ingress.hostname }}
+ - host: {{ .Values.ingress.hostname }}
+ http:
+ paths:
+ {{- if .Values.ingress.extraPaths }}
+ {{- toYaml .Values.ingress.extraPaths | nindent 10 }}
+ {{- end }}
+ - path: {{ .Values.ingress.path }}
+ {{- if eq "true" (include "common.ingress.supportsPathType" .) }}
+ pathType: {{ .Values.ingress.pathType }}
+ {{- end }}
+ backend: {{- include "common.ingress.backend" (dict "serviceName" (include "common.names.fullname" .) "servicePort" "http" "context" $) | nindent 14 }}
+ {{- end }}
+ {{- range .Values.ingress.extraHosts }}
+ - host: {{ .name | quote }}
+ http:
+ paths:
+ - path: {{ default "/" .path }}
+ {{- if eq "true" (include "common.ingress.supportsPathType" $) }}
+ pathType: {{ default "ImplementationSpecific" .pathType }}
+ {{- end }}
+ backend: {{- include "common.ingress.backend" (dict "serviceName" (include "common.names.fullname" $) "servicePort" "http" "context" $) | nindent 14 }}
+ {{- end }}
+ {{- if .Values.ingress.extraRules }}
+ {{- include "common.tplvalues.render" (dict "value" .Values.ingress.extraRules "context" $) | nindent 4 }}
+ {{- end }}
+ {{- if or (and .Values.ingress.tls (or (include "common.ingress.certManagerRequest" ( dict "annotations" .Values.ingress.annotations )) .Values.ingress.selfSigned)) .Values.ingress.extraTls }}
+ tls:
+ {{- if and .Values.ingress.tls (or (include "common.ingress.certManagerRequest" ( dict "annotations" .Values.ingress.annotations )) .Values.ingress.selfSigned) }}
+ - hosts:
+ - {{ .Values.ingress.hostname | quote }}
+ secretName: {{ printf "%s-tls" .Values.ingress.hostname }}
+ {{- end }}
+ {{- if .Values.ingress.extraTls }}
+ {{- include "common.tplvalues.render" (dict "value" .Values.ingress.extraTls "context" $) | nindent 4 }}
+ {{- end }}
+ {{- end }}
+{{- end }}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/job.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/job.yaml
new file mode 100644
index 0000000..7d2f2f1
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/job.yaml
@@ -0,0 +1,78 @@
+{{- if .Values.initDB.enabled }}
+apiVersion: batch/v1
+kind: Job
+metadata:
+ name: {{ include "common.names.fullname" . }}-init-db
+ annotations:
+ "helm.sh/hook-weight": "-1"
+ "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
+ {{- if .Values.commonAnnotations }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+ labels: {{- include "common.labels.standard" . | nindent 4 }}
+ app.kubernetes.io/component: mysql
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+spec:
+ template:
+ metadata:
+ labels: {{- include "common.labels.standard" . | nindent 8 }}
+ app.kubernetes.io/component: mysql
+ spec:
+ {{- if .Values.nodeSelector }}
+ nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }}
+ {{- end }}
+ {{- if .Values.tolerations }}
+ tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" $) | nindent 8 }}
+ {{- end }}
+
+ {{- if .Values.affinity }}
+ affinity: {{- include "common.tplvalues.render" (dict "value" .Values.affinity "context" $) | nindent 8 }}
+ {{- else }}
+ affinity:
+ podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "context" $) | nindent 10 }}
+ podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "context" $) | nindent 10 }}
+ nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }}
+ {{- end }}
+{{- include "nacos.imagePullSecrets" . | nindent 6 }}
+ containers:
+ - name: import-nacos-mysql-sql
+ image: {{ template "nacos.initDB.image" . }}
+ imagePullPolicy: {{ .Values.initDB.image.pullPolicy }}
+ env:
+ - name: SQL_FILES
+ valueFrom:
+ configMapKeyRef:
+ name: {{ include "common.names.fullname" . }}
+ key: sql_files
+ - name: MYSQL_HOST
+ valueFrom:
+ secretKeyRef:
+ name: {{ include "common.names.fullname" . }}
+ key: mysqlMasterHost
+ - name: MYSQL_DB
+ valueFrom:
+ secretKeyRef:
+ name: {{ include "common.names.fullname" . }}
+ key: mysqlDatabase
+ - name: MYSQL_PORT
+ valueFrom:
+ secretKeyRef:
+ name: {{ include "common.names.fullname" . }}
+ key: mysqlMasterPort
+ - name: MYSQL_USER
+ valueFrom:
+ secretKeyRef:
+ name: {{ include "common.names.fullname" . }}
+ key: mysqlMasterUser
+ - name: MYSQL_PASSWD
+ valueFrom:
+ secretKeyRef:
+ name: {{ include "common.names.fullname" . }}
+ key: mysqlMasterPassword
+ restartPolicy: OnFailure
+ parallelism: 1
+ completions: 1
+ backoffLimit: 6
+{{- end }}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/networkpolicy.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/networkpolicy.yaml
new file mode 100644
index 0000000..7010a89
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/networkpolicy.yaml
@@ -0,0 +1,43 @@
+{{- if .Values.networkPolicy.enabled }}
+kind: NetworkPolicy
+apiVersion: {{ include "common.capabilities.networkPolicy.apiVersion" . }}
+metadata:
+ name: {{ include "common.names.fullname" . }}
+ namespace: {{ .Release.Namespace }}
+ labels:
+ {{- include "common.labels.standard" . | nindent 4 }}
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- if .Values.commonAnnotations }}
+ annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+ namespace: {{ .Release.Namespace }}
+spec:
+ podSelector:
+ matchLabels:
+ {{- include "common.labels.matchLabels" . | nindent 6 }}
+ ingress:
+ # Allow inbound connections
+ - ports:
+ - port: {{ template "nacos.service.ingressPort" . }}
+ {{- if not .Values.networkPolicy.allowExternal }}
+ from:
+ - podSelector:
+ matchLabels:
+ {{ template "common.names.fullname" . }}-client: "true"
+ {{- if .Values.networkPolicy.explicitNamespacesSelector }}
+ namespaceSelector:
+ {{- toYaml .Values.networkPolicy.explicitNamespacesSelector | nindent 12 }}
+ {{- end }}
+ - podSelector:
+ matchLabels:
+ {{- include "common.labels.matchLabels" . | nindent 14 }}
+ role: read
+ {{- end }}
+ {{- if .Values.metrics.enabled }}
+ # Allow prometheus scrapes
+ - ports:
+ - port: 9187
+ {{- end }}
+{{- end }}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/pdb.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/pdb.yaml
new file mode 100644
index 0000000..f82d278
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/pdb.yaml
@@ -0,0 +1,23 @@
+{{- if .Values.pdb.create }}
+apiVersion: {{ include "common.capabilities.policy.apiVersion" . }}
+kind: PodDisruptionBudget
+metadata:
+ name: {{ template "common.names.fullname" . }}
+ namespace: {{ .Release.Namespace | quote }}
+ labels: {{- include "common.labels.standard" . | nindent 4 }}
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- if .Values.commonAnnotations }}
+ annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+spec:
+ {{- if .Values.pdb.minAvailable }}
+ minAvailable: {{ .Values.pdb.minAvailable }}
+ {{- end }}
+ {{- if .Values.pdb.maxUnavailable }}
+ maxUnavailable: {{ .Values.pdb.maxUnavailable }}
+ {{- end }}
+ selector:
+ matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
+{{- end }}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/prometheusrules.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/prometheusrules.yaml
new file mode 100644
index 0000000..afa4843
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/prometheusrules.yaml
@@ -0,0 +1,25 @@
+{{- if and .Values.metrics.enabled .Values.metrics.prometheusRule.enabled }}
+apiVersion: monitoring.coreos.com/v1
+kind: PrometheusRule
+metadata:
+ name: {{ include "common.names.fullname" . }}
+ {{- if .Values.metrics.prometheusRule.namespace }}
+ namespace: {{ .Values.metrics.prometheusRule.namespace }}
+ {{- else }}
+ namespace: {{ .Release.Namespace }}
+ {{- end }}
+ labels: {{- include "common.labels.standard" . | nindent 4 }}
+ app.kubernetes.io/component: nginx
+ app.kubernetes.io/component: metrics
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.prometheusRule.additionalLabels "context" $ ) | nindent 4 }}
+ {{- if .Values.commonAnnotations }}
+ annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+spec:
+ groups:
+ - name: {{ include "common.names.fullname" . }}
+ rules: {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.prometheusRule.rules "context" $ ) | nindent 6 }}
+{{- end }}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/pvc.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/pvc.yaml
new file mode 100644
index 0000000..219f7db
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/pvc.yaml
@@ -0,0 +1,38 @@
+{{- if not .Values.statefulset.enabled -}}
+{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+ name: {{ include "common.names.fullname" . }}
+ namespace: {{ .Release.Namespace | quote }}
+ labels: {{- include "common.labels.standard" . | nindent 4 }}
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- if or .Values.persistence.annotations .Values.commonAnnotations }}
+ annotations:
+ {{- if .Values.commonAnnotations }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- if .Values.persistence.annotations }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.persistence.annotations "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- end }}
+spec:
+ accessModes:
+ {{- if not (empty .Values.persistence.accessModes) }}
+ {{- range .Values.persistence.accessModes }}
+ - {{ . | quote }}
+ {{- end }}
+ {{- else }}
+ - {{ .Values.persistence.accessMode | quote }}
+ {{- end }}
+ resources:
+ requests:
+ storage: {{ .Values.persistence.size | quote }}
+ {{- include "common.storage.class" (dict "persistence" .Values.persistence "global" .Values.global) | nindent 2 }}
+ {{- if .Values.persistence.dataSource }}
+ dataSource: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.dataSource "context" $) | nindent 4 }}
+ {{- end }}
+{{- end }}
+{{- end -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/secret.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/secret.yaml
new file mode 100644
index 0000000..7086174
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/secret.yaml
@@ -0,0 +1,32 @@
+apiVersion: v1
+kind: Secret
+metadata:
+ name: {{ template "common.names.fullname" . }}
+ namespace: {{ .Release.Namespace | quote }}
+ labels: {{- include "common.labels.standard" . | nindent 4 }}
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- if .Values.commonAnnotations }}
+ annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+type: Opaque
+data:
+{{- if not .Values.mysql.enabled }}
+{{- range $key, $value := .Values.mysql.external }}
+ {{ $key }}: {{ $value | b64enc | quote }}
+{{- end }}
+{{- else }}
+ mysqlMasterHost: {{ (include "nacos.mysql.primaryHost" .) | b64enc | quote }}
+ mysqlDatabase: {{ .Values.mysql.auth.database | b64enc | quote }}
+ mysqlMasterPort: {{ "3306" | b64enc }}
+ mysqlMasterUser: {{ .Values.mysql.auth.username | b64enc | quote }}
+ mysqlMasterPassword: {{ .Values.mysql.auth.password | b64enc | quote }}
+ mysqlSlaveHost: {{ (include "nacos.mysql.secondaryHost" .) | b64enc | quote }}
+ mysqlSlavePort: {{ "3306" | b64enc }}
+{{- end }}
+{{- if .Values.secret.enabled }}
+{{- range $key, $value := .Values.secret.data }}
+ {{ $key }}: {{ $value | b64enc | quote }}
+{{- end }}
+{{- end }}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/service-headless.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/service-headless.yaml
new file mode 100644
index 0000000..cf600f7
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/service-headless.yaml
@@ -0,0 +1,23 @@
+{{- if .Values.statefulset.enabled }}
+apiVersion: v1
+kind: Service
+metadata:
+ annotations:
+ # 1.13 以前版本
+ #service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
+ name: {{ printf "%s-headless" (include "common.names.fullname" .) }}
+ namespace: {{ .Release.Namespace }}
+ labels: {{- include "common.labels.standard" . | nindent 4 }}
+spec:
+ type: ClusterIP
+ clusterIP: None
+ # 1.13 以后版本
+ publishNotReadyAddresses: true
+ ports:
+ {{- range $key, $value := .Values.service.ports }}
+ - name: {{ $key }}
+ targetPort: {{ $key }}
+ {{- toYaml $value | nindent 6 }}
+ {{- end }}
+ selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
+{{- end -}}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/service.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/service.yaml
new file mode 100644
index 0000000..6f58b3c
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/service.yaml
@@ -0,0 +1,42 @@
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ template "common.names.fullname" . }}
+ namespace: {{ .Release.Namespace }}
+ labels: {{- include "common.labels.standard" . | nindent 4 }}
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- if or .Values.service.annotations .Values.commonAnnotations }}
+ annotations:
+ {{- if .Values.service.annotations }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.service.annotations "context" $) | nindent 4 }}
+ {{- end }}
+ {{- if .Values.commonAnnotations }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- if and .Values.metrics.enabled .Values.metrics.service.annotations }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.service.annotations "context" $) | nindent 4 }}
+ {{- end }}
+ {{- end }}
+spec:
+ type: {{ .Values.service.type }}
+ {{- if and .Values.service.loadBalancerIP (eq .Values.service.type "LoadBalancer") }}
+ loadBalancerIP: {{ .Values.service.loadBalancerIP }}
+ {{- end }}
+ {{- if and (eq .Values.service.type "LoadBalancer") .Values.service.loadBalancerSourceRanges }}
+ loadBalancerSourceRanges: {{- toYaml .Values.service.loadBalancerSourceRanges | nindent 4 }}
+ {{- end }}
+ {{- if and (eq .Values.service.type "ClusterIP") .Values.service.clusterIP }}
+ clusterIP: {{ .Values.service.clusterIP }}
+ {{- end }}
+ {{- if and .Values.service.externalTrafficPolicy (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }}
+ externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }}
+ {{- end }}
+ ports:
+ {{- range $key, $value := .Values.service.ports }}
+ - name: {{ $key }}
+ targetPort: {{ $key }}
+ {{- toYaml $value | nindent 6 }}
+ {{- end }}
+ selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/serviceaccount.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/serviceaccount.yaml
new file mode 100644
index 0000000..bf2c50c
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/serviceaccount.yaml
@@ -0,0 +1,21 @@
+{{- if .Values.serviceAccount.create }}
+apiVersion: v1
+kind: ServiceAccount
+automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
+metadata:
+ name: {{ template "nacos.serviceAccountName" . }}
+ namespace: {{ .Release.Namespace | quote }}
+ labels: {{- include "common.labels.standard" . | nindent 4 }}
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- if or .Values.commonAnnotations .Values.serviceAccount.annotations }}
+ annotations:
+ {{- if or .Values.commonAnnotations }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- if .Values.serviceAccount.annotations }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.serviceAccount.annotations "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- end }}
+{{- end }}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/servicemonitor.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/servicemonitor.yaml
new file mode 100644
index 0000000..a9cc17b
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/servicemonitor.yaml
@@ -0,0 +1,45 @@
+{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }}
+apiVersion: monitoring.coreos.com/v1
+kind: ServiceMonitor
+metadata:
+ name: {{ template "common.names.fullname" . }}
+ {{- if .Values.metrics.serviceMonitor.namespace }}
+ namespace: {{ .Values.metrics.serviceMonitor.namespace }}
+ {{- end }}
+ labels: {{- include "common.labels.standard" . | nindent 4 }}
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- if .Values.metrics.serviceMonitor.additionalLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.serviceMonitor.additionalLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- if .Values.commonAnnotations }}
+ annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+spec:
+ selector:
+ matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
+ {{- if .Values.metrics.serviceMonitor.selector }}
+ {{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.selector "context" $) | nindent 6 }}
+ {{- end }}
+ endpoints:
+ - port: metrics
+ path: /metrics
+ {{- if .Values.metrics.serviceMonitor.interval }}
+ interval: {{ .Values.metrics.serviceMonitor.interval }}
+ {{- end }}
+ {{- if .Values.metrics.serviceMonitor.scrapeTimeout }}
+ scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }}
+ {{- end }}
+ {{- if .Values.metrics.serviceMonitor.relabelings }}
+ relabelings:
+ {{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.relabelings "context" $) | nindent 8 }}
+ {{- end }}
+ {{- if .Values.metrics.serviceMonitor.metricRelabelings }}
+ metricRelabelings:
+ {{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.metricRelabelings "context" $) | nindent 8 }}
+ {{- end }}
+ namespaceSelector:
+ matchNames:
+ - {{ .Release.Namespace }}
+{{- end }}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/test/test-nacos.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/test/test-nacos.yaml
new file mode 100644
index 0000000..4e79a59
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/test/test-nacos.yaml
@@ -0,0 +1,18 @@
+apiVersion: v1
+kind: Pod
+metadata:
+ name: {{ include "common.names.fullname" . }}-test
+ annotations:
+ "helm.sh/hook": test-success
+ "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
+spec:
+ containers:
+ - name: {{ .Release.Name }}-test
+ image: nginx:latest
+ command: ["sh", "-c", "curl -I -m 10 -o /dev/null -s -w %{http_code} http://$NACOS_SERVICE_HOST:$NACOS_SERVER_PORT/nacos/"]
+ env:
+ - name: NACOS_SERVER_PORT
+ value: "8848"
+ - name: NACOS_SERVICE_HOST
+ value: {{ include "common.names.fullname" . }}
+ restartPolicy: Never
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/tls-secrets.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/tls-secrets.yaml
new file mode 100644
index 0000000..29ef17b
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/templates/tls-secrets.yaml
@@ -0,0 +1,44 @@
+{{- if .Values.ingress.enabled }}
+{{- if .Values.ingress.secrets }}
+{{- range .Values.ingress.secrets }}
+apiVersion: v1
+kind: Secret
+metadata:
+ name: {{ .name }}
+ namespace: {{ $.Release.Namespace }}
+ labels: {{- include "common.labels.standard" $ | nindent 4 }}
+ {{- if $.Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" $.Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- if $.Values.commonAnnotations }}
+ annotations: {{- include "common.tplvalues.render" ( dict "value" $.Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+type: kubernetes.io/tls
+data:
+ tls.crt: {{ .certificate | b64enc }}
+ tls.key: {{ .key | b64enc }}
+---
+{{- end }}
+{{- end }}
+{{- if and .Values.ingress.tls .Values.ingress.selfSigned }}
+{{- $ca := genCA "nacos-ca" 365 }}
+{{- $cert := genSignedCert .Values.ingress.hostname nil (list .Values.ingress.hostname) 365 $ca }}
+apiVersion: v1
+kind: Secret
+metadata:
+ name: {{ printf "%s-tls" .Values.ingress.hostname }}
+ namespace: {{ .Release.Namespace }}
+ labels: {{- include "common.labels.standard" . | nindent 4 }}
+ {{- if .Values.commonLabels }}
+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
+ {{- end }}
+ {{- if .Values.commonAnnotations }}
+ annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
+ {{- end }}
+type: kubernetes.io/tls
+data:
+ tls.crt: {{ $cert.Cert | b64enc | quote }}
+ tls.key: {{ $cert.Key | b64enc | quote }}
+ ca.crt: {{ $ca.Cert | b64enc | quote }}
+{{- end }}
+{{- end }}
diff --git a/source/src/main/java/io/wdd/source/nacos-2.1.2/values.yaml b/source/src/main/java/io/wdd/source/nacos-2.1.2/values.yaml
new file mode 100644
index 0000000..2bbe328
--- /dev/null
+++ b/source/src/main/java/io/wdd/source/nacos-2.1.2/values.yaml
@@ -0,0 +1,803 @@
+## @section Global parameters
+## Global Docker image parameters
+## Please, note that this will override the image parameters, including dependencies, configured to use the global value
+## Current available global Docker image parameters: imageRegistry, imagePullSecrets and storageClass
+
+## @param global.imageRegistry Global Docker image registry
+## @param global.imagePullSecrets Global Docker registry secret names as an array
+## @param global.storageClass Global StorageClass for Persistent Volume(s)
+##
+global:
+ imageRegistry: ""
+ ## E.g.
+ ## imagePullSecrets:
+ ## - myRegistryKeySecretName
+ ##
+ imagePullSecrets: []
+ storageClass: ""
+
+## @section Common parameters
+
+## @param nameOverride String to partially override nginx.fullname template (will maintain the release name)
+##
+nameOverride: ""
+## @param fullnameOverride String to fully override nginx.fullname template
+##
+fullnameOverride: ""
+## @param kubeVersion Force target Kubernetes version (using Helm capabilities if not set)
+##
+kubeVersion: ""
+## @param clusterDomain Kubernetes Cluster Domain
+##
+clusterDomain: wdd.io
+## @param extraDeploy Extra objects to deploy (value evaluated as a template)
+##
+extraDeploy: []
+## @param commonLabels Add labels to all the deployed resources
+##
+commonLabels: {}
+## @param commonAnnotations Add annotations to all the deployed resources
+##
+commonAnnotations: {}
+
+## Deployment or Statefulset
+statefulset:
+ enabled: true
+
+## @param replicaCount Number of replicas to deploy
+##
+replicaCount: 1
+
+## @section Tomcat parameters
+##
+
+## Bitnami Tomcat image version
+## ref: https://hub.docker.com/r/bitnami/tomcat/tags/
+## @param image.registry Tomcat image registry
+## @param image.repository Tomcat image repository
+## @param image.tag Tomcat image tag (immutable tags are recommended)
+## @param image.pullPolicy Tomcat image pull policy
+## @param image.pullSecrets Specify docker-registry secret names as an array
+## @param image.debug Specify if debug logs should be enabled
+##
+image:
+ registry: docker.io
+ repository: nacos/nacos-server
+ tag: v2.1.0
+ ## Specify a imagePullPolicy
+ ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
+ ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images
+ ##
+ pullPolicy: IfNotPresent
+ ## Optionally specify an array of imagePullSecrets.
+ ## Secrets must be manually created in the namespace.
+ ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
+ ## Example:
+ ## pullSecrets:
+ ## - myRegistryKeySecretName
+ ##
+ pullSecrets: []
+
+## Kubernetes svc configuration
+##
+service:
+ ## 支持ClusterIP修改为LoadBalancer,反之不允许。可手动修改svc,并将nodePort去掉
+ type: ClusterIP # 一般不用修改, 支持ClusterIP/LoadBalancer/NodePort
+ loadBalancerIP: ""
+ ## Enable client source IP preservation
+ ## @param service.externalTrafficPolicy External traffic policy, configure to Local to preserve client source IP when using an external loadBalancer
+ ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip
+ ##
+ externalTrafficPolicy: Cluster # 支持Cluster/Local
+ ports:
+ ## 多端口暴露时,复制一段
+ http:
+ port: 8848 # Service port number for client-a port.
+ protocol: TCP # Service port protocol for client-a port.
+ ## Use nodePorts to requets some specific ports when usin NodePort
+ # nodePort: 30020 # 默认会自动生成
+ ## @param service.loadBalancerSourceRanges Addresses that are allowed when service is LoadBalancer
+ ## https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service
+ ## e.g:
+ ## loadBalancerSourceRanges:
+ ## - 10.10.10.0/24
+ ##
+ loadBalancerSourceRanges: []
+ ## @param service.clusterIP Static clusterIP or None for headless services
+ ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#choosing-your-own-ip-address
+ ## e.g:
+ ## clusterIP: None
+ ##
+ clusterIP: ""
+ ## @param service.annotations Annotations for Logstash service
+ ##
+ annotations: {}
+
+## @param extraEnvVars Extra environment variables to be set on MinIO® container
+## e.g:
+## extraEnvVars:
+## - name: FOO
+## value: "bar"
+##
+extraEnvVars:
+ - name: PREFER_HOST_MODE
+ value: "hostname"
+ - name: TZ
+ value: "Asia/Shanghai"
+## @param extraEnvVarsCM ConfigMap with extra environment variables
+##
+extraEnvVarsCM: ""
+## @param extraEnvVarsSecret Secret with extra environment variables
+##
+extraEnvVarsSecret: ""
+## @param command Default container command (useful when using custom images). Use array form
+##
+command: []
+## @param args Default container args (useful when using custom images). Use array form
+##
+args: []
+
+## @param querier.podManagementPolicy podManagementPolicy to manage scaling operation
+## ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#pod-management-policies
+##
+podManagementPolicy: ""
+
+## Enable configmap and add data in configmap
+config:
+ enabled: false
+ mountPath: /conf
+ subPath: ""
+ readOnly: true
+ data: {}
+
+## 使用已存在的configmap映射到相应目录或文件路径
+existConfig:
+ enabled: false
+ name: ""
+ mountPath: /exist/conf
+ subPath: ""
+ readOnly: true
+
+## To use an additional secret, set enable to true and add data
+secret:
+ enabled: false
+ mountPath: /etc/secret-volume
+ subPath: ""
+ readOnly: true
+ data: {}
+
+## 使用已存在的secret映射到相应目录或文件路径
+existSecret:
+ enabled: false
+ name: ""
+ mountPath: /exist/secret-volume
+ subPath: ""
+ readOnly: true
+
+## @param customLivenessProbe Override default liveness probe
+##
+customLivenessProbe: {}
+## @param customReadinessProbe Override default readiness probe
+##
+customReadinessProbe: {}
+
+## liveness and readiness
+## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/
+healthCheck:
+ type: http # http/tcp
+ port: http # 上面的端口名或端口
+ httpPath: '/' # http时必须设置
+ livenessProbe:
+ enabled: true
+ httpPath: '/nacos/v1/console/health/liveness' # http时必须设置
+ initialDelaySeconds: 60 # 初始延迟秒数, k8s默认值为0,最小为0
+ periodSeconds: 30 # 检测周期,k8s默认值10,最小为1
+ # timeoutSeconds: 3 # 检测超时,k8s默认值1,最小为1
+ # successThreshold: 1 # 失败后成功次数,k8s默认值1,最小为1,只能设置为1
+ # failureThreshold: 5 # 失败后重试次数,k8s默认值3,最小为1
+ readinessProbe:
+ enabled: true
+ httpPath: '/nacos/v1/console/health/readiness' # http时必须设置
+ initialDelaySeconds: 60 # 初始延迟秒数, k8s默认值为0,最小为0
+ periodSeconds: 30 # 检测周期,k8s默认值10,最小为1
+ # timeoutSeconds: 3 # 检测超时,k8s默认值1,最小为1
+ # successThreshold: 1 # 失败后成功次数,k8s默认值1,最小为1,只能设置为1
+ # failureThreshold: 5 # 失败后重试次数,k8s默认值3,最小为1
+
+## nacos containers' resource requests and limits
+## ref: https://kubernetes.io/docs/user-guide/compute-resources/
+## We usually recommend not to specify default resources and to leave this as a conscious
+## choice for the user. This also increases chances charts run on environments with little
+## resources, such as Minikube. If you do want to specify resources, uncomment the following
+## lines, adjust them as necessary, and remove the curly braces after 'resources:'.
+## @param resources.limits The resources limits for the nacos container
+## @param resources.requests The requested resources for the nacos container
+resources: {}
+# limits:
+# cpu: 100m
+# memory: 128Mi
+# requests:
+# cpu: 100m
+# memory: 128Mi
+
+## @param updateStrategy.type nacos deployment strategy type
+## @param updateStrategy.rollingUpdate nacos deployment rolling update configuration parameters
+## ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy
+##
+updateStrategy: {}
+# type: RollingUpdate
+# rollingUpdate: {}
+## @param podLabels Additional labels for nacos pods
+## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
+##
+podLabels: {}
+## @param podAnnotations Annotations for nacos pods
+## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
+##
+podAnnotations:
+ pod.alpha.kubernetes.io/initialized: "true"
+## @param podAffinityPreset Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard`
+## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
+##
+podAffinityPreset: ""
+## @param podAntiAffinityPreset Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard`
+## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
+##
+podAntiAffinityPreset: soft
+## Node affinity preset
+## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
+##
+nodeAffinityPreset:
+ ## @param nodeAffinityPreset.type Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard`
+ ##
+ type: ""
+ ## @param nodeAffinityPreset.key Node label key to match Ignored if `affinity` is set.
+ ## E.g.
+ ## key: "kubernetes.io/e2e-az-name"
+ ##
+ key: ""
+ ## @param nodeAffinityPreset.values Node label values to match. Ignored if `affinity` is set.
+ ## E.g.
+ ## values:
+ ## - e2e-az1
+ ## - e2e-az2
+ ##
+ values: []
+## @param affinity Affinity for pod assignment
+## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
+## Note: podAffinityPreset, podAntiAffinityPreset, and nodeAffinityPreset will be ignored when it's set
+##
+affinity: {}
+## @param hostNetwork Specify if host network should be enabled for nacos pod
+##
+hostNetwork: false
+## @param hostIPC Specify if host IPC should be enabled for nacos pod
+##
+hostIPC: false
+## @param nodeSelector Node labels for pod assignment. Evaluated as a template.
+## Ref: https://kubernetes.io/docs/user-guide/node-selection/
+##
+nodeSelector: {}
+## @param tolerations Tolerations for pod assignment. Evaluated as a template.
+## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
+##
+tolerations: {}
+## @param priorityClassName Priority class name
+## ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#priorityclass
+##
+priorityClassName: ""
+## nacos pods' Security Context.
+## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod
+## @param podSecurityContext.enabled Enabled nacos pods' Security Context
+## @param podSecurityContext.fsGroup Set nacos pod's Security Context fsGroup
+## @param podSecurityContext.sysctls sysctl settings of the nacos pods
+##
+podSecurityContext:
+ enabled: false
+ fsGroup: 5001
+ ## sysctl settings
+ ## Example:
+ ## sysctls:
+ ## - name: net.core.somaxconn
+ ## value: "10000"
+ ##
+ sysctls: []
+## nacos containers' Security Context.
+## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container
+## @param containerSecurityContext.enabled Enabled nacos containers' Security Context
+## @param containerSecurityContext.runAsUser Set nacos container's Security Context runAsUser
+## @param containerSecurityContext.runAsNonRoot Set nacos container's Security Context runAsNonRoot
+##
+containerSecurityContext:
+ enabled: false
+ runAsUser: 5001
+ runAsNonRoot: true
+
+## @param Pod's DNS Policy
+## https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy
+dnsPolicy: "" # ClusterFirst/ClusterFirstWithHostNet ...
+
+## @param hostAliases Deployment pod host aliases
+## https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/
+##
+hostAliases: []
+# - ip: "192.168.1.100"
+# hostnames:
+# - "example.local"
+
+## Autoscaling parameters
+## @param autoscaling.enabled Enable autoscaling for nacos deployment
+## @param autoscaling.minReplicas Minimum number of replicas to scale back
+## @param autoscaling.maxReplicas Maximum number of replicas to scale out
+## @param autoscaling.targetCPU Target CPU utilization percentage
+## @param autoscaling.targetMemory Target Memory utilization percentage
+##
+autoscaling:
+ enabled: false
+ minReplicas: ""
+ maxReplicas: ""
+ targetCPU: ""
+ targetMemory: ""
+
+## Enable persistence using Persistent Volume Claims
+## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
+##
+persistence:
+ enabled: false
+ ## If defined, storageClassName:
+ ## If set to "-", storageClassName: "", which disables dynamic provisioning
+ ## If undefined (the default) or set to null, no storageClassName spec is
+ ## set, choosing the default provisioner. (gp2 on AWS, azure-disk on
+ ## Azure, standard on GKE, AWS & OpenStack)
+ ##
+ storageClass: ""
+ accessMode: ReadWriteOnce
+ annotations: {}
+ # helm.sh/resource-policy: keep
+ size: 5Gi # 大小
+ existingClaim: {} # 使用已存在的pvc
+ mountPaths:
+ - mountPath: /home/nacos/plugins
+ name: data-storage
+ subPath: plugins
+ - mountPath: /home/nacos/data
+ name: data-storage
+ subPath: data
+ - mountPath: /home/nacos/logs
+ name: data-storage
+ subPath: logs
+ ## @param persistence.selector [object] Selector to match an existing Persistent Volume
+ ## selector:
+ ## matchLabels:
+ ## app: my-app
+ ##
+ selector: {}
+
+## @param extraVolumeMounts Array to add extra mount
+##
+extraVolumeMounts: []
+# - mountPath: /logs
+# name: logs
+## @param extraVolumes Array to add extra volumes
+##
+extraVolumes: []
+# - hostPath:
+# path: /home/logs
+# name: logs
+
+## Configure the ingress resource that allows you to access the
+## ref: https://kubernetes.io/docs/user-guide/ingress/
+##
+ingress:
+ ## @param ingress.enabled Enable ingress controller resource
+ ##
+ enabled: true
+ ## @param ingress.apiVersion Force Ingress API version (automatically detected if not set)
+ ##
+ apiVersion: ""
+ ## @param ingress.ingressClassName IngressClass that will be be used to implement the Ingress (Kubernetes 1.18+)
+ ## This is supported in Kubernetes 1.18+ and required if you have more than one IngressClass marked as the default for your cluster.
+ ## ref: https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/
+ ##
+ ingressClassName: "traefik"
+ ## @param ingress.hostname Default host for the ingress resource
+ ##
+ hostname: nacos.107421.xyz
+ ## @param ingress.path The Path to nacos®. You may need to set this to '/*' in order to use this with ALB ingress controllers.
+ ##
+ path: /nacos
+ ## @param ingress.pathType Ingress path type
+ ##
+ pathType: ImplementationSpecific
+ ## @param ingress.servicePort Service port to be used
+ ## Default is http. Alternative is https.
+ ##
+ servicePort: http
+ ## @param ingress.annotations Additional annotations for the Ingress resource. To enable certificate autogeneration, place here your cert-manager annotations.
+ ## For a full list of possible ingress annotations, please see
+ ## ref: https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md
+ ## Use this parameter to set the required annotations for cert-manager, see
+ ## ref: https://cert-manager.io/docs/usage/ingress/#supported-annotations
+ ##
+ ## e.g:
+ ## annotations:
+ ## kubernetes.io/ingress.class: nginx
+ ## cert-manager.io/cluster-issuer: cluster-issuer-name
+ ##
+ annotations:
+ cert-manager.io/cluster-issuer: cm-cloudflare-7421
+ ## @param ingress.tls Enable TLS configuration for the hostname defined at `ingress.hostname` parameter
+ ## TLS certificates will be retrieved from a TLS secret with name: `{{- printf "%s-tls" .Values.ingress.hostname }}`
+ ## You can:
+ ## - Use the `ingress.secrets` parameter to create this TLS secret
+ ## - Rely on cert-manager to create it by setting the corresponding annotations
+ ## - Rely on Helm to create self-signed certificates by setting `ingress.selfSigned=true`
+ ##
+ tls: true
+ ## @param ingress.selfSigned Create a TLS secret for this ingress record using self-signed certificates generated by Helm
+ ##
+ selfSigned: false
+ ## @param ingress.extraHosts The list of additional hostnames to be covered with this ingress record.
+ ## Most likely the hostname above will be enough, but in the event more hosts are needed, this is an array
+ ## e.g:
+ ## extraHosts:
+ ## - name: chart-example.local
+ ## path: /
+ ##
+ extraHosts: []
+ ## @param ingress.extraPaths Any additional paths that may need to be added to the ingress under the main host
+ ## For example: The ALB ingress controller requires a special rule for handling SSL redirection.
+ ## extraPaths:
+ ## - path: /*
+ ## backend:
+ ## serviceName: ssl-redirect
+ ## servicePort: use-annotation
+ ##
+ extraPaths: []
+ ## @param ingress.extraTls The tls configuration for additional hostnames to be covered with this ingress record.
+ ## see: https://kubernetes.io/docs/concepts/services-networking/ingress/#tls
+ ## e.g:
+ ## extraTls:
+ ## - hosts:
+ ## - chart-example.local
+ ## secretName: chart-example.local-tls
+ ##
+ extraTls: []
+ ## @param ingress.secrets If you're providing your own certificates, please use this to add the certificates as secrets
+ ## key and certificate are expected in PEM format
+ ## name should line up with a secretName set further up
+ ##
+ ## If it is not set and you're using cert-manager, this is unneeded, as it will create a secret for you with valid certificates
+ ## If it is not set and you're NOT using cert-manager either, self-signed certificates will be created valid for 365 days
+ ## It is also possible to create and manage the certificates outside of this helm chart
+ ## Please see README.md for more information
+ ##
+ ## Example
+ ## secrets:
+ ## - name: chart-example.local-tls
+ ## key: ""
+ ## certificate: ""
+ ##
+ secrets: []
+
+## @section Other Parameters
+##
+
+## Network Policy configuration
+## ref: https://kubernetes.io/docs/concepts/services-networking/network-policies/
+##
+networkPolicy:
+ ## @param networkPolicy.enabled Enable creation of NetworkPolicy resources
+ ##
+ enabled: false
+ ## @param networkPolicy.allowExternal Don't require client label for connections
+ ## When set to false, only pods with the correct client label will have network access to the ports
+ ## Redis™ is listening on. When true, Redis™ will accept connections from any source
+ ## (with the correct destination port).
+ ##
+ allowExternal: true
+ ## @param networkPolicy.extraIngress Add extra ingress rules to the NetworkPolicy
+ ## e.g:
+ ## - port: 1234
+ ## from:
+ ## - podSelector:
+ ## - matchLabels:
+ ## - role: frontend
+ ## - podSelector:
+ ## - matchExpressions:
+ ## - key: role
+ ## operator: In
+ ## values:
+ ## - frontend
+ ##
+ extraIngress: []
+ ## @param networkPolicy.extraEgress Add extra ingress rules to the NetworkPolicy
+ ## e.g:
+ ## extraEgress:
+ ## - ports:
+ ## - port: 1234
+ ## to:
+ ## - podSelector:
+ ## - matchLabels:
+ ## - role: frontend
+ ## - podSelector:
+ ## - matchExpressions:
+ ## - key: role
+ ## operator: In
+ ## values:
+ ## - frontend
+ ##
+ extraEgress: []
+ ## @param networkPolicy.ingressNSMatchLabels Labels to match to allow traffic from other namespaces
+ ## @param networkPolicy.ingressNSPodMatchLabels Pod labels to match to allow traffic from other namespaces
+ ##
+ ingressNSMatchLabels: {}
+ ingressNSPodMatchLabels: {}
+
+## Pods Service Account
+## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
+##
+serviceAccount:
+ ## @param serviceAccount.create Enable creation of ServiceAccount for nginx pod
+ ##
+ create: false
+ ## @param serviceAccount.name The name of the ServiceAccount to use.
+ ## If not set and create is true, a name is generated using the `common.names.fullname` template
+ name: ""
+ ## @param serviceAccount.annotations Annotations for service account. Evaluated as a template.
+ ## Only used if `create` is `true`.
+ ##
+ annotations: {}
+ ## @param serviceAccount.autoMount Auto-mount the service account token in the pod
+ ##
+ autoMount: false
+
+## Pod Disruption Budget configuration
+## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/
+##
+pdb:
+ ## @param pdb.create Created a PodDisruptionBudget
+ ##
+ create: false
+ ## @param pdb.minAvailable Min number of pods that must still be available after the eviction
+ ##
+ minAvailable: 1
+ ## @param pdb.maxUnavailable Max number of pods that can be unavailable after the eviction
+ ##
+ maxUnavailable: 0
+
+## Uncomment and modify this to run a command after starting the core container.
+## ref: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/
+lifecycle: {}
+# preStop:
+# exec:
+# command: ["/bin/bash","/pre-stop.sh"]
+# postStart:
+# exec:
+# command: ["/bin/bash","/post-start.sh"]
+
+## init containers
+## ref: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
+## Add init containers. e.g. to be used to give specific permissions for data
+## Add your own init container or uncomment and modify the given example.
+initContainers: []
+# - name: fmp-volume-permission
+# image: busybox
+# imagePullPolicy: IfNotPresent
+# command: ['chown','-R', '200', '/extra-data']
+# volumeMounts:
+# - name: extra-data
+# mountPath: /extra-data
+
+## @param sidecars Sidecar parameters
+## e.g:
+## sidecars:
+## - name: your-image-name
+## image: your-image
+## imagePullPolicy: Always
+## ports:
+## - name: portname
+## containerPort: 1234
+##
+sidecars: []
+
+## @param sidecarSingleProcessNamespace Enable sharing the process namespace with sidecars
+## This will switch pod.spec.shareProcessNamespace parameter
+##
+sidecarSingleProcessNamespace: false
+
+mysql:
+ # if enabled set "false", fill the connection informations in "external" section
+ # init containers will import the flow sql file into mysql db.
+ # https://raw.githubusercontent.com/alibaba/nacos/${version}/distribution/conf/schema.sql
+ # https://raw.githubusercontent.com/alibaba/nacos/${version}/distribution/conf/nacos-mysql.sql
+ enabled: false
+ external:
+ mysqlMasterHost: "mysql_master_host"
+ mysqlDatabase: "nacos"
+ mysqlMasterPort: "3306"
+ mysqlMasterUser: "nacos"
+ mysqlMasterPassword: "nacos"
+ mysqlSlaveHost: "mysql_slave_host"
+ mysqlSlavePort: "3306"
+
+ architecture: standlone
+ auth:
+ rootPassword: "nacos"
+ database: "nacos"
+ username: "nacos"
+ password: "nacos"
+ replicationUser: "replicator"
+ replicationPassword: "replicator"
+
+ primary:
+ persistence:
+ enabled: false
+ storageClass: "-"
+ mountPath: /bitnami/mysql
+ annotations: {}
+ accessModes:
+ - ReadWriteOnce
+ size: 8Gi
+
+ # extraEnvVars:
+ # - name: TZ
+ # value: "Asia/Shanghai"
+
+ containerSecurityContext:
+ enabled: true
+ runAsUser: 5001
+ allowPrivilegeEscalation: false
+
+ configuration: |-
+ [mysqld]
+ skip_ssl
+ default_authentication_plugin=mysql_native_password
+ skip-name-resolve
+ explicit_defaults_for_timestamp
+ basedir=/opt/bitnami/mysql
+ plugin_dir=/opt/bitnami/mysql/lib/plugin
+ port=3306
+ socket=/opt/bitnami/mysql/tmp/mysql.sock
+ datadir=/bitnami/mysql/data
+ tmpdir=/opt/bitnami/mysql/tmp
+ max_allowed_packet=16M
+ bind-address=0.0.0.0
+ pid-file=/opt/bitnami/mysql/tmp/mysqld.pid
+ log-error=/opt/bitnami/mysql/logs/mysqld.log
+ default-time_zone = '+8:00'
+ character-set-server=utf8mb4
+ collation-server = utf8mb4_unicode_ci
+
+ [client]
+ port=3306
+ socket=/opt/bitnami/mysql/tmp/mysql.sock
+ plugin_dir=/opt/bitnami/mysql/lib/plugin
+ default-character-set=utf8mb4
+
+ [manager]
+ port=3306
+ socket=/opt/bitnami/mysql/tmp/mysql.sock
+ pid-file=/opt/bitnami/mysql/tmp/mysqld.pid
+
+ secondary:
+ replicaCount: 1
+ persistence:
+ enabled: false
+ storageClass: "-"
+ mountPath: /bitnami/mysql
+ annotations: {}
+ accessModes:
+ - ReadWriteOnce
+ size: 8Gi
+
+ extraEnvVars:
+ - name: TZ
+ value: "Asia/Shanghai"
+
+ containerSecurityContext:
+ enabled: true
+ runAsUser: 5001
+ allowPrivilegeEscalation: false
+
+ configuration: |-
+ [mysqld]
+ skip_ssl
+ default_authentication_plugin=mysql_native_password
+ skip-name-resolve
+ explicit_defaults_for_timestamp
+ basedir=/opt/bitnami/mysql
+ plugin_dir=/opt/bitnami/mysql/lib/plugin
+ port=3306
+ socket=/opt/bitnami/mysql/tmp/mysql.sock
+ datadir=/bitnami/mysql/data
+ tmpdir=/opt/bitnami/mysql/tmp
+ max_allowed_packet=16M
+ bind-address=0.0.0.0
+ pid-file=/opt/bitnami/mysql/tmp/mysqld.pid
+ log-error=/opt/bitnami/mysql/logs/mysqld.log
+ default-time_zone = '+8:00'
+ character-set-server=utf8mb4
+ collation-server = utf8mb4_unicode_ci
+
+ [client]
+ port=3306
+ socket=/opt/bitnami/mysql/tmp/mysql.sock
+ plugin_dir=/opt/bitnami/mysql/lib/plugin
+ default-character-set=UTF8
+
+ [manager]
+ port=3306
+ socket=/opt/bitnami/mysql/tmp/mysql.sock
+ pid-file=/opt/bitnami/mysql/tmp/mysqld.pid
+
+initDB:
+ enabled: true
+ image:
+ registry: docker.io
+ repository: ygqygq2/mysql-exec-sql
+ tag: latest
+ pullPolicy: IfNotPresent
+
+## nacos 自带 metrics
+metrics:
+ ## Prometheus Operator ServiceMonitor configuration
+ ##
+ serviceMonitor:
+ ## @param metrics.serviceMonitor.enabled Creates a Prometheus Operator ServiceMonitor (also requires `metrics.enabled` to be `true`)
+ ##
+ enabled: false
+ ## @param metrics.serviceMonitor.namespace Namespace in which Prometheus is running
+ ##
+ namespace: ""
+ ## @param metrics.serviceMonitor.interval Interval at which metrics should be scraped.
+ ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
+ ## e.g:
+ ## interval: 10s
+ ##
+ interval: ""
+ ## @param metrics.serviceMonitor.scrapeTimeout Timeout after which the scrape is ended
+ ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
+ ## e.g:
+ ## scrapeTimeout: 10s
+ ##
+ scrapeTimeout: ""
+ ## @param metrics.serviceMonitor.selector Prometheus instance selector labels
+ ## ref: https://github.com/bitnami/charts/tree/master/bitnami/prometheus-operator#prometheus-configuration
+ ##
+ ## selector:
+ ## prometheus: my-prometheus
+ ##
+ selector: {}
+ ## @param metrics.serviceMonitor.additionalLabels Additional labels that can be used so PodMonitor will be discovered by Prometheus
+ ##
+ additionalLabels: {}
+ ## @param metrics.serviceMonitor.relabelings RelabelConfigs to apply to samples before scraping
+ ##
+ relabelings: []
+ ## @param metrics.serviceMonitor.metricRelabelings MetricRelabelConfigs to apply to samples before ingestion
+ ##
+ metricRelabelings: []
+ ## Prometheus Operator PrometheusRule configuration
+ ##
+ prometheusRule:
+ ## @param metrics.prometheusRule.enabled if `true`, creates a Prometheus Operator PrometheusRule (also requires `metrics.enabled` to be `true` and `metrics.prometheusRule.rules`)
+ ##
+ enabled: false
+ ## @param metrics.prometheusRule.namespace Namespace for the PrometheusRule Resource (defaults to the Release Namespace)
+ ##
+ namespace: ""
+ ## @param metrics.prometheusRule.additionalLabels Additional labels that can be used so PrometheusRule will be discovered by Prometheus
+ ##
+ additionalLabels: {}
+ ## @param metrics.prometheusRule.rules Prometheus Rule definitions
+ ## - alert: LowInstance
+ ## expr: up{service="{{ template "common.names.fullname" . }}"} < 1
+ ## for: 1m
+ ## labels:
+ ## severity: critical
+ ## annotations:
+ ## description: Service {{ template "common.names.fullname" . }} Tomcat is down since 1m.
+ ## summary: Tomcat instance is down.
+ ##
+ rules: []