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

feat: Add documentation about busola in k8s and adjust k8s configs #3547

Merged
merged 45 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
8d7152d
ingress works
dbadura Nov 22, 2024
4fc041e
wip
dbadura Dec 18, 2024
c34619e
first version od tests adjustement
dbadura Nov 25, 2024
13f3721
revert changes related to ci
dbadura Dec 18, 2024
c8ae781
wip
dbadura Dec 20, 2024
6e305b4
adjust k8s resources to use single image
dbadura Dec 30, 2024
b79c481
revert changes related to backend env
dbadura Dec 30, 2024
3f42b81
cleanup
dbadura Dec 30, 2024
7875c80
first istio steps
dbadura Dec 30, 2024
a995107
finish readme and use api rule
dbadura Dec 31, 2024
b5e436e
improve docs
dbadura Dec 31, 2024
bfb8321
remove not needed env
dbadura Dec 31, 2024
fcfde0b
Merge branch 'main' into busola-k8s
dbadura Dec 31, 2024
575accc
improve readme
dbadura Jan 2, 2025
c342b15
revert deletion of validation schemas
dbadura Jan 3, 2025
b1c5fc6
remove accident addition
dbadura Jan 3, 2025
b78c98d
improve cm location
dbadura Jan 3, 2025
18dc70e
remove backend address calculation
dbadura Jan 7, 2025
25ea0c8
Apply suggestions from code review
dbadura Jan 7, 2025
2c5c145
fix hpa and mention yq
dbadura Jan 7, 2025
a3da831
update info about k3d
dbadura Jan 7, 2025
8c6a293
Merge branch 'main' into busola-k8s
dbadura Jan 7, 2025
b0b31f3
fix local dev
dbadura Jan 8, 2025
0ce0f6c
Apply suggestions from code review
dbadura Jan 8, 2025
b4819a3
Change on to in
grego952 Jan 8, 2025
2606242
Remove reference to port 3001 on localhost in custom extension
pbochynski Jan 8, 2025
f2b87c8
better naming
dbadura Jan 8, 2025
063ef28
Update README.md
grego952 Jan 8, 2025
a26faa2
adjust running of integration tests
dbadura Jan 8, 2025
d52a6c9
fix hanging the tests
dbadura Jan 8, 2025
e646f99
redirect log
dbadura Jan 8, 2025
5f2e4bc
fix tests
dbadura Jan 8, 2025
95ecbe4
fix lighthouse
dbadura Jan 8, 2025
6036f88
Merge branch 'main' into busola-k8s
mrCherry97 Jan 9, 2025
2895c05
build busola prod
dbadura Jan 13, 2025
6b71bd6
fix job
dbadura Jan 13, 2025
1c2c190
adjust other tests
dbadura Jan 13, 2025
d22af69
tmp fix for lighthouse
dbadura Jan 13, 2025
22c968a
add sudo
dbadura Jan 13, 2025
baca096
upgrade playwritht
dbadura Jan 13, 2025
b06c739
fix lighthouse
dbadura Jan 13, 2025
55fcd90
improve tests
dbadura Jan 13, 2025
51d846e
revert changes
dbadura Jan 13, 2025
25205d1
fix
dbadura Jan 13, 2025
4183c33
Merge branch 'main' into busola-k8s
dbadura Jan 14, 2025
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
48 changes: 15 additions & 33 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
IMG_NAME = busola-web
LOCAL_IMG_NAME = busola
IMG = $(DOCKER_PUSH_REPOSITORY)$(DOCKER_PUSH_DIRECTORY)/$(IMG_NAME)
LOCAL_IMG = $(DOCKER_PUSH_REPOSITORY)$(DOCKER_PUSH_DIRECTORY)/$(LOCAL_IMG_NAME)
KYMA_DASHBOARD_IMG = $(DOCKER_PUSH_REPOSITORY)$(DOCKER_PUSH_DIRECTORY)/$(KYMA_DASHBOARD_IMG_NAME)
TAG = $(DOCKER_TAG)
APP_NAME = busola
.DEFAULT_GOAL=help

