Skip to content

Commit

Permalink
Merge pull request #120 from lbrlabs/image_registry
Browse files Browse the repository at this point in the history
feat(provider): add NginxIngressRegistry parameter for Nginx Ingress Controller registry configuration
  • Loading branch information
jaxxstorm authored Aug 19, 2024
2 parents 47dd3ca + 3464986 commit b606502
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 0 deletions.
10 changes: 10 additions & 0 deletions provider/pkg/provider/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ type ClusterArgs struct {
CertificateArn *pulumi.StringInput `pulumi:"certificateArn"`
Tags *pulumi.StringMapInput `pulumi:"tags"`
NginxIngressVersion pulumi.StringInput `pulumi:"nginxIngressVersion"`
NginxIngressRegistry pulumi.StringInput `pulumi:"nginxIngressRegistry"`
EksIamAuthControllerVersion pulumi.StringInput `pulumi:"eksIamAuthControllerVersion"`
ExternalDNSVersion pulumi.StringInput `pulumi:"externalDNSVersion"`
CertManagerVersion pulumi.StringInput `pulumi:"certManagerVersion"`
Expand Down Expand Up @@ -653,6 +654,9 @@ func NewCluster(ctx *pulumi.Context,
},
Values: pulumi.Map{
"controller": pulumi.Map{
"image": pulumi.Map{
"registry": args.NginxIngressRegistry,
},
"metrics": pulumi.Map{
"enabled": realisedIngressConfig.EnableMetrics,
"serviceMonitor": pulumi.Map{
Expand All @@ -664,6 +668,9 @@ func NewCluster(ctx *pulumi.Context,
"replicaCount": realisedIngressConfig.ControllerReplicas,
"admissionWebhooks": pulumi.Map{
"patch": pulumi.Map{
"image": pulumi.Map{
"registry": args.NginxIngressRegistry,
},
"tolerations": pulumi.MapArray{
pulumi.Map{
"key": pulumi.String("node.lbrlabs.com/system"),
Expand Down Expand Up @@ -693,6 +700,9 @@ func NewCluster(ctx *pulumi.Context,
},
},
"defaultBackend": pulumi.Map{
"image": pulumi.Map{
"registry": args.NginxIngressRegistry,
},
"tolerations": pulumi.MapArray{
pulumi.Map{
"key": pulumi.String("node.lbrlabs.com/system"),
Expand Down
4 changes: 4 additions & 0 deletions schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ resources:
nginxIngressVersion:
type: string
description: The version of the nginx ingress controller helm chart to deploy.
nginxIngressRegistry:
type: string
description: The container registry to pull images from.
default: "registry.k8s.io"
eksIamAuthControllerVersion:
type: string
description: The version of the eks-iam-auth-controller helm chart to deploy.
Expand Down
7 changes: 7 additions & 0 deletions sdk/dotnet/Eks/Cluster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,12 @@ public InputList<string> EnabledClusterLogTypes
[Input("letsEncryptEmail")]
public string? LetsEncryptEmail { get; set; }

/// <summary>
/// The container registry to pull images from.
/// </summary>
[Input("nginxIngressRegistry")]
public Input<string>? NginxIngressRegistry { get; set; }

/// <summary>
/// The version of the nginx ingress controller helm chart to deploy.
/// </summary>
Expand Down Expand Up @@ -273,6 +279,7 @@ public ClusterArgs()
EnableOtel = false;
KarpenterVersion = "0.36.2";
LbType = "nlb";
NginxIngressRegistry = "registry.k8s.io";
}
public static new ClusterArgs Empty => new ClusterArgs();
}
Expand Down
7 changes: 7 additions & 0 deletions sdk/go/eks/cluster.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions sdk/nodejs/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export class Cluster extends pulumi.ComponentResource {
resourceInputs["karpenterVersion"] = (args ? args.karpenterVersion : undefined) ?? "0.36.2";
resourceInputs["lbType"] = (args ? args.lbType : undefined) ?? "nlb";
resourceInputs["letsEncryptEmail"] = args ? args.letsEncryptEmail : undefined;
resourceInputs["nginxIngressRegistry"] = (args ? args.nginxIngressRegistry : undefined) ?? "registry.k8s.io";
resourceInputs["nginxIngressVersion"] = args ? args.nginxIngressVersion : undefined;
resourceInputs["systemNodeDesiredCount"] = args ? args.systemNodeDesiredCount : undefined;
resourceInputs["systemNodeInstanceTypes"] = args ? args.systemNodeInstanceTypes : undefined;
Expand Down Expand Up @@ -194,6 +195,10 @@ export interface ClusterArgs {
* The email address to use to issue certificates from Lets Encrypt.
*/
letsEncryptEmail?: string;
/**
* The container registry to pull images from.
*/
nginxIngressRegistry?: pulumi.Input<string>;
/**
* The version of the nginx ingress controller helm chart to deploy.
*/
Expand Down
24 changes: 24 additions & 0 deletions sdk/python/lbrlabs_pulumi_eks/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def __init__(__self__, *,
karpenter_version: Optional[pulumi.Input[str]] = None,
lb_type: Optional[pulumi.Input[str]] = None,
lets_encrypt_email: Optional[str] = None,
nginx_ingress_registry: Optional[pulumi.Input[str]] = None,
nginx_ingress_version: Optional[pulumi.Input[str]] = None,
system_node_desired_count: Optional[pulumi.Input[float]] = None,
system_node_instance_types: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
Expand Down Expand Up @@ -65,6 +66,7 @@ def __init__(__self__, *,
:param pulumi.Input[str] karpenter_version: The version of karpenter to deploy.
:param pulumi.Input[str] lb_type: The type of loadbalancer to provision.
:param str lets_encrypt_email: The email address to use to issue certificates from Lets Encrypt.
:param pulumi.Input[str] nginx_ingress_registry: The container registry to pull images from.
:param pulumi.Input[str] nginx_ingress_version: The version of the nginx ingress controller helm chart to deploy.
:param pulumi.Input[float] system_node_desired_count: The initial number of nodes in the system autoscaling group.
:param pulumi.Input[float] system_node_max_count: The maximum number of nodes in the system autoscaling group.
Expand Down Expand Up @@ -135,6 +137,10 @@ def __init__(__self__, *,
pulumi.set(__self__, "lb_type", lb_type)
if lets_encrypt_email is not None:
pulumi.set(__self__, "lets_encrypt_email", lets_encrypt_email)
if nginx_ingress_registry is None:
nginx_ingress_registry = 'registry.k8s.io'
if nginx_ingress_registry is not None:
pulumi.set(__self__, "nginx_ingress_registry", nginx_ingress_registry)
if nginx_ingress_version is not None:
pulumi.set(__self__, "nginx_ingress_version", nginx_ingress_version)
if system_node_desired_count is not None:
Expand Down Expand Up @@ -403,6 +409,18 @@ def lets_encrypt_email(self) -> Optional[str]:
def lets_encrypt_email(self, value: Optional[str]):
pulumi.set(self, "lets_encrypt_email", value)

@property
@pulumi.getter(name="nginxIngressRegistry")
def nginx_ingress_registry(self) -> Optional[pulumi.Input[str]]:
"""
The container registry to pull images from.
"""
return pulumi.get(self, "nginx_ingress_registry")

@nginx_ingress_registry.setter
def nginx_ingress_registry(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "nginx_ingress_registry", value)

@property
@pulumi.getter(name="nginxIngressVersion")
def nginx_ingress_version(self) -> Optional[pulumi.Input[str]]:
Expand Down Expand Up @@ -499,6 +517,7 @@ def __init__(__self__,
karpenter_version: Optional[pulumi.Input[str]] = None,
lb_type: Optional[pulumi.Input[str]] = None,
lets_encrypt_email: Optional[str] = None,
nginx_ingress_registry: Optional[pulumi.Input[str]] = None,
nginx_ingress_version: Optional[pulumi.Input[str]] = None,
system_node_desired_count: Optional[pulumi.Input[float]] = None,
system_node_instance_types: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
Expand Down Expand Up @@ -530,6 +549,7 @@ def __init__(__self__,
:param pulumi.Input[str] karpenter_version: The version of karpenter to deploy.
:param pulumi.Input[str] lb_type: The type of loadbalancer to provision.
:param str lets_encrypt_email: The email address to use to issue certificates from Lets Encrypt.
:param pulumi.Input[str] nginx_ingress_registry: The container registry to pull images from.
:param pulumi.Input[str] nginx_ingress_version: The version of the nginx ingress controller helm chart to deploy.
:param pulumi.Input[float] system_node_desired_count: The initial number of nodes in the system autoscaling group.
:param pulumi.Input[float] system_node_max_count: The maximum number of nodes in the system autoscaling group.
Expand Down Expand Up @@ -580,6 +600,7 @@ def _internal_init(__self__,
karpenter_version: Optional[pulumi.Input[str]] = None,
lb_type: Optional[pulumi.Input[str]] = None,
lets_encrypt_email: Optional[str] = None,
nginx_ingress_registry: Optional[pulumi.Input[str]] = None,
nginx_ingress_version: Optional[pulumi.Input[str]] = None,
system_node_desired_count: Optional[pulumi.Input[float]] = None,
system_node_instance_types: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
Expand Down Expand Up @@ -643,6 +664,9 @@ def _internal_init(__self__,
lb_type = 'nlb'
__props__.__dict__["lb_type"] = lb_type
__props__.__dict__["lets_encrypt_email"] = lets_encrypt_email
if nginx_ingress_registry is None:
nginx_ingress_registry = 'registry.k8s.io'
__props__.__dict__["nginx_ingress_registry"] = nginx_ingress_registry
__props__.__dict__["nginx_ingress_version"] = nginx_ingress_version
__props__.__dict__["system_node_desired_count"] = system_node_desired_count
__props__.__dict__["system_node_instance_types"] = system_node_instance_types
Expand Down

0 comments on commit b606502

Please sign in to comment.