Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nginx-ingress): internal ingress for azure #38

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading