Skip to content

Commit

Permalink
* Split up the massive "./Tiltfile" file into much more manageable su…
Browse files Browse the repository at this point in the history
…bfiles.

* Switched from the ingress-based version of Traefik (under @Attempt6 folder) to the gateway-based one (under @attempt7 folder). Gateway-approach is cleaner, and is apparently the focus/future. While I think it still has the certificate-provisioning bug (traefik/traefik#9158), it was flagged recently as "bug:confirmed", so it'll likely be fixed eventually -- and I don't need it fixed right away, since Cloudflare offers the "Flexible" HTTPS option, which solves the main problem (ie. for end-users) for now.
* Improved traefik's gateway config, by having it no longer require the "NET_BIND_SERVICE" security-context.
* Updated traefik to latest version, by changing the helm-chart version.
* Updated traefik's gateway config, to the latest contents found at: https://github.com/kubernetes-sigs/gateway-api/blob/69e4d8b69b8ec936bc1ed3ca8af807cd45dca09d/config/webhook
* Removed some folders for kube-prometheus and such. (superseded by loki-stack)
* Fixed that the grafana.debatemap.app subdomain was not working. (I had only tested locally previously using localhost:XXXX, whereas in prod I needed to handle the fact that the service was in another namespace)
  • Loading branch information
Venryx committed Jan 17, 2023
1 parent fb70453 commit 81a4cfa
Show file tree
Hide file tree
Showing 150 changed files with 1,116 additions and 80,516 deletions.
2 changes: 1 addition & 1 deletion Packages/app-server/Dockerfile.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ target
.eslintrc.cjs
package-scripts.js
README.md
Tiltfile
Tilt
templateBase.dockerignore

# within packages
Expand Down
2 changes: 1 addition & 1 deletion Packages/deploy/@JSBase/Dockerfile.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ target
.eslintrc.cjs
package-scripts.js
README.md
Tiltfile
Tilt
templateBase.dockerignore

# within packages
Expand Down
2 changes: 1 addition & 1 deletion Packages/deploy/@RustBase/Dockerfile.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ target
.eslintrc.cjs
package-scripts.js
README.md
Tiltfile
Tilt
templateBase.dockerignore

# within packages
Expand Down
49 changes: 34 additions & 15 deletions Packages/deploy/LoadBalancer/@Attempt7/@Helm/traefik-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,47 @@ additionalArguments:
- "--api.dashboard"
- --log.level=debug

hostNetwork: true
# fix approach 1
- '--serversTransport.insecureSkipVerify=true'

# fix approach 2
insecureSkipVerify: true
# fix approach 3
ssl:
insecureSkipVerify: true

# fix approach 4 (seems best)
serversTransport:
# fixes "x509: certificate signed by unknown authority" error in prod (and apparently it's safe to set this; see: https://community.traefik.io/t/insecureskipverify-explanation/2195/2)
insecureSkipVerify: true


#hostNetwork: true
# see here for what are supposed to be the defaults (but seem messed up in my case): https://github.com/traefik/traefik-helm-chart/blob/ff25058604da2eeee7eac3fec3b1e0e89949c407/traefik/values.yaml
ports:
web:
port: 80
#port: 8000
#hostPort: 80
#port: 80
port: 8000
#port: 8005
hostPort: 80
#expose: true
#exposedPort: 80
#redirectTo: websecure
websecure:
port: 443
#port: 8443
#hostPort: 443
#port: 443
port: 8443
#port: 8006
hostPort: 443
#expose: true
#exposedPort: 443

securityContext:
capabilities:
drop: [ALL]
add: [NET_BIND_SERVICE]
readOnlyRootFilesystem: true
runAsGroup: 0
runAsNonRoot: false
runAsUser: 0
# needed for binding to the host's 80/443 ports, when deploying to the ovh/production cluster (see: https://github.com/traefik/traefik-helm-chart/issues/516#issuecomment-949041101)
# note: seems to conflict with loki-stack (which also tries to use the protected 80:443 host-ports, I think)
# securityContext:
# capabilities:
# drop: [ALL]
# add: [NET_BIND_SERVICE]
# readOnlyRootFilesystem: true
# runAsGroup: 0
# runAsNonRoot: false
# runAsUser: 0
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
apiVersion: v1
kind: Namespace
metadata:
name: gateway-api
labels:
name: gateway-api
---
# from: https://github.com/kubernetes-sigs/gateway-api/blob/69e4d8b69b8ec936bc1ed3ca8af807cd45dca09d/config/webhook/admission_webhook.yaml

apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
Expand All @@ -13,13 +8,9 @@ webhooks:
- name: validate.gateway.networking.k8s.io
matchPolicy: Equivalent
rules:
- operations: [ "CREATE" , "UPDATE" ]
apiGroups: [ "networking.x-k8s.io" ]
apiVersions: [ "v1alpha1" ]
resources: [ "gateways", "gatewayclasses", "httproutes" ]
- operations: [ "CREATE" , "UPDATE" ]
apiGroups: [ "gateway.networking.k8s.io" ]
apiVersions: [ "v1alpha2" ]
apiVersions: [ "v1alpha2", "v1beta1" ]
resources: [ "gateways", "gatewayclasses", "httproutes" ]
failurePolicy: Fail
sideEffects: None
Expand All @@ -28,17 +19,16 @@ webhooks:
clientConfig:
service:
name: gateway-api-admission-server
namespace: gateway-api
namespace: gateway-system
path: "/validate"
---
apiVersion: v1
kind: Service
metadata:
labels:
name: gateway-api-webhook-server
version: 0.0.1
name: gateway-api-admission-server
namespace: gateway-api
namespace: gateway-system
spec:
type: ClusterIP
ports:
Expand All @@ -52,7 +42,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: gateway-api-admission-server
namespace: gateway-api
namespace: gateway-system
labels:
name: gateway-api-admission-server
spec:
Expand All @@ -68,7 +58,7 @@ spec:
spec:
containers:
- name: webhook
image: gcr.io/k8s-staging-gateway-api/admission-server:v0.4.3
image: gcr.io/k8s-staging-gateway-api/admission-server:v0.6.0
imagePullPolicy: Always
args:
- -logtostderr
Expand All @@ -95,4 +85,4 @@ spec:
volumes:
- name: webhook-certs
secret:
secretName: gateway-api-admission
secretName: gateway-api-admission
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
# v-removed
# apiVersion: v1
# kind: Namespace
# metadata:
# name: gateway-api
# labels:
# name: gateway-api
# ---
# from: https://github.com/kubernetes-sigs/gateway-api/blob/69e4d8b69b8ec936bc1ed3ca8af807cd45dca09d/config/webhook/certificate_config.yaml

apiVersion: v1
kind: ServiceAccount
metadata:
name: gateway-api-admission
labels:
name: gateway-api-webhook
namespace: gateway-api
namespace: gateway-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand All @@ -37,15 +30,15 @@ metadata:
annotations:
labels:
name: gateway-api-webhook
namespace: gateway-api
namespace: gateway-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: gateway-api-admission
subjects:
- kind: ServiceAccount
name: gateway-api-admission
namespace: gateway-api
namespace: gateway-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
Expand All @@ -54,7 +47,7 @@ metadata:
annotations:
labels:
name: gateway-api-webhook
namespace: gateway-api
namespace: gateway-system
rules:
- apiGroups:
- ''
Expand All @@ -71,15 +64,15 @@ metadata:
annotations:
labels:
name: gateway-api-webhook
namespace: gateway-api
namespace: gateway-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: gateway-api-admission
subjects:
- kind: ServiceAccount
name: gateway-api-admission
namespace: gateway-api
namespace: gateway-system
---
apiVersion: batch/v1
kind: Job
Expand All @@ -88,7 +81,7 @@ metadata:
annotations:
labels:
name: gateway-api-webhook
namespace: gateway-api
namespace: gateway-system
spec:
template:
metadata:
Expand All @@ -102,8 +95,8 @@ spec:
imagePullPolicy: IfNotPresent
args:
- create
- --host=gateway-api-admission-server,gateway-api-admission-server.gateway-api.svc
- --namespace=gateway-api
- --host=gateway-api-admission-server,gateway-api-admission-server.gateway-system.svc
- --namespace=gateway-system
- --secret-name=gateway-api-admission
env:
- name: POD_NAMESPACE
Expand All @@ -122,7 +115,7 @@ metadata:
name: gateway-api-admission-patch
labels:
name: gateway-api-webhook
namespace: gateway-api
namespace: gateway-system
spec:
template:
metadata:
Expand All @@ -137,7 +130,7 @@ spec:
args:
- patch
- --webhook-name=gateway-api-admission
- --namespace=gateway-api
- --namespace=gateway-system
- --patch-mutating=false
- --patch-validating=true
- --secret-name=gateway-api-admission
Expand All @@ -151,4 +144,4 @@ spec:
serviceAccountName: gateway-api-admission
securityContext:
runAsNonRoot: true
runAsUser: 2000
runAsUser: 2000
Loading

0 comments on commit 81a4cfa

Please sign in to comment.