Skip to content

Commit

Permalink
feat(K8s): add optional cookies secret volume into Kubernetes service
Browse files Browse the repository at this point in the history
- Added a new `cookies` volume to the Kubernetes service base configuration, sourced from a named secret.
- Made the `cookies` volume optional with a default mode set to 660.
- Created a mounting path for the `cookies` volume in the init containers configuration, keeping the property as not read-only.

Signed-off-by: 陳鈞 <[email protected]>
  • Loading branch information
jim60105 committed May 21, 2024
1 parent ffa4db1 commit 659cc97
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions SingletonServices/Kubernetes/KubernetesServiceBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@ protected Task<V1Job> CreateInstanceAsync(string deploymentName,
{
Name = "sharedvolume",
EmptyDir = new V1EmptyDirVolumeSource()
},
new()
{
Name = "cookies",
Secret = new V1SecretVolumeSource
{
SecretName = "cookies",
DefaultMode = 432, // octal 0660 to decimal
Optional = true,
}
}
},
// Downloader container
Expand All @@ -99,6 +109,13 @@ protected Task<V1Job> CreateInstanceAsync(string deploymentName,
{
Name = "sharedvolume",
MountPath = mountPath,
ReadOnlyProperty = false,
},
new()
{
Name = "cookies",
MountPath = Path.Combine(mountPath, "cookies"),
ReadOnlyProperty = false,
}
},
}
Expand Down

0 comments on commit 659cc97

Please sign in to comment.