-
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: add CRD with kustomize CLI
- Loading branch information
Christoph Bühler
committed
Sep 26, 2023
1 parent
d77e110
commit ba5dda3
Showing
9 changed files
with
132 additions
and
25 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -20,4 +20,5 @@ | |
|
||
|
||
|
||
|
||
</Project> |
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,50 @@ | ||
using k8s; | ||
|
||
namespace KubeOps.Abstractions.Kustomize; | ||
|
||
/// <summary> | ||
/// (Partial) definition for a kustomization yaml. | ||
/// </summary> | ||
public class KustomizationConfig : KubernetesObject | ||
{ | ||
public KustomizationConfig() | ||
{ | ||
ApiVersion = "kustomize.config.k8s.io/v1beta1"; | ||
Kind = "Kustomization"; | ||
} | ||
|
||
/// <summary> | ||
/// Namespace that should be set. | ||
/// </summary> | ||
public string? Namespace { get; set; } | ||
|
||
/// <summary> | ||
/// Name prefix that should be set. | ||
/// </summary> | ||
public string? NamePrefix { get; set; } | ||
|
||
/// <summary> | ||
/// Common labels for the resources. | ||
/// </summary> | ||
public IDictionary<string, string>? CommonLabels { get; set; } | ||
|
||
/// <summary> | ||
/// Resource list. | ||
/// </summary> | ||
public IList<string>? Resources { get; set; } | ||
|
||
/// <summary> | ||
/// List of merge patches. | ||
/// </summary> | ||
public IList<string>? PatchesStrategicMerge { get; set; } | ||
|
||
/// <summary> | ||
/// List of <see cref="KustomizationImage"/>. | ||
/// </summary> | ||
public IList<KustomizationImage>? Images { get; set; } | ||
|
||
/// <summary> | ||
/// List of <see cref="KustomizationConfigMapGenerator"/>. | ||
/// </summary> | ||
public IList<KustomizationConfigMapGenerator>? ConfigMapGenerator { get; set; } | ||
} |
23 changes: 23 additions & 0 deletions
23
src/KubeOps.Abstractions/Kustomize/KustomizationConfigMapGenerator.cs
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 @@ | ||
namespace KubeOps.Abstractions.Kustomize; | ||
|
||
/// <summary> | ||
/// Entitiy for config map generators in a kustomization.yaml file. | ||
/// </summary> | ||
public class KustomizationConfigMapGenerator | ||
{ | ||
/// <summary> | ||
/// The name of the config map. | ||
/// </summary> | ||
public string Name { get; set; } = string.Empty; | ||
|
||
/// <summary> | ||
/// List of files that should be added to the generated config map. | ||
/// </summary> | ||
public IList<string>? Files { get; set; } | ||
|
||
/// <summary> | ||
/// Config literals to add to the config map in the form of: | ||
/// - NAME=value. | ||
/// </summary> | ||
public IList<string>? Literals { get; set; } | ||
} |
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 @@ | ||
namespace KubeOps.Abstractions.Kustomize; | ||
|
||
/// <summary> | ||
/// Definition for an "image" in a kustomization yaml. | ||
/// </summary> | ||
public class KustomizationImage | ||
{ | ||
/// <summary> | ||
/// Name of the image. | ||
/// </summary> | ||
public string Name { get; set; } = string.Empty; | ||
|
||
/// <summary> | ||
/// New name of the image. | ||
/// </summary> | ||
public string NewName { get; set; } = string.Empty; | ||
|
||
/// <summary> | ||
/// New tag of the image. | ||
/// </summary> | ||
public string NewTag { get; set; } = string.Empty; | ||
} |
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
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
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
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
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