-
Notifications
You must be signed in to change notification settings - Fork 0
[codex] Deploy Even G2 main app on lolice #597
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
Merged
+239
−0
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
argoproj/argocd-image-updater/imageupdaters/even-g2-lab.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| apiVersion: argocd-image-updater.argoproj.io/v1alpha1 | ||
| kind: ImageUpdater | ||
| metadata: | ||
| name: even-g2-lab | ||
| namespace: argocd | ||
| spec: | ||
| namespace: argocd | ||
| applicationRefs: | ||
| - namePattern: "even-g2-lab" | ||
| images: | ||
| - alias: "web" | ||
| imageName: "839695154978.dkr.ecr.ap-northeast-1.amazonaws.com/even-g2-client-main:latest" | ||
| commonUpdateSettings: | ||
| updateStrategy: "newest-build" | ||
| pullSecret: "pullsecret:argocd/regcred" | ||
| manifestTargets: | ||
| kustomize: | ||
| name: "839695154978.dkr.ecr.ap-northeast-1.amazonaws.com/even-g2-client-main" | ||
| writeBackConfig: | ||
| method: "git:secret:argocd/repo-lolice" | ||
| gitConfig: | ||
| branch: "main" | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,3 +6,4 @@ resources: | |
| - palserver.yaml | ||
| - ark-survival-ascended.yaml | ||
| - ark-discord-bot.yaml | ||
| - even-g2-lab.yaml | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| apiVersion: argoproj.io/v1alpha1 | ||
| kind: Application | ||
| metadata: | ||
| name: even-g2-lab | ||
| namespace: argocd | ||
| spec: | ||
| destination: | ||
| namespace: even-g2-lab | ||
| server: https://kubernetes.default.svc | ||
| project: default | ||
| source: | ||
| repoURL: https://github.com/boxp/lolice | ||
| targetRevision: main | ||
| path: argoproj/even-g2-lab | ||
| syncPolicy: | ||
| automated: | ||
| prune: true | ||
| selfHeal: true | ||
| syncOptions: | ||
| - CreateNamespace=true | ||
| - ServerSideApply=true | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: even-g2-lab-cloudflared | ||
| namespace: even-g2-lab | ||
| spec: | ||
| replicas: 1 | ||
| selector: | ||
| matchLabels: | ||
| app: cloudflared | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: cloudflared | ||
| spec: | ||
| containers: | ||
| - name: cloudflared | ||
| image: docker.io/cloudflare/cloudflared:2026.5.2 | ||
| imagePullPolicy: IfNotPresent | ||
| args: | ||
| - tunnel | ||
| - --metrics | ||
| - 0.0.0.0:2000 | ||
| - run | ||
| - --protocol | ||
| - http2 | ||
| - --token | ||
| - $(TUNNEL_TOKEN) | ||
| ports: | ||
| - name: metrics | ||
| containerPort: 2000 | ||
| livenessProbe: | ||
| httpGet: | ||
| path: /ready | ||
| port: metrics | ||
| failureThreshold: 1 | ||
| initialDelaySeconds: 10 | ||
| periodSeconds: 10 | ||
| envFrom: | ||
| - secretRef: | ||
| name: even-g2-lab-cloudflared-secret |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: even-g2-main | ||
| namespace: even-g2-lab | ||
| spec: | ||
| replicas: 1 | ||
| selector: | ||
| matchLabels: | ||
| app: even-g2-main | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: even-g2-main | ||
| spec: | ||
| imagePullSecrets: | ||
| - name: regcred | ||
| containers: | ||
| - name: web | ||
| image: 839695154978.dkr.ecr.ap-northeast-1.amazonaws.com/even-g2-client-main:bootstrap | ||
| ports: | ||
| - name: http | ||
| containerPort: 8080 | ||
| readinessProbe: | ||
| httpGet: | ||
| path: / | ||
| port: http | ||
| initialDelaySeconds: 5 | ||
| periodSeconds: 10 | ||
| livenessProbe: | ||
| httpGet: | ||
| path: / | ||
| port: http | ||
| initialDelaySeconds: 30 | ||
| periodSeconds: 20 | ||
| resources: | ||
| requests: | ||
| cpu: 25m | ||
| memory: 64Mi | ||
| limits: | ||
| cpu: 250m | ||
| memory: 256Mi | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| apiVersion: external-secrets.io/v1 | ||
| kind: ExternalSecret | ||
| metadata: | ||
| name: external-secret-even-g2-lab-cloudflared | ||
| namespace: even-g2-lab | ||
| spec: | ||
| refreshInterval: 1h | ||
| secretStoreRef: | ||
| name: parameterstore | ||
| kind: ClusterSecretStore | ||
| target: | ||
| name: even-g2-lab-cloudflared-secret | ||
| creationPolicy: Owner | ||
| data: | ||
| - secretKey: TUNNEL_TOKEN | ||
| remoteRef: | ||
| conversionStrategy: Default | ||
| decodingStrategy: None | ||
| key: even-g2-lab-tunnel-token | ||
| metadataPolicy: None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| apiVersion: kustomize.config.k8s.io/v1beta1 | ||
| kind: Kustomization | ||
|
|
||
| resources: | ||
| - namespace.yaml | ||
| - external-secret-cloudflared.yaml | ||
| - deployment-cloudflared.yaml | ||
| - deployment.yaml | ||
| - service-cloudflared-metrics.yaml | ||
| - service.yaml | ||
| - networkpolicy.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| apiVersion: v1 | ||
| kind: Namespace | ||
| metadata: | ||
| name: even-g2-lab | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| apiVersion: projectcalico.org/v3 | ||
| kind: NetworkPolicy | ||
| metadata: | ||
| name: even-g2-main-network-policy | ||
| namespace: even-g2-lab | ||
| spec: | ||
| selector: app == 'even-g2-main' | ||
| types: | ||
| - Ingress | ||
| ingress: | ||
| - action: Allow | ||
| protocol: TCP | ||
| source: | ||
| namespaceSelector: kubernetes.io/metadata.name == 'even-g2-lab' | ||
| selector: app == 'cloudflared' | ||
| destination: | ||
| ports: | ||
| - 8080 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: even-g2-lab-cloudflared-metrics | ||
| namespace: even-g2-lab | ||
| spec: | ||
| selector: | ||
| app: cloudflared | ||
| type: NodePort | ||
| ports: | ||
| - protocol: TCP | ||
| port: 2000 | ||
| targetPort: metrics | ||
| name: metrics |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: even-g2-main | ||
| namespace: even-g2-lab | ||
| spec: | ||
| type: ClusterIP | ||
| selector: | ||
| app: even-g2-main | ||
| ports: | ||
| - name: http | ||
| protocol: TCP | ||
| port: 80 | ||
| targetPort: http |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # BOXP-17: Even G2 main deployment on lolice | ||
|
|
||
| ## Goal | ||
|
|
||
| `boxp/even-g2-lab` の main branch build を lolice cluster 上に配信し、Cloudflare WARP 経由の private hostname から Even Realities App が QR sideloading できるようにする。 | ||
|
|
||
| ## Design | ||
|
|
||
| - Application: `argoproj/even-g2-lab` | ||
| - Namespace: `even-g2-lab` | ||
| - Workload: nginx static image `839695154978.dkr.ecr.ap-northeast-1.amazonaws.com/even-g2-client-main` | ||
| - Service: `ClusterIP` `even-g2-main.even-g2-lab.svc.cluster.local:80` | ||
| - Access path: Cloudflare private hostname route -> Gateway initial resolved IP -> `even-g2-lab` `cloudflared` tunnel ingress -> Kubernetes service DNS | ||
| - Cloudflared token: ExternalSecret reads `even-g2-lab-tunnel-token` from SSM Parameter Store. | ||
| - Image updates: Argo CD Image Updater watches ECR newest build and writes the selected tag back to `main`. | ||
|
|
||
| ## Tasks | ||
|
|
||
| - [x] Add `even-g2-lab` Argo CD Application. | ||
| - [x] Add Deployment/ClusterIP Service/NetworkPolicy for main static app. | ||
| - [x] Add dedicated `cloudflared` Deployment and ExternalSecret in `even-g2-lab`. | ||
| - [x] Add ImageUpdater resource for ECR image updates. | ||
| - [x] Validate YAML manifests. | ||
| - [ ] After merge/apply, confirm `regcred` exists in `even-g2-lab` namespace. | ||
| - [ ] Confirm `even-g2-lab` `cloudflared` can route `even-g2-main.b0xp.io` to `http://even-g2-main.even-g2-lab.svc.cluster.local:80`. | ||
| - [ ] After first image push, confirm ImageUpdater updates the image tag. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
新規 namespace に対してこの Deployment がすぐ作られる一方、
regcredはargoproj/k8s-ecr-token-updater/cronjob.yamlの 10 時間ごとの CronJob が全 namespace を巡回して作る仕組みでした。CronJob の直後にeven-g2-labが作成されると、次回実行までこの private ECR image を pull できずImagePullBackOffになるため、アプリ初回デプロイや再作成時に最大 10 時間立ち上がりません。この namespace 用の pull secret を同じ Application で作るか、namespace 作成直後に同期される仕組みにしてください。Useful? React with 👍 / 👎.