Skip to content

Commit

Permalink
opt(apps/gcp,apps/dev): unitfy apps/dev into apps/gcp (#775)
Browse files Browse the repository at this point in the history
## Why

To save a GCP cluster for cost.

Signed-off-by: wuhuizuo <[email protected]>
  • Loading branch information
wuhuizuo committed Nov 17, 2023
1 parent 77f153f commit b2d8672
Show file tree
Hide file tree
Showing 74 changed files with 45 additions and 6,966 deletions.
9 changes: 0 additions & 9 deletions apps/dev/kustomization.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions apps/dev/prow-crd.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions apps/dev/gateways.yaml → apps/gcp/gateways-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
name: gateways
namespace: apps
namespace: apps-dev
spec:
interval: 5m0s
sourceRef:
kind: GitRepository
name: flux-system
namespace: flux-system
path: ./apps/dev/gateways
path: ./apps/gcp/gateways-dev
prune: true
wait: true
postBuild:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
mode: Terminate
certificateRefs:
- name: prow-tls
namespace: apps
namespace: apps-dev
addresses:
- type: NamedAddress
value: ${INGRESS_STATIC_IP_NAME}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: apps
namespace: apps-dev
resources:
- gke-gateway.yaml
4 changes: 4 additions & 0 deletions apps/gcp/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@ kind: Kustomization
resources:
- ../_base
- namespace.yaml
- namespace-dev.yaml
- prow-crd.yaml
- prow
- gateways-dev.yaml
- prow-dev
- tekton-dev
2 changes: 1 addition & 1 deletion apps/dev/namespace.yaml → apps/gcp/namespace-dev.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: apps
name: apps-dev
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions apps/dev/prow/post.yaml → apps/gcp/prow-dev/post.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
name: prow-post
name: prow-dev-post
namespace: flux-system
spec:
dependsOn:
- name: prow-release
- name: prow-dev-release
namespace: flux-system
interval: 5m0s
sourceRef:
kind: GitRepository
name: flux-system
namespace: flux-system
path: ./apps/dev/prow/post
path: ./apps/gcp/prow-dev/post
prune: true
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: batch/v1
kind: CronJob
metadata:
namespace: apps
namespace: apps-dev
name: prow-label-sync
spec:
schedule: "@hourly"
Expand Down
6 changes: 3 additions & 3 deletions apps/dev/prow/pre.yaml → apps/gcp/prow-dev/pre.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
name: prow-pre
name: prow-dev-pre
namespace: flux-system
spec:
interval: 5m0s
sourceRef:
kind: GitRepository
name: flux-system
namespace: flux-system
path: ./apps/dev/prow/pre
path: ./apps/gcp/prow-dev/pre
prune: true
postBuild:
substitute:
TEST_PODS_NAMESPACE: prow-test-pods
TEST_PODS_NAMESPACE: prow-dev-test-pods
BUCKET_NAME: prow-dev-tidb-logs
DOMAIN_NAME: prow-dev.tidb.net
substituteFrom:
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
configMapGenerator:
- name: prow-config
namespace: apps
namespace: apps-dev
options:
disableNameSuffixHash: true
files:
- config.yaml
- name: prow-plugin
namespace: apps
namespace: apps-dev
options:
disableNameSuffixHash: true
files:
- plugins.yaml
- name: prow-labels
namespace: apps
namespace: apps-dev
options:
disableNameSuffixHash: true
files:
- labels.yaml
- name: prow-job
namespace: apps
namespace: apps-dev
options:
disableNameSuffixHash: true
files: []
- name: prow-external-plugins-config
namespace: apps
namespace: apps-dev
options:
disableNameSuffixHash: true
files:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: Secret
metadata:
name: prow-github
namespace: apps
namespace: apps-dev
type: Opaque
data:
# FluxCD GitOps can not substitute multiple with lines, so we use base64.
Expand All @@ -20,7 +20,7 @@ apiVersion: v1
kind: Secret
metadata:
name: prow-webhook
namespace: apps
namespace: apps-dev
type: Opaque
stringData:
hmac: "${GITHUB_APP_WEBHOOK_HMAC}"
Expand All @@ -29,7 +29,7 @@ apiVersion: v1
kind: Secret
metadata:
name: prow-oauth-cookie
namespace: apps
namespace: apps-dev
type: Opaque
stringData:
secret: "${OAUTH_COOKIE_SECRET}"
Expand All @@ -38,7 +38,7 @@ apiVersion: v1
kind: Secret
metadata:
name: prow-gcs-credentials
namespace: apps
namespace: apps-dev
type: Opaque
data:
# FluxCD GitOps can not substitute multiple with lines, so we use base64.
Expand Down
8 changes: 4 additions & 4 deletions apps/dev/prow/release.yaml → apps/gcp/prow-dev/release.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
name: prow-release
name: prow-dev-release
namespace: flux-system
spec:
dependsOn:
- name: prow-pre
- name: prow-dev-pre
namespace: flux-system
interval: 5m0s
sourceRef:
kind: GitRepository
name: flux-system
namespace: flux-system
path: ./apps/dev/prow/release
path: ./apps/gcp/prow-dev/release
prune: true
wait: true
postBuild:
substitute:
BUCKET_NAME: prow-dev-tidb-logs
TEST_PODS_NAMESPACE: prow-test-pods
TEST_PODS_NAMESPACE: prow-dev-test-pods
DOMAIN_NAME: prow-dev.tidb.net

### need secret `prow-jenkins-operator-auth` with keys:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
name: prow
namespace: apps
namespace: apps-dev
spec:
parentRefs:
- kind: Gateway
name: external-https
namespace: apps
namespace: apps-dev
hostnames:
- "${DOMAIN_NAME}"
rules:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: prow
name: prow-dev
namespace: flux-system
spec:
releaseName: prow
targetNamespace: apps
targetNamespace: apps-dev
chart:
spec:
chart: prow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
name: tekton-configs
namespace: apps
namespace: apps-dev
spec:
interval: 1m0s
sourceRef:
kind: GitRepository
name: flux-system
namespace: flux-system
path: ./apps/dev/tekton/configs
path: ./apps/gcp/tekton-dev/configs
dependsOn:
- name: tekton-setup
namespace: apps
namespace: apps-dev
prune: true
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
name: tekton-ingress
namespace: apps
namespace: apps-dev
spec:
interval: 1m0s
sourceRef:
kind: GitRepository
name: flux-system
namespace: flux-system
path: ./apps/dev/tekton/ingress
path: ./apps/gcp/tekton-dev/ingress
dependsOn:
- name: tekton-setup
namespace: apps
namespace: apps-dev
- name: tekton-configs
namespace: apps
namespace: apps-dev
prune: true
postBuild:
substitute:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
name: tekton
namespace: apps
namespace: apps-dev
spec:
parentRefs:
- kind: Gateway
name: external-https
namespace: apps
namespace: apps-dev
hostnames:
- "${DOMAIN_NAME}"
rules:
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions apps/dev/tekton/setup.yaml → apps/gcp/tekton-dev/setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
name: tekton-setup
namespace: apps
namespace: apps-dev
spec:
sourceRef:
kind: GitRepository
name: flux-system
namespace: flux-system
path: ./apps/dev/tekton/setup
path: ./apps/gcp/tekton-dev/setup
interval: 1m0s
prune: true
wait: false
Expand Down Expand Up @@ -50,7 +50,7 @@ spec:
postBuild:
substituteFrom:
- kind: Secret
name: tekton-ingress # should manual created in namespace `apps`
name: tekton-ingress # should manual created in namespace `apps-dev`
optional: true
images:
- name: gcr.io/tekton-nightly/github.com/tektoncd/experimental/pipelines-in-pipelines/cmd/controller
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 0 additions & 14 deletions clusters/dev/README.md

This file was deleted.

13 changes: 0 additions & 13 deletions clusters/dev/apps.yaml

This file was deleted.

Loading

0 comments on commit b2d8672

Please sign in to comment.