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

feature/add manifests for k8s installation #143

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
32 changes: 32 additions & 0 deletions k8s/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Kubernetes

## Setup graph-explorer on kubernetes for tests using kustomize

* Resources that will be created:

* Namespace graph-explorer
* Deployment (1 pod replica)
* ClusterIP Service


```bash

kubectl apply -k k8s/manifests/overlays/default

```

## Using port-forward to access the graph-explorer

```bash
kubectl port-forward svc/graph-explorer 8080:443
```

* Open the url to access on browser: [https://localhost:8080/explorer](https://localhost:8080/explorer)

## Removing all resources:

```bash

kubectl delete -k k8s/manifests/overlays/default

```
58 changes: 58 additions & 0 deletions k8s/manifests/base/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
kind: Deployment
apiVersion: apps/v1
metadata:
name: graph-explorer
labels:
app: graph-explorer
spec:
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 20%
maxSurge: 50%
selector:
matchLabels:
app: graph-explorer
template:
metadata:
name: graph-explorer
labels:
app: graph-explorer
spec:
containers:
- name: graph-explorer
env:
- name: HOST
value: localhost
image: yros/graph-explorer:latest
imagePullPolicy: IfNotPresent
readinessProbe:
tcpSocket:
port: 443
initialDelaySeconds: 10
failureThreshold: 5
timeoutSeconds: 5
periodSeconds: 10
livenessProbe:
tcpSocket:
port: 443
initialDelaySeconds: 30
failureThreshold: 5
timeoutSeconds: 10
periodSeconds: 30
ports:
- containerPort: 443
resources:
requests:
cpu: 300m
memory: 512Mi
limits:
cpu: 500m
memory: 512Mi
terminationGracePeriodSeconds: 30
restartPolicy: Always
dnsConfig:
options:
- name: ndots
value: "1"
dnsPolicy: ClusterFirst
8 changes: 8 additions & 0 deletions k8s/manifests/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- deployment.yaml
- service.yaml
- namespace.yaml

4 changes: 4 additions & 0 deletions k8s/manifests/base/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: graph-explorer
14 changes: 14 additions & 0 deletions k8s/manifests/base/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: graph-explorer
spec:
selector:
app: graph-explorer
ports:
- name: https
port: 443
targetPort: 443
protocol: TCP
sessionAffinity: None
type: ClusterIP
10 changes: 10 additions & 0 deletions k8s/manifests/overlays/default/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: graph-explorer

resources:
- ../../base

images:
- name: yros/graph-explorer
newTag: latest