Skip to content

Commit

Permalink
LB's for katana setup services
Browse files Browse the repository at this point in the history
  • Loading branch information
ashpect committed Aug 5, 2023
1 parent b7e92f2 commit 5d645c4
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 44 deletions.
19 changes: 19 additions & 0 deletions kubernetes/manifests/setuplb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
name: katana-lb
namespace: katana
spec:
type: LoadBalancer
ports:
- name: gogs
port: 18080
targetPort: gogs-port
- name: mongo
port: 27017
targetPort: mongo-port
- name: mysql
port: 3306
targetPort: mysql
selector:
lbtype: external
7 changes: 5 additions & 2 deletions kubernetes/templates/gogs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ spec:
selector:
matchLabels:
app: gogs
lbtype: external
template:
metadata:
labels:
lbtype: external
app: gogs
version: v1
spec:
Expand All @@ -54,7 +56,7 @@ spec:
- containerPort: 22
name: ssh
- containerPort: 3000
name: http
name: gogs-port
env:
- name: SOCAT_LINK
value: "false"
Expand Down Expand Up @@ -91,6 +93,7 @@ spec:
protocol: TCP
port: 18080
targetPort: 3000

---
apiVersion: networking.k8s.io/v1
kind: Ingress
Expand All @@ -102,7 +105,7 @@ metadata:
spec:
ingressClassName: nginx
rules:
- host: {{ printf "gogs.%s" .IngressHost }}
- host: {{ printf "gogs." .IngressHost }}
http:
paths:
- path: /
Expand Down
30 changes: 9 additions & 21 deletions kubernetes/templates/mongo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ spec:
replicas: 1
selector:
matchLabels:
lbtype: external
app: mongo-client
template:
metadata:
labels:
lbtype: external
app: mongo-client
spec:
containers:
Expand All @@ -37,11 +39,13 @@ spec:
replicas: 1
selector:
matchLabels:
lbtype: external
app: mongo
strategy: {}
template:
metadata:
labels:
lbtype: external
app: mongo
spec:
containers:
Expand Down Expand Up @@ -84,6 +88,9 @@ spec:
volumeMounts:
- name: "mongo-data-dir"
mountPath: "/data/db"
ports:
- name: mongo-port
containerPort: 27017
volumes:
- name: "mongo-data-dir"
persistentVolumeClaim:
Expand All @@ -99,32 +106,13 @@ metadata:
namespace: katana
spec:
ports:
- port: 27017
- name: mongo-svc
port: 27017
protocol: TCP
targetPort: 27017
selector:
app: mongo

---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: mongo-ingress
namespace: katana
spec:
ingressClassName: nginx
rules:
- host: {{ printf "mongo.%s" .IngressHost }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: mongo-svc
port:
number: 27017

---
apiVersion: v1
kind: PersistentVolume
Expand Down
25 changes: 4 additions & 21 deletions kubernetes/templates/mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ metadata:
spec:
selector:
matchLabels:
lbtype: external
app: mysql
strategy:
type: Recreate
template:
metadata:
labels:
lbtype: external
app: mysql
spec:
containers:
Expand Down Expand Up @@ -76,31 +78,12 @@ metadata:
namespace: katana
spec:
ports:
- port: 3306
- name: mysql-port
port: 3306
targetPort: 3306
selector:
app: mysql

---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: mysql-ingress
namespace: katana
spec:
ingressClassName: nginx
rules:
- host: {{ printf "mysql.%s" .IngressHost }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: mysql-svc
port:
number: 3306

---
apiVersion: v1
kind: Secret
Expand Down

0 comments on commit 5d645c4

Please sign in to comment.