|
@@ -1,10 +1,7 @@
|
|
|
package seecoder.devcloud.api.k8s.model;
|
|
package seecoder.devcloud.api.k8s.model;
|
|
|
|
|
|
|
|
import io.kubernetes.client.openapi.models.*;
|
|
import io.kubernetes.client.openapi.models.*;
|
|
|
-import lombok.AllArgsConstructor;
|
|
|
|
|
-import lombok.Builder;
|
|
|
|
|
-import lombok.Data;
|
|
|
|
|
-import lombok.NoArgsConstructor;
|
|
|
|
|
|
|
+import lombok.*;
|
|
|
import org.hibernate.validator.constraints.Range;
|
|
import org.hibernate.validator.constraints.Range;
|
|
|
import org.springframework.data.annotation.ReadOnlyProperty;
|
|
import org.springframework.data.annotation.ReadOnlyProperty;
|
|
|
|
|
|
|
@@ -22,6 +19,7 @@ import java.util.stream.Collectors;
|
|
|
@NoArgsConstructor
|
|
@NoArgsConstructor
|
|
|
@AllArgsConstructor
|
|
@AllArgsConstructor
|
|
|
@Builder
|
|
@Builder
|
|
|
|
|
+@EqualsAndHashCode(callSuper=false)
|
|
|
public class Deployment extends K8sAbstractObject<V1Deployment> {
|
|
public class Deployment extends K8sAbstractObject<V1Deployment> {
|
|
|
|
|
|
|
|
public static final String API_VERSION = "apps/v1";
|
|
public static final String API_VERSION = "apps/v1";
|
|
@@ -34,12 +32,16 @@ public class Deployment extends K8sAbstractObject<V1Deployment> {
|
|
|
|
|
|
|
|
public static final String DEFAULT_UPDATE_STRATEGY = "Recreate";
|
|
public static final String DEFAULT_UPDATE_STRATEGY = "Recreate";
|
|
|
|
|
|
|
|
|
|
+ @Builder.Default
|
|
|
private List<Container> containers = new ArrayList<>();
|
|
private List<Container> containers = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
+ @Builder.Default
|
|
|
private List<String> imagePullSecrets = new ArrayList<>();
|
|
private List<String> imagePullSecrets = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
+ @Builder.Default
|
|
|
private List<V1Volume> volumes = new ArrayList<>();
|
|
private List<V1Volume> volumes = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
+ @Builder.Default
|
|
|
private Map<String, String> nodeSelectors = new HashMap<>();
|
|
private Map<String, String> nodeSelectors = new HashMap<>();
|
|
|
@Range(min = 1, max = 3)
|
|
@Range(min = 1, max = 3)
|
|
|
private int replicas;
|
|
private int replicas;
|
|
@@ -47,11 +49,13 @@ public class Deployment extends K8sAbstractObject<V1Deployment> {
|
|
|
/**
|
|
/**
|
|
|
* 超过timeout时间未完成启动则提示启动超时
|
|
* 超过timeout时间未完成启动则提示启动超时
|
|
|
*/
|
|
*/
|
|
|
|
|
+ @Builder.Default
|
|
|
private int timeout = DEFAULT_PROGRESS_DEADLINE_SECONDS;
|
|
private int timeout = DEFAULT_PROGRESS_DEADLINE_SECONDS;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 保留历史replica set的个数
|
|
* 保留历史replica set的个数
|
|
|
*/
|
|
*/
|
|
|
|
|
+ @Builder.Default
|
|
|
private int revisionHistoryLimit = DEFAULT_REVISION_HISTORY_LIMIT;
|
|
private int revisionHistoryLimit = DEFAULT_REVISION_HISTORY_LIMIT;
|
|
|
|
|
|
|
|
@ReadOnlyProperty
|
|
@ReadOnlyProperty
|