Skip to content

Commit 6ad0a73

Browse files
authored
Merge pull request #73 from wags007/master
Adding K8s Configuration files
2 parents 01d7333 + a174072 commit 6ad0a73

File tree

7 files changed

+201
-0
lines changed

7 files changed

+201
-0
lines changed

kubernetes/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Webhook K8s Configuration Sample
2+
The files in this directory should work with Minikube, A local Rancher Configurations, or Docker configuration on a local machine.
3+
4+
To deploy this to a cluster or into a cloud K8s service you will need to change the ingress.yml and namespaces to match your configuration.
5+
6+
## Warning about the Namespace.yml
7+
The namespace.yml will create a namespace for you. This will work fine but it may make the namespace hard to find in tools like Rancher. It is suggested that you create your own namespace and remove this file.
8+
9+
## Using these files
10+
To use these files with kubectl do the following:
11+
```
12+
kubectl apply -f ./
13+
```
14+
If you created your own namespace then you will need to remover the namespace entries in the files and the namespace.yml before you run the same command but specifing the namespace to use for deployment:
15+
```
16+
kubectl apply -n <yournamespace> -f ./
17+
```

kubernetes/ingress.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: extensions/v1beta1
2+
kind: Ingress
3+
metadata:
4+
name: webhook
5+
namespace: webhook
6+
annotations:
7+
nginx.ingress.kubernetes.io/rewrite-target: /
8+
spec:
9+
rules:
10+
- host: webhook.localhost
11+
http:
12+
paths:
13+
- path: /
14+
backend:
15+
serviceName: webhook
16+
servicePort: 8084
17+
tls:
18+
- hosts:
19+
- webhook.localhost
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
2+
apiVersion: extensions/v1beta1
3+
kind: Deployment
4+
metadata:
5+
name: laravel-echo-server
6+
namespace: webhook
7+
labels:
8+
app: laravel-echo-server
9+
spec:
10+
replicas: 1
11+
revisionHistoryLimit: 10
12+
strategy: {}
13+
template:
14+
metadata:
15+
labels:
16+
app: laravel-echo-server
17+
spec:
18+
containers:
19+
- image: mintopia/laravel-echo-server
20+
name: laravel-echo-server
21+
ports:
22+
- protocol: TCP
23+
containerPort: 6001
24+
resources: {}
25+
env:
26+
- name: ECHO_ALLOW_CORS
27+
value: "true"
28+
- name: ECHO_ALLOW_HEADERS
29+
value: '*'
30+
- name: ECHO_ALLOW_METHODS
31+
value: '*'
32+
- name: ECHO_ALLOW_ORIGIN
33+
value: '*'
34+
- name: ECHO_PROTOCOL
35+
value: http
36+
- name: ECHO_REDIS_HOST
37+
value: redis
38+
- name: ECHO_REDIS_PORT
39+
value: "6379"
40+
- name: LARAVEL_ECHO_SERVER_AUTH_HOST
41+
value: https://webhook
42+
- name: LARAVEL_ECHO_SERVER_HOST
43+
value: 0.0.0.0
44+
- name: LARAVEL_ECHO_SERVER_PORT
45+
value: "6001"
46+
restartPolicy: Always
47+
status: {}

kubernetes/namespace.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: webhook

kubernetes/redis.deployment.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: extensions/v1beta1
2+
kind: Deployment
3+
metadata:
4+
labels:
5+
app: redis
6+
name: redis
7+
namespace: webhook
8+
spec:
9+
replicas: 1
10+
strategy: {}
11+
template:
12+
metadata:
13+
labels:
14+
app: redis
15+
spec:
16+
containers:
17+
- image: redis:alpine
18+
name: redis
19+
resources: {}
20+
ports:
21+
- protocol: TCP
22+
containerPort: 6379
23+
restartPolicy: Always
24+
status: {}

kubernetes/service.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: webhook
5+
namespace: webhook
6+
spec:
7+
ports:
8+
- name: "8084"
9+
port: 8084
10+
targetPort: 80
11+
selector:
12+
app: webhook
13+
status:
14+
loadBalancer: {}
15+
---
16+
apiVersion: v1
17+
kind: Service
18+
metadata:
19+
name: redis
20+
namespace: webhook
21+
spec:
22+
selector:
23+
app: redis
24+
ports:
25+
- port: 6379
26+
targetPort: 6379
27+
---
28+
apiVersion: v1
29+
kind: Service
30+
metadata:
31+
name: laravel-echo-server
32+
namespace: webhook
33+
spec:
34+
selector:
35+
app: laravel-echo-server
36+
ports:
37+
- port: 6001
38+
targetPort: 6001

kubernetes/webhook.deployment.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
apiVersion: extensions/v1beta1
2+
kind: Deployment
3+
metadata:
4+
#annotations:
5+
labels:
6+
app: webhook
7+
name: webhook
8+
namespace: webhook
9+
spec:
10+
replicas: 1
11+
strategy: {}
12+
template:
13+
metadata:
14+
labels:
15+
app: webhook
16+
spec:
17+
containers:
18+
- args:
19+
- php
20+
- artisan
21+
- queue:work
22+
- --daemon
23+
- --tries=3
24+
- --timeout=10
25+
env:
26+
- name: APP_DEBUG
27+
value: "true"
28+
- name: APP_ENV
29+
value: dev
30+
- name: APP_LOG
31+
value: errorlog
32+
- name: APP_URL
33+
value: http://localhost:8084
34+
- name: BROADCAST_DRIVER
35+
value: redis
36+
- name: CACHE_DRIVER
37+
value: redis
38+
- name: DB_CONNECTION
39+
value: sqlite
40+
- name: ECHO_HOST_MODE
41+
value: path
42+
- name: QUEUE_DRIVER
43+
value: redis
44+
- name: REDIS_HOST
45+
value: redis:6379
46+
image: fredsted/webhook.site
47+
name: webhook
48+
ports:
49+
- containerPort: 80
50+
resources: {}
51+
restartPolicy: Always
52+
status: {}

0 commit comments

Comments
 (0)