Skip to content

Commit

Permalink
Add support for k8s 1.19.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lblackstone committed Feb 28, 2020
1 parent 62b6475 commit e04202d
Show file tree
Hide file tree
Showing 13 changed files with 647 additions and 112 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ PROVIDER := pulumi-resource-${PACK}
CODEGEN := pulumi-gen-${PACK}
VERSION ?= $(shell scripts/get-version)
PYPI_VERSION := $(shell scripts/get-py-version)
KUBE_VERSION ?= v1.17.0
KUBE_VERSION ?= v1.19.0-alpha.0
SWAGGER_URL ?= https://github.com/kubernetes/kubernetes/raw/${KUBE_VERSION}/api/openapi-spec/swagger.json
OPENAPI_DIR := pkg/gen/openapi-specs
OPENAPI_FILE := ${OPENAPI_DIR}/swagger-${KUBE_VERSION}.json
Expand Down
9 changes: 9 additions & 0 deletions sdk/dotnet/Core/V1/ConfigMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ public partial class ConfigMap : KubernetesResource
[Output("data")]
public Output<ImmutableDictionary<string, string>> Data { get; private set; } = null!;

/// <summary>
/// Immutable, if set to true, ensures that data stored in the ConfigMap cannot be updated
/// (only object metadata can be modified). If not set to true, the field can be modified at
/// any time. Defaulted to nil. This is an alpha field enabled by ImmutableEphemeralVolumes
/// feature gate.
/// </summary>
[Output("immutable")]
public Output<bool> Immutable { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
/// may infer this from the endpoint the client submits requests to. Cannot be updated. In
Expand Down
9 changes: 9 additions & 0 deletions sdk/dotnet/Core/V1/Secret.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ public partial class Secret : KubernetesResource
[Output("data")]
public Output<ImmutableDictionary<string, string>> Data { get; private set; } = null!;

/// <summary>
/// Immutable, if set to true, ensures that data stored in the Secret cannot be updated
/// (only object metadata can be modified). If not set to true, the field can be modified at
/// any time. Defaulted to nil. This is an alpha field enabled by ImmutableEphemeralVolumes
/// feature gate.
/// </summary>
[Output("immutable")]
public Output<bool> Immutable { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
/// may infer this from the endpoint the client submits requests to. Cannot be updated. In
Expand Down
201 changes: 161 additions & 40 deletions sdk/dotnet/Types/Input.cs

Large diffs are not rendered by default.

173 changes: 157 additions & 16 deletions sdk/dotnet/Types/Output.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11416,6 +11416,85 @@ public sealed class ExternalMetricStatus
this.Metric = @metric;
}

}
/// <summary>
/// HPAScalingPolicy is a single policy which must hold true for a specified past interval.
/// </summary>
[OutputType]
public sealed class HPAScalingPolicy
{
/// <summary>
/// PeriodSeconds specifies the window of time for which the policy should hold true.
/// PeriodSeconds must be greater than zero and less than or equal to 1800 (30 min).
/// </summary>
public readonly int PeriodSeconds;

/// <summary>
/// Type is used to specify the scaling policy.
/// </summary>
public readonly string Type;

/// <summary>
/// Value contains the amount of change which is permitted by the policy. It must be greater
/// than zero
/// </summary>
public readonly int Value;

[OutputConstructor]
private HPAScalingPolicy(
int @periodSeconds,
string @type,
int @value)
{
this.PeriodSeconds = @periodSeconds;
this.Type = @type;
this.Value = @value;
}

}
/// <summary>
/// HPAScalingRules configures the scaling behavior for one direction. These Rules are applied
/// after calculating DesiredReplicas from metrics for the HPA. They can limit the scaling
/// velocity by specifying scaling policies. They can prevent flapping by specifying the
/// stabilization window, so that the number of replicas is not set instantly, instead, the
/// safest value from the stabilization window is chosen.
/// </summary>
[OutputType]
public sealed class HPAScalingRules
{
/// <summary>
/// policies is a list of potential scaling polices which can be used during scaling. At
/// least one policy must be specified, otherwise the HPAScalingRules will be discarded as
/// invalid
/// </summary>
public readonly ImmutableArray<Autoscaling.V2Beta2.HPAScalingPolicy> Policies;

/// <summary>
/// selectPolicy is used to specify which policy should be used. If not set, the default
/// value MaxPolicySelect is used.
/// </summary>
public readonly string SelectPolicy;

/// <summary>
/// StabilizationWindowSeconds is the number of seconds for which past recommendations
/// should be considered while scaling up or scaling down. StabilizationWindowSeconds must
/// be greater than or equal to zero and less than or equal to 3600 (one hour). If not set,
/// use the default values: - For scale up: 0 (i.e. no stabilization is done). - For scale
/// down: 300 (i.e. the stabilization window is 300 seconds long).
/// </summary>
public readonly int StabilizationWindowSeconds;

[OutputConstructor]
private HPAScalingRules(
ImmutableArray<Autoscaling.V2Beta2.HPAScalingPolicy> @policies,
string @selectPolicy,
int @stabilizationWindowSeconds)
{
this.Policies = @policies;
this.SelectPolicy = @selectPolicy;
this.StabilizationWindowSeconds = @stabilizationWindowSeconds;
}

}
/// <summary>
/// HorizontalPodAutoscaler is the configuration for a horizontal pod autoscaler, which
Expand Down Expand Up @@ -11473,6 +11552,39 @@ public sealed class HorizontalPodAutoscaler
this.Status = @status;
}

}
/// <summary>
/// HorizontalPodAutoscalerBehavior configures the scaling behavior of the target in both Up and
/// Down directions (scaleUp and scaleDown fields respectively).
/// </summary>
[OutputType]
public sealed class HorizontalPodAutoscalerBehavior
{
/// <summary>
/// scaleDown is scaling policy for scaling Down. If not set, the default value is to allow
/// to scale down to minReplicas pods, with a 300 second stabilization window (i.e., the
/// highest recommendation for the last 300sec is used).
/// </summary>
public readonly Autoscaling.V2Beta2.HPAScalingRules ScaleDown;

/// <summary>
/// scaleUp is scaling policy for scaling Up. If not set, the default value is the higher
/// of:
/// * increase no more than 4 pods per 60 seconds
/// * double the number of pods per 60 seconds
/// No stabilization is used.
/// </summary>
public readonly Autoscaling.V2Beta2.HPAScalingRules ScaleUp;

[OutputConstructor]
private HorizontalPodAutoscalerBehavior(
Autoscaling.V2Beta2.HPAScalingRules @scaleDown,
Autoscaling.V2Beta2.HPAScalingRules @scaleUp)
{
this.ScaleDown = @scaleDown;
this.ScaleUp = @scaleUp;
}

}
/// <summary>
/// HorizontalPodAutoscalerCondition describes the state of a HorizontalPodAutoscaler at a
Expand Down Expand Up @@ -11576,6 +11688,13 @@ public sealed class HorizontalPodAutoscalerList
[OutputType]
public sealed class HorizontalPodAutoscalerSpec
{
/// <summary>
/// behavior configures the scaling behavior of the target in both Up and Down directions
/// (scaleUp and scaleDown fields respectively). If not set, the default HPAScalingRules for
/// scale up and scale down are used.
/// </summary>
public readonly Autoscaling.V2Beta2.HorizontalPodAutoscalerBehavior Behavior;

/// <summary>
/// maxReplicas is the upper limit for the number of replicas to which the autoscaler can
/// scale up. It cannot be less that minReplicas.
Expand Down Expand Up @@ -11609,11 +11728,13 @@ public sealed class HorizontalPodAutoscalerSpec

[OutputConstructor]
private HorizontalPodAutoscalerSpec(
Autoscaling.V2Beta2.HorizontalPodAutoscalerBehavior @behavior,
int @maxReplicas,
ImmutableArray<Autoscaling.V2Beta2.MetricSpec> @metrics,
int @minReplicas,
Autoscaling.V2Beta2.CrossVersionObjectReference @scaleTargetRef)
{
this.Behavior = @behavior;
this.MaxReplicas = @maxReplicas;
this.Metrics = @metrics;
this.MinReplicas = @minReplicas;
Expand Down Expand Up @@ -14258,6 +14379,14 @@ public sealed class ConfigMap
/// </summary>
public readonly ImmutableDictionary<string, string> Data;

/// <summary>
/// Immutable, if set to true, ensures that data stored in the ConfigMap cannot be updated
/// (only object metadata can be modified). If not set to true, the field can be modified at
/// any time. Defaulted to nil. This is an alpha field enabled by ImmutableEphemeralVolumes
/// feature gate.
/// </summary>
public readonly bool Immutable;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
/// may infer this from the endpoint the client submits requests to. Cannot be updated. In
Expand All @@ -14277,12 +14406,14 @@ public sealed class ConfigMap
string @apiVersion,
ImmutableDictionary<string, string> @binaryData,
ImmutableDictionary<string, string> @data,
bool @immutable,
string @kind,
Meta.V1.ObjectMeta @metadata)
{
this.ApiVersion = @apiVersion;
this.BinaryData = @binaryData;
this.Data = @data;
this.Immutable = @immutable;
this.Kind = @kind;
this.Metadata = @metadata;
}
Expand Down Expand Up @@ -14660,7 +14791,7 @@ public sealed class Container
/// be restarted, just as if the livenessProbe failed. This can be used to provide different
/// probe parameters at the beginning of a Pod's lifecycle, when it might take a long time
/// to load data or warm a cache, than during steady-state operation. This cannot be
/// updated. This is an alpha feature enabled by the StartupProbe feature flag. More info:
/// updated. This is a beta feature enabled by the StartupProbe feature flag. More info:
/// https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
/// </summary>
public readonly Core.V1.Probe StartupProbe;
Expand Down Expand Up @@ -21105,6 +21236,14 @@ public sealed class Secret
/// </summary>
public readonly ImmutableDictionary<string, string> Data;

/// <summary>
/// Immutable, if set to true, ensures that data stored in the Secret cannot be updated
/// (only object metadata can be modified). If not set to true, the field can be modified at
/// any time. Defaulted to nil. This is an alpha field enabled by ImmutableEphemeralVolumes
/// feature gate.
/// </summary>
public readonly bool Immutable;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
/// may infer this from the endpoint the client submits requests to. Cannot be updated. In
Expand Down Expand Up @@ -21135,13 +21274,15 @@ public sealed class Secret
private Secret(
string @apiVersion,
ImmutableDictionary<string, string> @data,
bool @immutable,
string @kind,
Meta.V1.ObjectMeta @metadata,
ImmutableDictionary<string, string> @stringData,
string @type)
{
this.ApiVersion = @apiVersion;
this.Data = @data;
this.Immutable = @immutable;
this.Kind = @kind;
this.Metadata = @metadata;
this.StringData = @stringData;
Expand Down Expand Up @@ -26092,9 +26233,9 @@ public sealed class FlowSchemaSpec
/// <summary>
/// `matchingPrecedence` is used to choose among the FlowSchemas that match a given request.
/// The chosen FlowSchema is among those with the numerically lowest (which we take to be
/// logically highest) MatchingPrecedence. Each MatchingPrecedence value must be
/// non-negative. Note that if the precedence is not specified or zero, it will be set to
/// 1000 as default.
/// logically highest) MatchingPrecedence. Each MatchingPrecedence value must be ranged in
/// [1,10000]. Note that if the precedence is not specified, it will be set to 1000 as
/// default.
/// </summary>
public readonly int MatchingPrecedence;

Expand Down Expand Up @@ -27885,21 +28026,23 @@ namespace Pulumi.Kubernetes.Types.Outputs.Networking
namespace V1
{
/// <summary>
/// IPBlock describes a particular CIDR (Ex. "192.168.1.1/24") that is allowed to the pods
/// matched by a NetworkPolicySpec's podSelector. The except entry describes CIDRs that should
/// not be included within this rule.
/// IPBlock describes a particular CIDR (Ex. "192.168.1.1/24","2001:db9::/64") that is allowed
/// to the pods matched by a NetworkPolicySpec's podSelector. The except entry describes CIDRs
/// that should not be included within this rule.
/// </summary>
[OutputType]
public sealed class IPBlock
{
/// <summary>
/// CIDR is a string representing the IP Block Valid examples are "192.168.1.1/24"
/// CIDR is a string representing the IP Block Valid examples are "192.168.1.1/24" or
/// "2001:db9::/64"
/// </summary>
public readonly string Cidr;

/// <summary>
/// Except is a slice of CIDRs that should not be included within an IP Block Valid examples
/// are "192.168.1.1/24" Except values will be rejected if they are outside the CIDR range
/// are "192.168.1.1/24" or "2001:db9::/64" Except values will be rejected if they are
/// outside the CIDR range
/// </summary>
public readonly ImmutableArray<string> Except;

Expand Down Expand Up @@ -29355,7 +29498,7 @@ public sealed class PodDisruptionBudgetStatus
public readonly int ExpectedPods;

/// <summary>
/// Most recent generation observed when updating this PDB status. PodDisruptionsAllowed and
/// Most recent generation observed when updating this PDB status. DisruptionsAllowed and
/// other status information is valid only if observedGeneration equals to PDB's object
/// generation.
/// </summary>
Expand Down Expand Up @@ -30653,12 +30796,10 @@ public sealed class PolicyRule

/// <summary>
/// NonResourceURLs is a set of partial urls that a user should have access to. *s are
/// allowed, but only as the full, final step in the path This name is intentionally
/// different than the internal type so that the DefaultConvert works nicely and because the
/// ordering may be different. Since non-resource URLs are not namespaced, this field is
/// only applicable for ClusterRoles referenced from a ClusterRoleBinding. Rules can either
/// apply to API resources (such as "pods" or "secrets") or non-resource URL paths (such as
/// "/api"), but not both.
/// allowed, but only as the full, final step in the path Since non-resource URLs are not
/// namespaced, this field is only applicable for ClusterRoles referenced from a
/// ClusterRoleBinding. Rules can either apply to API resources (such as "pods" or
/// "secrets") or non-resource URL paths (such as "/api"), but not both.
/// </summary>
public readonly ImmutableArray<string> NonResourceURLs;

Expand Down
9 changes: 9 additions & 0 deletions sdk/nodejs/core/v1/ConfigMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ import { getVersion } from "../../version";
*/
public readonly data: pulumi.Output<{[key: string]: pulumi.Output<string>}>;

/**
* Immutable, if set to true, ensures that data stored in the ConfigMap cannot be updated
* (only object metadata can be modified). If not set to true, the field can be modified at
* any time. Defaulted to nil. This is an alpha field enabled by ImmutableEphemeralVolumes
* feature gate.
*/
public readonly immutable: pulumi.Output<boolean>;

/**
* Kind is a string value representing the REST resource this object represents. Servers may
* infer this from the endpoint the client submits requests to. Cannot be updated. In
Expand Down Expand Up @@ -92,6 +100,7 @@ import { getVersion } from "../../version";
props["apiVersion"] = "v1";
props["binaryData"] = args?.binaryData;
props["data"] = args?.data;
props["immutable"] = args?.immutable;
props["kind"] = "ConfigMap";
props["metadata"] = args?.metadata;

Expand Down
9 changes: 9 additions & 0 deletions sdk/nodejs/core/v1/Secret.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ import { getVersion } from "../../version";
*/
public readonly data: pulumi.Output<object>;

/**
* Immutable, if set to true, ensures that data stored in the Secret cannot be updated (only
* object metadata can be modified). If not set to true, the field can be modified at any
* time. Defaulted to nil. This is an alpha field enabled by ImmutableEphemeralVolumes feature
* gate.
*/
public readonly immutable: pulumi.Output<boolean>;

/**
* Kind is a string value representing the REST resource this object represents. Servers may
* infer this from the endpoint the client submits requests to. Cannot be updated. In
Expand Down Expand Up @@ -106,6 +114,7 @@ import { getVersion } from "../../version";

props["apiVersion"] = "v1";
props["data"] = args?.data === undefined ? undefined : pulumi.secret(args?.data);
props["immutable"] = args?.immutable;
props["kind"] = "Secret";
props["metadata"] = args?.metadata;
props["stringData"] = args?.stringData === undefined ? undefined : pulumi.secret(args?.stringData);
Expand Down
Loading

0 comments on commit e04202d

Please sign in to comment.