Skip to content
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

add sco-redirect app #117

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/set-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
- grep
- web
- api-v0-shim
- sco-redirect
environment:
description: 'Environment'
default: prod
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ We deploy the `Argo Application` app which then pulls in the rest of the setup
kubectl apply -k web/argo
kubectl apply -k grep/argo
kubectl apply -k api-v0-shim/argo
kubectl apply -k sco-redirect/argo
```

You may need to login to https://argocd.do.metacpan.org/ to then perform the
Expand Down
6 changes: 6 additions & 0 deletions apps/sco-redirect/argo/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:
- ./project.yaml
- ./prod_application.yaml
14 changes: 14 additions & 0 deletions apps/sco-redirect/argo/prod_application.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: apps--sco-redirect
namespace: argocd
spec:
project: sco-redirect
source:
repoURL: https://github.com/metacpan/metacpan-k8s
targetRevision: main
path: apps/sco-redirect/environments/prod
destination:
server: https://kubernetes.default.svc
namespace: apps--sco-redirect
20 changes: 20 additions & 0 deletions apps/sco-redirect/argo/project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
name: sco-redirect
namespace: argocd
spec:
# Project description
description: search.cpan.org redirector

sourceRepos:
- '*'

clusterResourceWhitelist:
- group: ''
kind: 'Namespace'

destinations:
- namespace: apps--sco-redirect
server: https://kubernetes.default.svc
name: in-cluster
25 changes: 25 additions & 0 deletions apps/sco-redirect/base/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: sco-redirect
labels:
app: sco-redirect
spec:
replicas: 1
selector:
matchLabels:
app: sco-redirect
template:
metadata:
labels:
app: sco-redirect
spec:
containers:
- name: sco-redirect
image: metacpan/sco-redirect:latest
imagePullPolicy: Always
command: [ "/uwsgi.sh" ]
args: [ "--http-socket", ":5001", "--workers", "5" ]
ports:
- containerPort: 5001
6 changes: 6 additions & 0 deletions apps/sco-redirect/base/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:
- ./deployment.yaml
- ./service.yaml
10 changes: 10 additions & 0 deletions apps/sco-redirect/base/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: Service
metadata:
name: sco-redirect
spec:
ports:
- port: 80
targetPort: 5001
selector:
app: sco-redirect
64 changes: 64 additions & 0 deletions apps/sco-redirect/environments/prod/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: sco-redirect
namespace: apps--sco-redirect
annotations:
cert-manager.io/cluster-issuer: letsencrypt-production
spec:
ingressClassName: nginx
tls:
- hosts:
- sco.do.metacpan.org
secretName: sco-redirect-tls
rules:
- host: sco.do.metacpan.org
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: sco-redirect
port:
number: 80
- host: sco.metacpan.org
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: sco-redirect
port:
number: 80
- host: search.cpan.org
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: sco-redirect
port:
number: 80
- host: search.mcpan.org
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: sco-redirect
port:
number: 80
- host: cpansearch.perl.org
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: sco-redirect
port:
number: 80
12 changes: 12 additions & 0 deletions apps/sco-redirect/environments/prod/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: apps--sco-redirect
bases:
- ../../base/
resources:
- namespace.yaml
- ingress.yaml
images:
- name: metacpan/sco-redirect
newTag: sha-b837b005f2ca853b4bfe4cd0b69f6446c23adf07
5 changes: 5 additions & 0 deletions apps/sco-redirect/environments/prod/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: apps--sco-redirect