Skip to content

Commit

Permalink
Add Kubernetes Ingress and update AppList component (#414)
Browse files Browse the repository at this point in the history
* Add Kubernetes Ingress and update AppList component

* k8s + local changes

* revert applist.js

* update port to 8080 from 80

* fix tag

* testing workflow

* Update readme

* test workflow - github comment

* revert test

---------

Co-authored-by: SheryarButt <m.sheryarbutt@gmail.com>
  • Loading branch information
Bharath Nallapeta and SheryarButt authored Jun 24, 2024
1 parent d13d623 commit 458f75d
Show file tree
Hide file tree
Showing 6 changed files with 328 additions and 44 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{github.event.pull_request.head.sha}}

# Setting up helm binary
- name: Set up Helm
uses: azure/setup-helm@v3
Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
- name: Comment on PR
uses: mshick/add-pr-comment@v2
env:
Expand All @@ -148,7 +148,7 @@ jobs:
if: failure()
uses: mshick/add-pr-comment@v2
env:
GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
message: '@${{ github.actor }} Yikes! You better fix it before anyone else finds out! [Build](https://github.com/${{ github.repository }}/commit/${{ github.event.pull_request.head.sha }}/checks) has Failed!'
allow-repeats: true
Expand Down
31 changes: 26 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,41 @@ Forecastle boasts a range of functionalities designed to streamline the manageme

## Admin Guide

This section is intended for Administrators aiming to deploy Forecastle in Kubernetes environments. Forecastle offers flexible deployment options, accommodating both Kubernetes and OpenShift platforms with ease.
This section is intended for Administrators aiming to deploy Forecastle on their clusters. Forecastle offers flexible deployment options, accommodating both Kubernetes and OpenShift platforms with ease.

You have the choice of deploying Forecastle using traditional Kubernetes manifests or through Helm charts. Detailed instructions for both methods are provided below to guide you through the deployment process.
You have the choice of deploying Forecastle using traditional manifests or through Helm charts. Detailed instructions for both methods are provided below to guide you through the deployment process.

### Vanilla Manifests

#### Step 1: Apply manifests

You can get Forecastle by running the following command on your cluster:

for Kubernetes:
```bash
kubectl apply -f https://raw.githubusercontent.com/stakater/Forecastle/master/deployments/kubernetes/forecastle.yaml
```

for OpenShift:
```bash
kubectl apply -f https://raw.githubusercontent.com/stakater/Forecastle/master/deployments/openshift/forecastle.yaml
```

##### Accessing the Dashboard

For Kubernetes environments, you can use the following port-foward command to access the Forecastle dashboard:
```bash
kubectl port-forward svc/forecastle 8080:8080
```

Please note that you would need to configure ingress to to access Forecastle from outside the cluster based on your cluster's ingress configuration.

For OpenShift environments, a default route is created for the Forecastle service. You can access the dashboard using the route URL.

```bash
oc get route forecastle
```

#### Step 2: Update configmap

Modify the `namespaceSelector` key in the Forecastle ConfigMap to list the namespaces you want Forecastle to monitor. For detailed instructions, see [namespace selector configuration](#namespaceselector) for instructions.
Expand All @@ -93,7 +114,7 @@ Modify the `namespaceSelector` key in the Forecastle ConfigMap to list the names
If you have Helm configured on your Kubernetes cluster, deploy Forecastle using the Helm chart. The chart is located [here.](./deployments/kubernetes/chart/forecastle)

Adjust the configuration in values.yaml if required and run the following command:

```bash
helm install forecastle ./deployments/kubernetes/chart/forecastle
```
Expand Down Expand Up @@ -231,9 +252,9 @@ spec:
group: dev
icon: https://icon-url
url: http://app-url
networkRestricted: "false"
networkRestricted: false
properties:
Version: 1.0
Version: "1.0"
instance: "" # Optional
```

Expand Down
37 changes: 2 additions & 35 deletions deployments/kubernetes/forecastle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,12 @@ metadata:
release: "forecastle"
heritage: "Helm"
name: forecastle
namespace: default
---
# Source: forecastle/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: forecastle
namespace: default
labels:
app: forecastle
group: com.stakater.platform
Expand Down Expand Up @@ -144,9 +142,6 @@ rules:
- apiGroups: ["networking.k8s.io"]
resources: ["ingresses"]
verbs: ["get", "list"]
- apiGroups: ["route.openshift.io"]
resources: ["routes"]
verbs: ["get", "list"]
- apiGroups: ["traefik.containo.us"]
resources: ["ingressroutes"]
verbs: ["get", "list"]
Expand Down Expand Up @@ -177,7 +172,7 @@ roleRef:
subjects:
- kind: ServiceAccount
name: forecastle
namespace: default
namespace: forecastle
---
# Source: forecastle/templates/service.yaml
apiVersion: v1
Expand All @@ -193,11 +188,10 @@ metadata:
heritage: "Helm"
expose: "true"
name: forecastle
namespace: default
spec:
ports:
- name: http
port: 80
port: 8080
protocol: TCP
targetPort: 3000
selector:
Expand All @@ -218,7 +212,6 @@ metadata:
release: "forecastle"
heritage: "Helm"
name: forecastle
namespace: default
spec:
replicas: 1
revisionHistoryLimit: 2
Expand Down Expand Up @@ -254,29 +247,3 @@ spec:
configMap:
name: forecastle
serviceAccountName: forecastle
---
# Source: forecastle/templates/route.yaml
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: forecastle
namespace: default
labels:
app: forecastle
group: com.stakater.platform
provider: stakater
version: "v1.0.141"
chart: "forecastle-v1.0.141"
release: "forecastle"
heritage: "Helm"
spec:
port:
targetPort: http
to:
kind: Service
name: forecastle
weight: 100
wildcardPolicy: None
tls:
termination: reencrypt
insecureEdgeTerminationPolicy: Redirect
2 changes: 1 addition & 1 deletion deployments/kubernetes/manifests/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ metadata:
spec:
ports:
- name: http
port: 80
port: 8080
protocol: TCP
targetPort: 3000
selector:
Expand Down
Loading

0 comments on commit 458f75d

Please sign in to comment.