Skip to content

Commit

Permalink
feat(nginx-ingress): internal ingress for azure
Browse files Browse the repository at this point in the history
  • Loading branch information
jenglisch-clf committed Nov 27, 2023
1 parent 7d54207 commit a42c4fb
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions infrastructure/nginx-ingress/nginx-ingress.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ local k = (import '../../prelude.libsonnet');
// begin_config
nginxingress: {
name: 'nginx-ingress',
loadBalancerIP: error 'you need a static loadbalancer (public ip)',
type: 'external',
loadBalancerIP: error 'you need a static loadbalancer ip (public IP for external, internal IP for internal)',
internalSubnetAzure: null,
replicas: 2,
},
// end_config
Expand All @@ -17,10 +19,18 @@ local k = (import '../../prelude.libsonnet');
local this = self,
local cfg = $._config.nginxingress + config,

'service-ingress-nginx-controller'+: {
'service-ingress-nginx-controller'+: if cfg.type == 'external' then {
spec+: {
loadBalancerIP: cfg.loadBalancerIP,
},
} else if cfg.type == 'internal-azure' then {
metadata+: {
annotations+: {
'service.beta.kubernetes.io/azure-load-balancer-internal': 'true',
'service.beta.kubernetes.io/azure-load-balancer-ipv4': cfg.loadBalancerIP,
[if cfg.internalSubnetAzure != null then 'service.beta.kubernetes.io/azure-load-balancer-internal-subnet' else null]: cfg.internalSubnetAzure,
},
},
},

'deployment-ingress-nginx-controller'+: {
Expand Down

0 comments on commit a42c4fb

Please sign in to comment.