Skip to content

Commit

Permalink
feat(apps/prod/coder): add experiment
Browse files Browse the repository at this point in the history
Signed-off-by: wuhuizuo <wuhuizuo@126.com>
  • Loading branch information
wuhuizuo committed Aug 30, 2024
1 parent a098d09 commit 864f671
Show file tree
Hide file tree
Showing 7 changed files with 128 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/prod/coder/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- release.yaml
20 changes: 20 additions & 0 deletions apps/prod/coder/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
name: coder-release
namespace: flux-system
spec:
interval: 5m0s
sourceRef:
kind: GitRepository
name: flux-system
namespace: flux-system
path: ./apps/prod/coder/release
prune: true
postBuild:
substituteFrom:
# Need keys:
# - CODER_PG_CONNECTION_URL
- kind: Secret
name: coder-release
6 changes: 6 additions & 0 deletions apps/prod/coder/release/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- source.yaml
- release.yaml
9 changes: 9 additions & 0 deletions apps/prod/coder/release/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: Namespace
metadata:
name: coder
annotations:
scheduler.alpha.kubernetes.io/defaultTolerations:
'[{"operator": "Equal", "effect": "NoSchedule", "key": "dedicated",
"value": "test-infra"}]'
scheduler.alpha.kubernetes.io/node-selector: enable-ci=true,kubernetes.io/arch=amd64
80 changes: 80 additions & 0 deletions apps/prod/coder/release/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: coder
namespace: coder
spec:
chart:
spec:
chart: coder
version: 2.14.2
reconcileStrategy: ChartVersion
sourceRef:
kind: HelmRepository
name: coder-v2
namespace: coder
interval: 5m0s
values:
# coder -- Primary configuration for `coder server`.
coder:
# coder.env -- The environment variables to set for Coder. These can be used
# to configure all aspects of `coder server`. Please see `coder server --help`
# for information about what environment variables can be set.
# Note: The following environment variables are set by default and cannot be
# overridden:
# - CODER_HTTP_ADDRESS: set to 0.0.0.0:8080 and cannot be changed.
# - CODER_TLS_ADDRESS: set to 0.0.0.0:8443 if tls.secretName is not empty.
# - CODER_TLS_ENABLE: set if tls.secretName is not empty.
# - CODER_TLS_CERT_FILE: set if tls.secretName is not empty.
# - CODER_TLS_KEY_FILE: set if tls.secretName is not empty.
# - CODER_PROMETHEUS_ADDRESS: set to 0.0.0.0:2112 and cannot be changed.
# Prometheus must still be enabled by setting CODER_PROMETHEUS_ENABLE.
# - KUBE_POD_IP
# - CODER_DERP_SERVER_RELAY_URL
#
# We will additionally set CODER_ACCESS_URL if unset to the cluster service
# URL, unless coder.envUseClusterAccessURL is set to false.
env:
- name: "CODER_ACCESS_URL"
value: "https://coder.pingcap.net"
- name: CODER_PG_CONNECTION_URL
value: "${CODER_PG_CONNECTION_URL}"

# coder.resources -- The resources to request for Coder. These are optional
# and are not set by default.
resources:
limits:
cpu: 2000m
memory: 4096Mi
requests:
cpu: 2000m
memory: 4096Mi

# coder.nodeSelector -- Node labels for constraining coder pods to nodes.
# See: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
nodeSelector:
kubernetes.io/os: linux
kubernetes.io/arch: amd64

# coder.service -- The Service object to expose for Coder.
service:
# coder.service.enable -- Whether to create the Service object.
enable: true
# coder.service.type -- The type of service to expose. See:
# https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
type: ClusterIP

# coder.ingress -- The Ingress object to expose for Coder.
ingress:
# coder.ingress.enable -- Whether to create the Ingress object. If using an
# Ingress, we recommend not specifying coder.tls.secretNames as the Ingress
# will handle TLS termination.
enable: true
# coder.ingress.className -- The name of the Ingress class to use.
className: "nginx"
# coder.ingress.host -- The hostname to match on.
# Be sure to also set CODER_ACCESS_URL within coder.env[]
host: "coder.pingcap.net"



8 changes: 8 additions & 0 deletions apps/prod/coder/release/source.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
name: coder-v2
namespace: coder
spec:
interval: 24h0m0s
url: https://helm.coder.com/v2
1 change: 1 addition & 0 deletions apps/prod/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ resources:
- tibuild
- dl
- harbor
- coder

0 comments on commit 864f671

Please sign in to comment.