Skip to content

Commit 103fefb

Browse files
authored
Added the Loadbalancer service for Grafana (#291)
* Adding Loadbalancer service to grafana
1 parent c634396 commit 103fefb

File tree

11 files changed

+25
-3
lines changed

11 files changed

+25
-3
lines changed

substrate/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ kubectl port-forward svc/prometheus-operated -n monitoring 9090:9090&
7272
kubectl port-forward svc/kube-prometheus-stack-grafana -n monitoring 8080:80&
7373
```
7474

75-
Adding additional Grafana dashboards from [monitoring](monitoring/)
75+
Adding additional Grafana dashboards from [monitoring](monitoring/GrafanaDashboard/)
7676

7777
```bash
7878
kubectl create configmap master-dashboard -n monitoring --from-file=master-dashboard.json
@@ -81,6 +81,10 @@ kubectl label configmap master-dashboard -n monitoring grafana_dashboard=1
8181

8282
> Note: Coming soon, auto-load these dashboards when a KIT environment is created
8383
84+
To access Grafana Dashboard externally using an NLB
85+
```bash
86+
kubectl apply -f monitoring/grafanalbservice.yaml
87+
```
8488
### Allowing API server to trust kubelet endpoints for the guest cluster
8589

8690
```bash
File renamed without changes.
File renamed without changes.

substrate/monitoring/api-server-troubleshooter.json renamed to substrate/monitoring/GrafanaDashboard/api-server-troubleshooter.json

File renamed without changes.
File renamed without changes.

substrate/monitoring/kubelet-troubleshooter-v1.0.2.json renamed to substrate/monitoring/GrafanaDashboard/kubelet-troubleshooter-v1.0.2.json

File renamed without changes.
File renamed without changes.

substrate/monitoring/node-troubleshooter-v1.1.2.json renamed to substrate/monitoring/GrafanaDashboard/node-troubleshooter-v1.1.2.json

File renamed without changes.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: grafana
5+
namespace: monitoring
6+
annotations:
7+
service.beta.kubernetes.io/aws-load-balancer-scheme: internet-facing
8+
service.beta.kubernetes.io/aws-load-balancer-target-group-attributes: stickiness.enabled=true,stickiness.type=source_ip
9+
service.beta.kubernetes.io/aws-load-balancer-type: nlb-ip
10+
spec:
11+
ports:
12+
- port: 80
13+
protocol: TCP
14+
targetPort: grafana
15+
selector:
16+
app.kubernetes.io/name: grafana
17+
sessionAffinity: None
18+
type: LoadBalancer

substrate/pkg/controller/substrate/cluster/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ type Config struct {
7474
}
7575

7676
func (c *Config) Create(ctx context.Context, substrate *v1alpha1.Substrate) (reconcile.Result, error) {
77-
if substrate.Status.Cluster.APIServerAddress == nil {
77+
if substrate.Status.Cluster.APIServerAddress == nil || substrate.Status.Infrastructure.MasterInstanceID == nil {
7878
return reconcile.Result{Requeue: true}, nil
7979
}
8080
if c.clusterConfigPath == "" {

0 commit comments

Comments
 (0)