Skip to content

Commit

Permalink
Merge pull request #73 from kube-tarian/helm-bridge
Browse files Browse the repository at this point in the history
feat: Support for git & container bridge
  • Loading branch information
jebinjeb authored Jul 8, 2023
2 parents 69333bc + f244b9e commit f9b888c
Show file tree
Hide file tree
Showing 9 changed files with 222 additions and 3 deletions.
Binary file modified .readme_assets/kubviz.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,30 @@ helm upgrade -i kubviz-client kubviz/client -n kubviz --set "nats.auth.token=$to
```

#### Agent Installation

##### Deploying Agent on the Same Kubernetes Cluster as kubeviz Client:
1. Make sure you have the kubeviz client running on your Kubernetes cluster.
2. Run the following command to deploy the kubeviz agent:

```bash
helm upgrade -i kubviz-agent kubviz/agent -n kubviz \
--set nats.host=<NATS IP ADDRESS> \
--set "nats.auth.token=$token" \
--set git_bridge.enabled=true \
--set "git_bridge.ingress.hosts[0].host=<INGRESS HOSTNAME>",git_bridge.ingress.hosts[0].paths[0].path=/ \
--set container_bridge.enabled=true \
--set "container_bridge.ingress.hosts[0].host=<INGRESS HOSTNAME>",container_bridge.ingress.hosts[0].paths[0].path=/
```
3. Replace "NATS IP ADDRESS" with the IP address of your NATS server.
4. Replace "INGRESS HOSTNAME" with the desired hostname for the Git Bridge and Container Bridge Ingress configurations.

##### Deploying Agent on a Different Kubernetes Cluster:
1. Run the following command to deploy the kubeviz agent:
```bash
helm upgrade -i kubviz-agent kubviz/agent -n kubviz --set nats.host=<NATS IP Address> --set "nats.auth.token=$token"
helm upgrade -i kubviz-agent kubviz/agent -n kubviz --set nats.host=<NATS IP Address> --set "nats.auth.token=$token"
```
2. Replace "NATS IP Address" with the IP address of your NATS server.

## Use Cases

### Cluster Event Tracking
Expand Down
2 changes: 1 addition & 1 deletion charts/agent/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.6
version: 0.1.7

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
24 changes: 23 additions & 1 deletion charts/agent/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 80
containerPort: 8080
protocol: TCP
# livenessProbe:
# httpGet:
Expand All @@ -54,6 +54,28 @@ spec:
value: {{ .Values.nats.host }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- if .Values.git_bridge.enabled }}
- name: git-bridge
image: "{{ .Values.git_bridge.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.container_bridge.image.pullPolicy }}
ports:
- name: http-git
containerPort: 8081
protocol: TCP
resources:
{{- toYaml .Values.git_bridge.resources | nindent 12 }}
{{- end }}
{{- if .Values.container_bridge.enabled }}
- name: container-bridge
image: "{{ .Values.container_bridge.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.container_bridge.image.pullPolicy }}
ports:
- name: http-container
containerPort: 8082
protocol: TCP
resources:
{{- toYaml .Values.container_bridge.resources | nindent 12 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
43 changes: 43 additions & 0 deletions charts/agent/templates/ingress_bridge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{{- if .Values.container_bridge.enabled }}
{{- if .Values.container_bridge.ingress.enabled -}}
{{- $fullName := include "agent.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}-container
labels:
{{- include "agent.labels" . | nindent 4 }}
{{- with .Values.container_bridge.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.container_bridge.ingress.tls }}
tls:
{{- range .Values.container_bridge.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.container_bridge.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
backend:
serviceName: {{ $fullName }}-container
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
43 changes: 43 additions & 0 deletions charts/agent/templates/ingress_git.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{{- if .Values.git_bridge.enabled }}
{{- if .Values.container_bridge.ingress.enabled -}}
{{- $fullName := include "agent.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "agent.labels" . | nindent 4 }}
{{- with .Values.git_bridge.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.git_bridge.ingress.tls }}
tls:
{{- range .Values.git_bridge.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.git_bridge.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
backend:
serviceName: {{ $fullName }}-git
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
17 changes: 17 additions & 0 deletions charts/agent/templates/service_container_bridge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if .Values.container_bridge.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "agent.fullname" . }}-container
labels:
{{- include "agent.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http-container
protocol: TCP
name: http
selector:
{{- include "agent.selectorLabels" . | nindent 4 }}
{{- end }}
17 changes: 17 additions & 0 deletions charts/agent/templates/service_git_bridge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if .Values.git_bridge.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "agent.fullname" . }}-git
labels:
{{- include "agent.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http-git
protocol: TCP
name: http
selector:
{{- include "agent.selectorLabels" . | nindent 4 }}
{{- end }}
56 changes: 56 additions & 0 deletions charts/agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,62 @@ service:
type: ClusterIP
port: 80

git_bridge:
enabled: false
image:
repository: ghcr.io/kube-tarian/kubviz
pullPolicy: Always
tag: "latest"
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
ingress:
enabled: true
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: gitbridge.local
paths:
- path: /
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local



container_bridge:
enabled: false
image:
repository: ghcr.io/kube-tarian/kubviz
pullPolicy: Always
tag: "latest"
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
ingress:
enabled: true
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: containerbridge.local
paths:
- path: /
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local

ingress:
enabled: false
annotations: {}
Expand Down

0 comments on commit f9b888c

Please sign in to comment.