help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)


.PHONY: resolve
resolve:
Expand All @@ -21,30 +21,12 @@ release: build-image push-image

release-local: build-image-local push-image-local

build-image:
docker build -t $(IMG_NAME) -f Dockerfile .

build-image-local:
docker build -t $(LOCAL_IMG_NAME) -f Dockerfile.local .

push-image:
docker tag $(IMG_NAME) $(IMG):$(TAG)
docker push $(IMG):$(TAG)
ifeq ($(JOB_TYPE), postsubmit)
@echo "Sign image with Cosign"
cosign version
cosign sign -key ${KMS_KEY_URL} $(REPO)$(IMG):$(TAG)
else
@echo "Image signing skipped"
endif

push-image-local:
docker tag $(LOCAL_IMG_NAME) $(LOCAL_IMG):$(TAG)
docker push $(LOCAL_IMG):$(TAG)
ifeq ($(JOB_TYPE), postsubmit)
@echo "Tag image with latest"
docker tag $(LOCAL_IMG_NAME) $(LOCAL_IMG):latest
docker push $(LOCAL_IMG):latest
else
@echo "Image tagging with latest skipped"
endif
build-image: ## Build busola backend image
docker build -t $(APP_NAME) -f Dockerfile .

install-busola: build-image ## Build busola web image and install it on local k3d cluster
$(eval HASH_TAG=$(shell docker images $(APP_NAME):latest --quiet))
docker tag $(APP_NAME) $(APP_NAME):$(HASH_TAG)

