forked from flohansen/hsfl-master-ai-cloud-engineering
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
72 changed files
with
2,116 additions
and
4,060 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.sh text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Run tests (load balancer service) | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'src/load-balancer-service/**' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
name: Test web-service | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.21 | ||
|
||
- name: Test Go Module | ||
run: | | ||
cd src/load-balancer-service | ||
go test ./... | ||
test_exit_code=$? # Capture the exit code of the go test command | ||
if [ $test_exit_code -eq 0 ]; then | ||
echo "Tests passed successfully." | ||
else | ||
echo "Tests failed with exit code $test_exit_code." | ||
exit 1 # Fail the GitHub Actions workflow | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Kubernetes Cluster Setup | ||
|
||
This README guides you through the process of setting up a Kubernetes cluster with vms using Vagrant and Ansible. Ensure that you have all necessary dependencies installed, including Ansible, Vagrant, and any SSH tools needed. | ||
|
||
## Steps to Follow | ||
|
||
1. First, change to the `kubernetes-cluster` directory | ||
2. Move your ssh public key into `kubernetes-cluster/ubuntu/vagrant/id_rsa.pub` | ||
3. Start the vm deployment with `vagrant up` | ||
4. Change, to the `ansible_playbooks` folder | ||
5. Optional: Sometimes you have to specify the ansible config | ||
```shell | ||
export ANSIBLE_CONFIG=./ansible.cfg | ||
``` | ||
6. Run `ansible-playbook setup.yaml` to setup cluster | ||
|
||
> The first time the manifests are automatically deployed after commissioning, the distribution of the pods may not be uniform. | ||
|
||
## Additional Notes | ||
Ensure that Ansible is properly installed and configured on your system. | ||
Verify that the SSH key has the correct permissions and is recognized by your system. | ||
If you encounter any issues, consult the official Kubernetes and Ansible documentation for troubleshooting steps. | ||
Conclusion | ||
Following these steps should successfully set up a Kubernetes cluster using Ansible. For more detailed instructions or advanced configurations, refer to the Kubernetes and Ansible official documentation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: test-data-secrets | ||
namespace: price-whisper | ||
annotations: | ||
author: Gruppe 6 <philipp.borucki@stud.hs-flensburg.de | dorien.groenwald@stud.hs-flensburg.de | jannick.lindner@stud.hs-flensburg.de> | ||
stringData: | ||
RQLITE_USER: "db-username" | ||
RQLITE_PASSWORD: "db-pw-changeMe!" | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: test-data-config | ||
namespace: price-whisper | ||
annotations: | ||
author: Gruppe 6 <philipp.borucki@stud.hs-flensburg.de | dorien.groenwald@stud.hs-flensburg.de | jannick.lindner@stud.hs-flensburg.de> | ||
data: | ||
RQLITE_HOST: "database" | ||
RQLITE_PORT: "4001" | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: test-data-pod | ||
namespace: price-whisper | ||
annotations: | ||
author: Gruppe 6 <philipp.borucki@stud.hs-flensburg.de | dorien.groenwald@stud.hs-flensburg.de | jannick.lindner@stud.hs-flensburg.de> | ||
spec: | ||
restartPolicy: OnFailure | ||
initContainers: | ||
- name: wait-for-database | ||
image: busybox | ||
command: [ "/bin/sh", "-c" ] | ||
args: [ "until wget --spider -S http://database:4001/readyz 2>&1 | grep 'HTTP/1.1 200 OK'; do echo 'Waiting for RQLite...'; sleep 2; done;" ] | ||
containers: | ||
- name: test-data-container | ||
image: onyxmoon/pw-database-rqlite-test-data-init:latest | ||
envFrom: | ||
- secretRef: | ||
name: test-data-secrets | ||
- configMapRef: | ||
name: test-data-config | ||
|
||
--- |
Oops, something went wrong.