Skip to content

Commit

Permalink
feat: add kong configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
sujeet-agrahari committed Feb 18, 2024
1 parent 7602a39 commit 93a28f1
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 365 deletions.
24 changes: 22 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,17 +192,37 @@ REDISCLI_AUTH="$REDIS_PASSWORD" redis-cli -h 127.0.0.1 -p 6379

### Setup Kubernetes Dashboard

#### Using Helm

```sh
helm repo add kubernetes-dashboard https://kubernetes.github.io/dashboard/
helm upgrade --install kubernetes-dashboard kubernetes-dashboard/kubernetes-dashboard --create-namespace --namespace kubernetes-dashboard

```

Get the Kubernetes Dashboard URL by running:

```sh
export POD_NAME=$(kubectl get pods -n kubernetes-dashboard -l "app.kubernetes.io/name=kubernetes-dashboard,app.kubernetes.io/instance=kubernetes-dashboard" -o jsonpath="{.items[0].metadata.name}")
echo https://127.0.0.1:8443/
kubectl -n kubernetes-dashboard port-forward $POD_NAME 8443:8443
```

#### Without Using Helm

- Create a service account

```sh
kubectl apply -f ./kubernetes/service-accounts/k8s-dashboard.service-account.yaml
kubectl apply -f kubernetes/k8s-dashboard/k8s-dashboard.service-account.yaml
```

- Create cluster-level role binding
```sh
kubectl apply -f ./kubernetes/service-accounts/k8s-cluster-level.role-binding.yaml
```
We can also create a role-binding for a namespace
```sh
kubectl apply -f ./kubernetes/service-accounts/k8s-dashboard.role-binding.yaml
kubectl apply -f kubernetes/k8s-dashboard/k8s-dashboard.role-binding.yaml
```
- Generate access token for a service account

Expand Down
46 changes: 0 additions & 46 deletions kubernetes/deployment.yaml

This file was deleted.

3 changes: 3 additions & 0 deletions kubernetes/kong/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
helm install kong kong/kong --set admin.useTLS=false,admin.enabled=true,admin.http.enabled=true

# remove namesapce
21 changes: 0 additions & 21 deletions kubernetes/kong/quick-link-kong-route.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
apiVersion: networking.k8s.io/v1
kind: IngressClass
metadata:
name: kong
spec:
controller: ingress-controllers.konghq.com/kong
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: quick-links-ingress
annotations:
kubernetes.io/ingress.class: kong
kubernetes.io/ingress.class: 'kong'
konghq.com/strip-path: 'true'
spec:
rules:
- http:
- host: localhost
http:
paths:
- path: /quick-links
pathType: Prefix
backend:
service:
name: quick-links-service
port:
name: quick-links
number: 3000
Loading

0 comments on commit 93a28f1

Please sign in to comment.