forked from Azure/iotedge
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[k8s] Experimental Service Options (Azure#3179)
Added another `k8s-experimental` section called `serviceOptions`. I has 2 fields, `type` and `LoadBalancerIP`. `type` will be used as Service type if a Service is created. `loadBalancerIP` is put into the `loadBalancerIP` field in the Service, if a service is created. This allows individual modules to override default Service settings.
- Loading branch information
Showing
9 changed files
with
225 additions
and
13 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
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
26 changes: 26 additions & 0 deletions
26
...ft.Azure.Devices.Edge.Agent.Kubernetes/edgedeployment/service/KubernetesServiceOptions.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,26 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
namespace Microsoft.Azure.Devices.Edge.Agent.Kubernetes.EdgeDeployment.Service | ||
{ | ||
using System; | ||
using Microsoft.Azure.Devices.Edge.Util; | ||
using Microsoft.Azure.Devices.Edge.Util.Json; | ||
using Newtonsoft.Json; | ||
|
||
public class KubernetesServiceOptions | ||
{ | ||
public KubernetesServiceOptions(string loadBalancerIP, string type) | ||
{ | ||
PortMapServiceType serviceType; | ||
this.LoadBalancerIP = Option.Maybe(loadBalancerIP); | ||
this.Type = Enum.TryParse(type, true, out serviceType) ? Option.Some(serviceType) : Option.None<PortMapServiceType>(); | ||
} | ||
|
||
[JsonProperty("LoadBalancerIP", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] | ||
[JsonConverter(typeof(OptionConverter<string>))] | ||
public Option<string> LoadBalancerIP { get; } | ||
|
||
[JsonProperty("Type", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] | ||
[JsonConverter(typeof(OptionConverter<PortMapServiceType>))] | ||
public Option<PortMapServiceType> Type { get; } | ||
} | ||
} |
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
Oops, something went wrong.