-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Kubernetes extension now uses
quarkus.
- Loading branch information
Showing
41 changed files
with
2,204 additions
and
275 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
...ment/src/main/java/io/quarkus/kubernetes/deployment/AwsElasticBlockStoreVolumeConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
package io.quarkus.kubernetes.deployment; | ||
|
||
import java.util.Optional; | ||
|
||
import io.quarkus.runtime.annotations.ConfigGroup; | ||
import io.quarkus.runtime.annotations.ConfigItem; | ||
|
||
@ConfigGroup | ||
public class AwsElasticBlockStoreVolumeConfig { | ||
|
||
/** | ||
* The name of the disk to mount. | ||
*/ | ||
@ConfigItem | ||
String volumeId; | ||
|
||
/** | ||
* The partition. | ||
*/ | ||
@ConfigItem | ||
Optional<Integer> partition; | ||
|
||
/** | ||
* Filesystem type. | ||
*/ | ||
@ConfigItem(defaultValue = "ext4") | ||
String fsType; | ||
|
||
/** | ||
* Wether the volumeName is read only or not. | ||
*/ | ||
@ConfigItem(defaultValue = "false") | ||
boolean readOnly; | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
...t/src/main/java/io/quarkus/kubernetes/deployment/AwsElasticBlockStoreVolumeConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
package io.quarkus.kubernetes.deployment; | ||
|
||
import java.util.Map; | ||
|
||
import io.dekorate.kubernetes.config.AwsElasticBlockStoreVolume; | ||
import io.dekorate.kubernetes.config.AwsElasticBlockStoreVolumeBuilder; | ||
|
||
public class AwsElasticBlockStoreVolumeConverter { | ||
|
||
public static AwsElasticBlockStoreVolume convert(Map.Entry<String, AwsElasticBlockStoreVolumeConfig> e) { | ||
return convert(e.getValue()).withVolumeName(e.getKey()).build(); | ||
} | ||
|
||
public static AwsElasticBlockStoreVolumeBuilder convert(AwsElasticBlockStoreVolumeConfig c) { | ||
AwsElasticBlockStoreVolumeBuilder b = new AwsElasticBlockStoreVolumeBuilder(); | ||
b.withVolumeId(c.volumeId); | ||
b.withFsType(c.fsType); | ||
b.withReadOnly(c.readOnly); | ||
c.partition.ifPresent(p -> b.withPartition(p)); | ||
return b; | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
...etes/deployment/src/main/java/io/quarkus/kubernetes/deployment/AzureDiskVolumeConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
|
||
package io.quarkus.kubernetes.deployment; | ||
|
||
import io.quarkus.runtime.annotations.ConfigGroup; | ||
import io.quarkus.runtime.annotations.ConfigItem; | ||
|
||
@ConfigGroup | ||
public class AzureDiskVolumeConfig { | ||
|
||
public enum CachingMode { | ||
ReadWrite, | ||
ReadOnly, | ||
None | ||
} | ||
|
||
public enum Kind { | ||
Managed, | ||
Shared | ||
} | ||
|
||
/** | ||
* The name of the disk to mount. | ||
*/ | ||
@ConfigItem | ||
String diskName; | ||
|
||
/** | ||
* The URI of the vhd blob object OR the resourceID of an Azure managed data disk if Kind is Managed | ||
*/ | ||
@ConfigItem | ||
String diskURI; | ||
|
||
/** | ||
* Kind of disk. | ||
*/ | ||
@ConfigItem(defaultValue = "Managed") | ||
Kind kind; | ||
|
||
/** | ||
* Disk caching mode. | ||
*/ | ||
@ConfigItem(defaultValue = "ReadWrite") | ||
CachingMode cachingMode; | ||
|
||
/** | ||
* File system type. | ||
*/ | ||
@ConfigItem(defaultValue = "ext4") | ||
String fsType; | ||
|
||
/** | ||
* Wether the volumeName is read only or not. | ||
*/ | ||
@ConfigItem(defaultValue = "false") | ||
boolean readOnly; | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
...s/deployment/src/main/java/io/quarkus/kubernetes/deployment/AzureDiskVolumeConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
package io.quarkus.kubernetes.deployment; | ||
|
||
import java.util.Map; | ||
|
||
import io.dekorate.kubernetes.config.AzureDiskVolume; | ||
import io.dekorate.kubernetes.config.AzureDiskVolumeBuilder; | ||
|
||
public class AzureDiskVolumeConverter { | ||
|
||
public static AzureDiskVolume convert(Map.Entry<String, AzureDiskVolumeConfig> e) { | ||
return convert(e.getValue()).withVolumeName(e.getKey()).build(); | ||
} | ||
|
||
public static AzureDiskVolumeBuilder convert(AzureDiskVolumeConfig c) { | ||
AzureDiskVolumeBuilder b = new AzureDiskVolumeBuilder(); | ||
b.withNewDiskName(c.diskName); | ||
b.withDiskURI(c.diskURI); | ||
b.withKind(c.kind.name()); | ||
b.withCachingMode(c.cachingMode.name()); | ||
b.withFsType(c.fsType); | ||
b.withReadOnly(c.readOnly); | ||
return b; | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...etes/deployment/src/main/java/io/quarkus/kubernetes/deployment/AzureFileVolumeConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
package io.quarkus.kubernetes.deployment; | ||
|
||
import io.quarkus.runtime.annotations.ConfigGroup; | ||
import io.quarkus.runtime.annotations.ConfigItem; | ||
|
||
@ConfigGroup | ||
public class AzureFileVolumeConfig { | ||
|
||
/** | ||
* The share name. | ||
*/ | ||
@ConfigItem | ||
String shareName; | ||
|
||
/** | ||
* The secret name. | ||
*/ | ||
@ConfigItem | ||
String secretName; | ||
|
||
/** | ||
* Wether the volumeName is read only or not. | ||
*/ | ||
@ConfigItem(defaultValue = "false") | ||
boolean readOnly; | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
...s/deployment/src/main/java/io/quarkus/kubernetes/deployment/AzureFileVolumeConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
package io.quarkus.kubernetes.deployment; | ||
|
||
import java.util.Map; | ||
|
||
import io.dekorate.kubernetes.config.AzureFileVolume; | ||
import io.dekorate.kubernetes.config.AzureFileVolumeBuilder; | ||
|
||
public class AzureFileVolumeConverter { | ||
|
||
public static AzureFileVolume convert(Map.Entry<String, AzureFileVolumeConfig> e) { | ||
return convert(e.getValue()).withVolumeName(e.getKey()).build(); | ||
} | ||
|
||
public static AzureFileVolumeBuilder convert(AzureFileVolumeConfig c) { | ||
AzureFileVolumeBuilder b = new AzureFileVolumeBuilder(); | ||
b.withSecretName(c.secretName); | ||
b.withShareName(c.shareName); | ||
b.withReadOnly(c.readOnly); | ||
return b; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...etes/deployment/src/main/java/io/quarkus/kubernetes/deployment/ConfigMapVolumeConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package io.quarkus.kubernetes.deployment; | ||
|
||
import io.quarkus.runtime.annotations.ConfigGroup; | ||
import io.quarkus.runtime.annotations.ConfigItem; | ||
|
||
@ConfigGroup | ||
public class ConfigMapVolumeConfig { | ||
|
||
/** | ||
* The name of the ConfigMap to mount. | ||
*/ | ||
@ConfigItem | ||
String configMapName; | ||
|
||
/** | ||
* Default mode. | ||
* | ||
* @return The default mode. | ||
*/ | ||
@ConfigItem(defaultValue = "0600") | ||
Integer defaultMode; | ||
|
||
/** | ||
* Optional | ||
*/ | ||
@ConfigItem(defaultValue = "false") | ||
boolean optional; | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
...s/deployment/src/main/java/io/quarkus/kubernetes/deployment/ConfigMapVolumeConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
package io.quarkus.kubernetes.deployment; | ||
|
||
import java.util.Map; | ||
|
||
import io.dekorate.kubernetes.config.ConfigMapVolume; | ||
import io.dekorate.kubernetes.config.ConfigMapVolumeBuilder; | ||
|
||
public class ConfigMapVolumeConverter { | ||
|
||
public static ConfigMapVolume convert(Map.Entry<String, ConfigMapVolumeConfig> e) { | ||
return convert(e.getValue()).withVolumeName(e.getKey()).build(); | ||
} | ||
|
||
public static ConfigMapVolumeBuilder convert(ConfigMapVolumeConfig cm) { | ||
ConfigMapVolumeBuilder b = new ConfigMapVolumeBuilder(); | ||
b.withConfigMapName(cm.configMapName); | ||
b.withDefaultMode(cm.defaultMode); | ||
b.withOptional(cm.optional); | ||
return b; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
...kubernetes/deployment/src/main/java/io/quarkus/kubernetes/deployment/ContainerConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
|
||
package io.quarkus.kubernetes.deployment; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.Optional; | ||
|
||
import io.dekorate.kubernetes.annotation.ImagePullPolicy; | ||
import io.quarkus.runtime.annotations.ConfigGroup; | ||
import io.quarkus.runtime.annotations.ConfigItem; | ||
|
||
@ConfigGroup | ||
public class ContainerConfig { | ||
|
||
/** | ||
* The container image. | ||
*/ | ||
@ConfigItem | ||
Optional<String> image; | ||
|
||
/** | ||
* Environment variables to add to all containers. | ||
*/ | ||
@ConfigItem | ||
Map<String, EnvConfig> envVars; | ||
|
||
/** | ||
* Working directory. | ||
*/ | ||
@ConfigItem | ||
Optional<String> workingDir; | ||
|
||
/** | ||
* The commands | ||
*/ | ||
@ConfigItem | ||
Optional<List<String>> command; | ||
|
||
/** | ||
* The arguments | ||
* | ||
* @return The arguments. | ||
*/ | ||
@ConfigItem | ||
Optional<List<String>> arguments; | ||
|
||
/** | ||
* The service account. | ||
*/ | ||
@ConfigItem | ||
Optional<String> serviceAccount; | ||
|
||
/** | ||
* The host under which the application is going to be exposed. | ||
* | ||
*/ | ||
@ConfigItem | ||
Optional<String> host; | ||
|
||
/** | ||
* The application ports. | ||
*/ | ||
@ConfigItem | ||
Map<String, PortConfig> ports; | ||
|
||
/** | ||
* Image pull policy. | ||
*/ | ||
@ConfigItem(defaultValue = "IfNotPresent") | ||
ImagePullPolicy imagePullPolicy; | ||
|
||
/** | ||
* The image pull secret | ||
*/ | ||
@ConfigItem | ||
Optional<List<String>> imagePullSecrets; | ||
|
||
/** | ||
* The liveness probe. | ||
*/ | ||
@ConfigItem | ||
Optional<ProbeConfig> livenessProbe; | ||
|
||
/** | ||
* The readiness probe. | ||
*/ | ||
@ConfigItem | ||
Optional<ProbeConfig> readinessProbe; | ||
|
||
/** | ||
* Volume mounts. | ||
*/ | ||
@ConfigItem | ||
Map<String, MountConfig> mounts; | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
...ernetes/deployment/src/main/java/io/quarkus/kubernetes/deployment/ContainerConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
package io.quarkus.kubernetes.deployment; | ||
|
||
import java.util.Map; | ||
|
||
import io.dekorate.kubernetes.config.Container; | ||
import io.dekorate.kubernetes.config.ContainerBuilder; | ||
|
||
public class ContainerConverter { | ||
|
||
public static Container convert(Map.Entry<String, ContainerConfig> e) { | ||
return convert(e.getValue()).withName(e.getKey()).build(); | ||
} | ||
|
||
public static ContainerBuilder convert(ContainerConfig c) { | ||
ContainerBuilder b = new ContainerBuilder(); | ||
c.image.ifPresent(i -> b.withImage(i)); | ||
c.workingDir.ifPresent(w -> b.withWorkingDir(w)); | ||
c.readinessProbe.ifPresent(p -> b.withReadinessProbe(ProbeConverter.convert(p))); | ||
c.livenessProbe.ifPresent(p -> b.withLivenessProbe(ProbeConverter.convert(p))); | ||
c.envVars.entrySet().forEach(e -> b.addToEnvVars(EnvConverter.convert(e))); | ||
c.ports.entrySet().forEach(e -> b.addToPorts(PortConverter.convert(e))); | ||
c.mounts.entrySet().forEach(e -> b.addToMounts(MountConverter.convert(e))); | ||
return b; | ||
} | ||
} |
Oops, something went wrong.