Skip to content

Commit 2c8c9a4

Browse files
committed
add sco-redirect app
Resolves #17
1 parent 8346535 commit 2c8c9a4

File tree

11 files changed

+164
-0
lines changed

11 files changed

+164
-0
lines changed

.github/workflows/set-image.yml

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
- grep
1212
- web
1313
- api-v0-shim
14+
- sco-redirect
1415
environment:
1516
description: 'Environment'
1617
default: prod

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ We deploy the `Argo Application` app which then pulls in the rest of the setup
4040
kubectl apply -k web/argo
4141
kubectl apply -k grep/argo
4242
kubectl apply -k api-v0-shim/argo
43+
kubectl apply -k sco-redirect/argo
4344
```
4445

4546
You may need to login to https://argocd.do.metacpan.org/ to then perform the
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
apiVersion: kustomize.config.k8s.io/v1beta1
3+
kind: Kustomization
4+
resources:
5+
- ./project.yaml
6+
- ./prod_application.yaml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: Application
3+
metadata:
4+
name: apps--sco-redirect
5+
namespace: argocd
6+
spec:
7+
project: sco-redirect
8+
source:
9+
repoURL: https://github.com/metacpan/metacpan-k8s
10+
targetRevision: main
11+
path: apps/sco-redirect/environments/prod
12+
destination:
13+
server: https://kubernetes.default.svc
14+
namespace: apps--sco-redirect

apps/sco-redirect/argo/project.yaml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: AppProject
3+
metadata:
4+
name: sco-redirect
5+
namespace: argocd
6+
spec:
7+
# Project description
8+
description: search.cpan.org redirector
9+
10+
sourceRepos:
11+
- '*'
12+
13+
clusterResourceWhitelist:
14+
- group: ''
15+
kind: 'Namespace'
16+
17+
destinations:
18+
- namespace: apps--sco-redirect
19+
server: https://kubernetes.default.svc
20+
name: in-cluster
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: sco-redirect
6+
labels:
7+
app: sco-redirect
8+
spec:
9+
replicas: 1
10+
selector:
11+
matchLabels:
12+
app: sco-redirect
13+
template:
14+
metadata:
15+
labels:
16+
app: sco-redirect
17+
spec:
18+
containers:
19+
- name: sco-redirect
20+
image: metacpan/sco-redirect:latest
21+
imagePullPolicy: Always
22+
command: [ "/uwsgi.sh" ]
23+
args: [ "--http-socket", ":5001", "--workers", "5" ]
24+
ports:
25+
- containerPort: 5001
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
apiVersion: kustomize.config.k8s.io/v1beta1
3+
kind: Kustomization
4+
resources:
5+
- ./deployment.yaml
6+
- ./service.yaml

apps/sco-redirect/base/service.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: sco-redirect
5+
spec:
6+
ports:
7+
- port: 80
8+
targetPort: 5001
9+
selector:
10+
app: sco-redirect
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
apiVersion: networking.k8s.io/v1
2+
kind: Ingress
3+
metadata:
4+
name: sco-redirect
5+
namespace: apps--sco-redirect
6+
annotations:
7+
cert-manager.io/cluster-issuer: letsencrypt-production
8+
spec:
9+
ingressClassName: nginx
10+
tls:
11+
- hosts:
12+
- sco.do.metacpan.org
13+
secretName: sco-redirect-tls
14+
rules:
15+
- host: sco.do.metacpan.org
16+
http:
17+
paths:
18+
- pathType: Prefix
19+
path: "/"
20+
backend:
21+
service:
22+
name: sco-redirect
23+
port:
24+
number: 80
25+
- host: sco.metacpan.org
26+
http:
27+
paths:
28+
- pathType: Prefix
29+
path: "/"
30+
backend:
31+
service:
32+
name: sco-redirect
33+
port:
34+
number: 80
35+
- host: search.cpan.org
36+
http:
37+
paths:
38+
- pathType: Prefix
39+
path: "/"
40+
backend:
41+
service:
42+
name: sco-redirect
43+
port:
44+
number: 80
45+
- host: search.mcpan.org
46+
http:
47+
paths:
48+
- pathType: Prefix
49+
path: "/"
50+
backend:
51+
service:
52+
name: sco-redirect
53+
port:
54+
number: 80
55+
- host: cpansearch.perl.org
56+
http:
57+
paths:
58+
- pathType: Prefix
59+
path: "/"
60+
backend:
61+
service:
62+
name: sco-redirect
63+
port:
64+
number: 80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
apiVersion: kustomize.config.k8s.io/v1beta1
3+
kind: Kustomization
4+
namespace: apps--sco-redirect
5+
bases:
6+
- ../../base/
7+
resources:
8+
- namespace.yaml
9+
- ingress.yaml
10+
images:
11+
- name: metacpan/sco-redirect
12+
newTag: sha-b837b005f2ca853b4bfe4cd0b69f6446c23adf07
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
apiVersion: v1
3+
kind: Namespace
4+
metadata:
5+
name: apps--sco-redirect

0 commit comments

Comments
 (0)