Skip to content

Commit e87fe09

Browse files
author
Jonathan Yu
authored
chore: clean up examples (#181)
* Update OpenShift example to create Route with Ingress object * Remove superfluous configuration options * Enable lint check for resource request/limit settings
1 parent fbb99a2 commit e87fe09

File tree

4 files changed

+46
-40
lines changed

4 files changed

+46
-40
lines changed
Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,14 @@
1-
# Using coder with ingress in versions from 1.21 and newer
2-
# Coder's built-in ingress controller is no longer packaged
3-
# the coderd pod does not require a fanout so it is exposed
4-
# by creating a LoadBalancer service
51
coderd:
6-
serviceNext: true
72
devurlsHost: '*.devurls.coderhost.com'
83
serviceSpec:
4+
# The Ingress will route traffic to the internal ClusterIP.
95
type: ClusterIP
10-
# The values.yaml file in the chart includes LoadBalancer
11-
# specs which need to have the keys removed using null
12-
# this does not work as a sub-chart
13-
loadBalancerIP: null
14-
externalTrafficPolicy: null
15-
loadBalancerSourceRanges: null
16-
# Add the ingress values section to enable the ingress resource
17-
# without the controller
6+
187
ingress:
19-
# Enable set to true creates the ingress resource
208
enable: true
21-
# Ingress needs a host name so it can share a controller
9+
# Hostname to use for routing decisions
2210
host: 'coder.coderhost.com'
23-
# useDefault set to false disables creation of the ingress controller
24-
useDefault: false
25-
# add annotations for TLS issuers and such
26-
annotations: {}
11+
# Custom annotations to apply to the resulting Ingress object.
12+
# This is useful for configuring other controllers in the cluster,
13+
# such as cert-manager or the ingress controller.
14+
annotations: {}

examples/kind/kind.values.yaml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
coderd:
2+
replicas: 1
23
serviceSpec:
4+
# Avoid provisioning a LoadBalancer
35
type: ClusterIP
4-
replicas: 1
5-
resources:
6-
requests:
7-
cpu: "0m"
8-
memory: "32Mi"
9-
podSecurityContext:
10-
seccompProfile:
11-
type: RuntimeDefault
6+
7+
# Set the container security context (by default, this inherits
8+
# the settings from the pod security context)
129
securityContext:
13-
seccompProfile:
14-
type: RuntimeDefault
15-
readOnlyRootFilesystem: true
1610
runAsNonRoot: true
1711
runAsUser: 1000
1812
runAsGroup: 1000
1913

14+
# Reduce resource requirements for deployments using kind, which
15+
# we typically use for development and test purposes only.
16+
resources:
17+
requests:
18+
memory: "32Mi"
19+
2020
postgres:
2121
default:
22+
# Reduce resource requirements for deployments using kind, which
23+
# we typically use for development and test purposes only.
2224
resources:
2325
requests:
24-
cpu: "0m"
2526
memory: "32Mi"
Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,34 @@
11
coderd:
2+
replicas: 1
3+
24
serviceSpec:
35
type: ClusterIP
4-
replicas: 1
6+
7+
# OpenShift's default "restricted" Security Context Constraint
8+
# requires that these be unset. OpenShift manages the runAsUser
9+
# (using the project-specific User ID range) and seccompProfile.
510
podSecurityContext:
611
runAsUser: null
12+
runAsGroup: null
713
seccompProfile: null
14+
815
securityContext:
9-
readOnlyRootFilesystem: true
16+
runAsUser: null
17+
runAsGroup: null
1018
seccompProfile: null
1119

12-
postgres:
13-
default:
14-
resources:
15-
requests:
16-
cpu: "0m"
17-
memory: "32Mi"
20+
ingress:
21+
enable: true
22+
# Hostname to use for routing decisions
23+
host: 'coder.apps.openshift.coder.com'
24+
# Custom annotations to apply to the resulting Ingress object.
25+
# This is useful for configuring other controllers in the cluster,
26+
# such as cert-manager or the ingress controller.
27+
#
28+
# OpenShift supports annotations that configure the corresponding
29+
# Route object created from this Ingress. See the documentation:
30+
# https://docs.okd.io/latest/networking/routes/route-configuration.html#nw-ingress-creating-a-route-via-an-ingress_route-configuration
31+
annotations:
32+
route.openshift.io/termination: "edge"
33+
haproxy.router.openshift.io/set-forwarded-headers: "replace"
34+
haproxy.router.openshift.io/balance: "leastconn"

kube-linter.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ checks:
3030
- ssh-port
3131
- unsafe-proc-mount
3232
- unsafe-sysctls
33+
- unset-cpu-requirements
3334
- unset-memory-requirements
3435
- use-namespace
3536
- wildcard-in-rules
@@ -44,4 +45,3 @@ checks:
4445
- non-isolated-pod
4546
- required-annotation-email
4647
- required-label-owner
47-
- unset-cpu-requirements

0 commit comments

Comments
 (0)