Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #128 from SomeoneWeird/custom-ingress
Browse files Browse the repository at this point in the history
Allow setting a custom ingress controller
  • Loading branch information
andresmgot authored Jun 28, 2018
2 parents 7ce5120 + 977e701 commit 852b0ec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions deploy/kubelessDeploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ class KubelessDeploy {
namespace: this.serverless.service.provider.namespace,
hostname: this.serverless.service.provider.hostname,
defaultDNSResolution: this.serverless.service.provider.defaultDNSResolution,
ingress: this.serverless.service.provider.ingress,
memorySize: this.serverless.service.provider.memorySize,
force: this.options.force,
verbose: this.options.verbose,
Expand Down
2 changes: 2 additions & 0 deletions lib/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ function deploy(functions, runtime, service, options) {
log: options.log,
hostname: options.hostname,
defaultDNSResolution: options.defaultDNSResolution,
ingress: options.ingress,
namespace: ns,
}),
});
Expand All @@ -500,6 +501,7 @@ function deploy(functions, runtime, service, options) {
log: options.log,
hostname: options.hostname,
defaultDNSResolution: options.defaultDNSResolution,
ingress: options.ingress,
namespace: ns,
}),
});
Expand Down
7 changes: 5 additions & 2 deletions lib/ingress.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ function addIngressRuleIfNecessary(ruleName, functions, options) {
namespace: 'default',
hostname: null,
defaultDNSResolution: 'nip.io',
ingress: _.defaults({
class: 'nginx',
}),
});
const config = helpers.loadKubeConfig();
const extensions = new Api.Extensions(helpers.getConnectionOptions(
Expand Down Expand Up @@ -75,8 +78,8 @@ function addIngressRuleIfNecessary(ruleName, functions, options) {
metadata: {
name: ruleName,
annotations: {
'kubernetes.io/ingress.class': 'nginx',
'nginx.ingress.kubernetes.io/rewrite-target': '/',
'kubernetes.io/ingress.class': opts.ingress.class,
[`${opts.ingress.class}.ingress.kubernetes.io/rewrite-target`]: '/',
},
},
spec: { rules },
Expand Down

0 comments on commit 852b0ec

Please sign in to comment.