k3d image import $(APP_NAME):$(HASH_TAG) -c kyma
kubectl set image deployment busola busola=$(APP_NAME):$(HASH_TAG)
72 changes: 72 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,78 @@ For the information on how to run tests and configure them, go to the [`tests`](
docker run --rm -it -p 3001:3001 -v <path to your custom config>:/app/core-ui/environments/ --env ENVIRONMENT={your-env} --pid=host --name busola europe-docker.pkg.dev/kyma-project/prod/busola:latest
```

## Deploy Busola in Kubernetes Cluster
dbadura marked this conversation as resolved.
Show resolved Hide resolved

To install Busola on Kubernetes cluster run:
dbadura marked this conversation as resolved.
Show resolved Hide resolved

```shell
(cd resources && kustomize build base/ | kubectl apply -f- )
```

To install Busola using specific environment configuration, set `ENVIRONMENT` shell environment variable and run:
dbadura marked this conversation as resolved.
Show resolved Hide resolved

```shell
(cd resources && kustomize build environments/${ENVIRONMENT} | kubectl apply -f- )
```

## Access Busola installed on Kubernetes
dbadura marked this conversation as resolved.
Show resolved Hide resolved

### Kubectl
dbadura marked this conversation as resolved.
Show resolved Hide resolved

The simplest method which always works is to use capabilities of `kubectl`.
dbadura marked this conversation as resolved.
Show resolved Hide resolved

```shell
kubectl port-forward services/busola 3001:3001
```

### Busola installed on K3d
dbadura marked this conversation as resolved.
Show resolved Hide resolved

Prerequisites:

- K3d with installed Traefik, by default it's installed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- K3d with installed Traefik, by default it's installed.
- k3d with [Traefik](https://k3d.io/v5.6.0/usage/k3s/#traefik) (installed by default).


Install ingress resources by running:
dbadura marked this conversation as resolved.
Show resolved Hide resolved

```shell
(cd resources && kubectl apply -f ingress/ingress.yaml)
```

Go to `localhost`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What port? Provide a command to create k3d cluster with load balancer port mapping, e.g.

k3d cluster create -p "80:80@loadbalancer"

Otherwise, the port is not exposed in the host machine (at least on mac os)

dbadura marked this conversation as resolved.
Show resolved Hide resolved

#### Connect to the k3d cluster where Busola is installed.
dbadura marked this conversation as resolved.
Show resolved Hide resolved

To be able to connect to the same K3d cluster where Busola is installed.
dbadura marked this conversation as resolved.
Show resolved Hide resolved
Download kubeconfig and change cluster server address to `https://kubernetes.default.svc:443`.
dbadura marked this conversation as resolved.
Show resolved Hide resolved

Using shell:
Set `K3D_CLUSTER_NAME` shell environment variable to name of your cluster.

```shell
k3d kubeconfig get ${K3D_CLUSTER_NAME} > k3d-kubeconfig.yaml
yq --inplace '.clusters[].cluster.server = "https://kubernetes.default.svc:443"' k3d-kubeconfig.yaml
pbochynski marked this conversation as resolved.
Show resolved Hide resolved
```

### Kubernetes cluster with Istio installed
dbadura marked this conversation as resolved.
Show resolved Hide resolved

Prerequisites:

- Sidecar Proxy injection enabled, see [Kyma docs](https://kyma-project.io/#/istio/user/tutorials/01-40-enable-sidecar-injection?id=enable-istio-sidecar-proxy-injection), how to enable it.
dbadura marked this conversation as resolved.
Show resolved Hide resolved
- Api gateway module installed, see [install docs](https://kyma-project.io/#/02-get-started/01-quick-install)
dbadura marked this conversation as resolved.
Show resolved Hide resolved

Install Istio needed resources by running:
dbadura marked this conversation as resolved.
Show resolved Hide resolved

```shell
(cd resources && kubectl apply -k istio)
```

To get Busola address run:
dbadura marked this conversation as resolved.
Show resolved Hide resolved

```shell
kubectl get virtualservices.networking.istio.io
```

and find `busola-***` virtual service. Under `HOSTS` there is address to access Busola page.
dbadura marked this conversation as resolved.
Show resolved Hide resolved

## Troubleshooting

> **TIP:** To solve most of the problems with Busola development, clear the browser cache or do a hard refresh of the website.
Expand Down
18 changes: 6 additions & 12 deletions backend/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
APP_NAME = busola-backend
IMG_NAME := $(DOCKER_PUSH_REPOSITORY)$(DOCKER_PUSH_DIRECTORY)/$(APP_NAME)
TAG := $(DOCKER_TAG)


build-image:
docker build -t $(APP_NAME) -f Dockerfile .
push-image:
docker tag $(APP_NAME):latest $(IMG_NAME):$(TAG)
docker push $(IMG_NAME):$(TAG)

release: build-image push-image
##@ General
.DEFAULT_GOAL=help
.PHONY: help
.PHONY: help
help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
18 changes: 0 additions & 18 deletions resources/apply-resources-istio.sh

This file was deleted.

22 changes: 0 additions & 22 deletions resources/apply-resources.sh

This file was deleted.

53 changes: 0 additions & 53 deletions resources/base/backend/deployment.yaml

This file was deleted.

26 changes: 0 additions & 26 deletions resources/base/backend/hpa.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions resources/base/backend/service.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: web
name: busola
labels:
app: busola
spec:
Expand All @@ -16,27 +16,28 @@ spec:
spec:
containers:
- name: busola
image: busola-web
imagePullPolicy: Always
image: busola
imagePullPolicy: IfNotPresent
env:
- name: ENVIRONMENT
valueFrom:
configMapKeyRef:
optional: true
key: ENVIRONMENT
name: environment
volumeMounts:
- name: config
mountPath: /app/core-ui/config
resources:
requests:
cpu: 100m
memory: 21Mi
ports:
- containerPort: 8080
volumeMounts:
- name: config
mountPath: /app/core-ui/config
- containerPort: 3001
volumes:
- name: config
configMap:
optional: true
name: busola-config
items:
- key: config
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: web
name: busola
labels:
app: busola
spec:
pbochynski marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: web
name: busola
labels:
app: busola
spec:
ports:
- port: 8080
name: http-web
targetPort: 8080
- port: 3001
name: http-busola
targetPort: 3001
selector:
app: busola

This file was deleted.

14 changes: 0 additions & 14 deletions resources/base/extensions-patch/kustomization.yaml

This file was deleted.

Loading
Loading