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

chore: upgrade treafik and turn on service monitor #30

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shapeshiftoss/cluster-launcher",
"version": "0.19.0",
"version": "0.20.0",
"license": "MIT",
"main": "dist/index.js",
"source": "src/index.ts",
Expand Down
56 changes: 20 additions & 36 deletions src/traefik.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ export interface ingressControllerArgs {
// Requires cert manager to be present beforehand
export class Deployment extends k8s.helm.v3.Chart {
constructor(name: string, args: ingressControllerArgs, opts: pulumi.ComponentResourceOptions) {
const annotations: { [key: string]: pulumi.Output<string> | string } = {
'service.beta.kubernetes.io/aws-load-balancer-backend-protocol': 'http',
'service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout': '30',
// This is for layer 4. It will forward ip through to traefik. THIS DOESN'T SUPPORT SECURITY GROUPS
'service.beta.kubernetes.io/aws-load-balancer-type': 'nlb'
}

name = `${name}-traefik`

super(
Expand All @@ -38,36 +31,27 @@ export class Deployment extends k8s.helm.v3.Chart {
chart: 'traefik',
repo: 'traefik',
namespace: args.namespace,
version: '20.8.0',
version: '24.0.0',
values: {
providers: {
kubernetesIngress: {
// need this so that the Ingress will have "ADDRESS" set from service. External-DNS needs the address
publishedService: {
enabled: true
}
publishedService: { enabled: true }
}
},
ports: {
// TODO secure traefik ingress recommended https://github.com/traefik/traefik-helm-chart/blob/master/traefik/values.yaml#L205
web: {
redirectTo: 'websecure'
}
web: { redirectTo: 'websecure' }
},
logs: {
general: {
level: 'ERROR',
format: 'json'
},
general: { level: 'ERROR', format: 'json' },
access: {
enabled: true,
format: 'json',
fields: {
headers: {
defaultmode: 'keep',
names: {
Authorization: 'redact'
}
names: { Authorization: 'redact' }
}
}
}
Expand All @@ -91,17 +75,20 @@ export class Deployment extends k8s.helm.v3.Chart {
'--entryPoints.websecure.transport.respondingTimeouts.readTimeout=30s',
'--entryPoints.websecure.transport.respondingTimeouts.writeTimeout=30s',
'--entryPoints.websecure.transport.respondingTimeouts.idleTimeout=30s'
//pulumi.interpolate`--entryPoints.websecure.http.middlewares=${args.namespace}-${authHttpsHeader.metadata.name}@kubernetescrd`
],
globalArguments: [], // git rid of sendanonymoususage
service: {
loadBalancerSourceRanges: args.whitelist,
annotations
annotations: {
'service.beta.kubernetes.io/aws-load-balancer-backend-protocol': 'http',
'service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout': '30',
// This is for layer 4. It will forward ip through to traefik. THIS DOESN'T SUPPORT SECURITY GROUPS
'service.beta.kubernetes.io/aws-load-balancer-type': 'nlb'
}
},
ingressRoute: {
dashboard: {
enabled: false // disable dashboard deploy via helmchart. uses Hooks which aren't supported by pulumi. https://github.com/pulumi/pulumi-kubernetes/issues/555
}
// disable dashboard deploy via helmchart. uses Hooks which aren't supported by pulumi. https://github.com/pulumi/pulumi-kubernetes/issues/555
dashboard: { enabled: false }
},
affinity: {
podAntiAffinity: {
Expand All @@ -110,13 +97,7 @@ export class Deployment extends k8s.helm.v3.Chart {
weight: 100,
podAffinityTerm: {
labelSelector: {
matchExpressions: [
{
key: 'app',
operator: 'In',
values: [name]
}
]
matchExpressions: [{ key: 'app', operator: 'In', values: [name] }]
},
topologyKey: 'failure-domain.beta.kubernetes.io/zone'
}
Expand All @@ -130,9 +111,12 @@ export class Deployment extends k8s.helm.v3.Chart {
},
deployment: {
replicas: args.replicas,
podAnnotations: {
'prometheus.io/port': '9100',
'prometheus.io/scrape': 'true'
},
metrics: {
prometheus: {
serviceMonitor: {
namespace: args.namespace,
}
}
}
},
Expand Down