= 23/24 5bhitm itp - Lecture Notes
Thomas W. Stütz
1.0.0, 2023-09-22: Informationstechnische Projekte
ifndef::imagesdir[:imagesdir: images]
:icons: font
:experimental:
:sectnums:
:toc:
ifdef::backend-html5[]

// https://fontawesome.com/v4.7.0/icons/
icon:file-text-o[link=https://raw.githubusercontent.com/2324-5bhitm-itp/2324-5bhitm-itp-lecture-notes/main/asciidocs/{docname}.adoc] ‏ ‏ ‎
icon:github-square[link=https://github.com/2324-5bhitm-itp/2324-5bhitm-itp-lecture-notes] ‏ ‏ ‎
icon:home[link=http://edufs.edu.htl-leonding.ac.at/~t.stuetz/hugo/2021/01/lecture-notes/]
endif::backend-html5[]

== 2023-09-15

* Präsentationen der Projekte

== 2023-09-22

image::projektkreislauf.png[]


* Jedes Projektmitglied muss beim Code Review seine User Stories und Tasks präsentieren, seine Implementierung und die Verbindung zwischen Commits und Tasks

== 2023-10-06

=== Rel.DB vs noSQL

* Was ist eine Datenbank?
* Warum normalisieren?
* Wie normalisiert man?
* Ergebnis der Normalisierung?

image::2023-10-06-tafelbild1.PNG[]

image::2023-10-06-tafelbild2.PNG[]

image::database-types.jpeg[]

image::database-types2.jpeg[]


=== k8s

==== Kanonische Applikation

image::kanonische-applikation.png[]

==== yaml-File

* https://github.com/caberger/webpack-demo/blob/master/k8s/nginx.yaml[nginx.yaml (von Prof. Aberger)^]

* ConfigMaps können als Files gemounted werden (zB für Konfiguration des nginx-Servers)

* https://www.youtube.com/playlist?list=PLy7NrYWoggjziYQIDorlXjTvvwweTYoNC[nana - Videos^]

----
minikube start
minikube addons enable dashboard
minikube addons enable metrics-server
kubectl apply -f nginx.yaml
kubectl port-forward [podname] 4200:80
----

* https://kodekloud.com/blog/kubectl-cp/[^]
* https://kodekloud.com/blog/[^]


.nginx.yaml
[source,yaml]
----
# nginx Web Server
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx

spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
        - name: nginx
          image: nginx:stable
          ports:
            - containerPort: 80
          volumeMounts:
            - name: default-conf
              mountPath: /etc/nginx/conf.d/default.conf
              subPath: default.conf
              readOnly: true
            - name: www
              mountPath: /usr/share/nginx/html
              readOnly: false
      volumes:
        - name: default-conf
          configMap:
            name: nginx-config
            items:
              - key: default.conf
                path: default.conf
        - name: www
          persistentVolumeClaim:
            claimName: nginx-www
---
apiVersion: v1
kind: Service
metadata:
  name: nginx

spec:
  ports:
    - port: 80
      targetPort: 80
      protocol: TCP
  selector:
    app: nginx
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: nginx-config

data:
  default.conf: |
    server {
        listen 80;
        root /usr/share/nginx/html/demo;
        rewrite_log on;
        error_log /dev/stdout debug;

    }
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: nginx-www

  annotations:
    nfs.io/storage-path: "nginx-www"
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: standard
  resources:
    requests:
      storage: 100Mi
---
----


==== BusyBox in k8s

* https://levelup.gitconnected.com/busybox-in-k8s-the-swiss-army-knife-of-embedded-linux-ce7ced32de63[BusyBox in K8S — The Swiss Army Knife of Embedded Linux^]


* https://github.com/caberger/webpack-demo/blob/master/k8s/busybox-job.yaml[busybox-job.yaml^]

* ein `kind: Job` wird nur einmal ausgeführt

[source,yaml]
----
# busybox-job.yaml

# this is our swiss army knife.
# here we use it to copy our web-content to the persistent volume that is mounted by busybox.
# after deployment busybox sleeps a while and we can use kubectl cp to copy files to the storage.
# after some time the job stops
apiVersion: batch/v1
kind: Job
metadata:
  name: knife

spec:
  backoffLimit: 1
  activeDeadlineSeconds: 1800
  template:
    spec:
      containers:
      - name: busybox
        image: busybox:latest
        command: ["/bin/sh", "-c"]
        args:
          - mkdir -p /srv/demo;
            echo "<html><head></head><body>Copy your web app to this location on this persistent volume.<br/>To the api ==> <a href="./api/user">./api/user</a></body></html>" > /srv/demo/index.html;
            sleep 900;
            echo done;
        volumeMounts:
        - name: html
          mountPath: /srv
          readOnly: false
      volumes:
        - name: html
          persistentVolumeClaim:
            claimName: nginx-www
      restartPolicy: Never
----

* Files zB von der Angular Anwendung werden gezippt und von der BusyBox entpackt und zur Verfügung gestellt

* https://kubernetes.io/docs/reference/kubectl/cheatsheet/[kubectl cheat sheet^]



== 2023-10-13

=== Feedbackrunde IoT-projekt

image::2023-10-13-iot-projekt.png[]

* Nächste Schritte
** Erstellen der User Stories und Tasks im Youtrack (Sprint Planning)

** Grobe Gesamtplanung für das Schuljahr mit Zwischenpräsentationsterminen

=== Feedbackrunde Visualisierungs-Projekt

=== Feedbackrunde Franklyn


* https://www.altexsoft.com/blog/business/acceptance-criteria-purposes-formats-and-best-practices/[Acceptance Criterias^]

* https://www.linkedin.com/pulse/scrum-basics-whats-difference-between-user-story-task-edward-emerson/[User Story vs Task^]

== 2024-01-12

image::lernstrategie1.png[]

image::lernstrategie2.png[]

== 2024-01-18

image::git-merge-vs-rebase.JPG[]

image::git-cherry-picking-1.png[]

image::git-cherry-picking-2.png[]

== 2024-03-21

=== K8s

image::k8s-overview.png[]

image::k8s-elemente.png[]

image::k8s-pvc.png[]

=== Stoff der 3. Leistungsüberprüfung

* Qualitätssicherung inkl. Theorie
** assertj-core
** assertj-db
** rest-assured
** jUnit

* Agile Vorgehensweisen - Scrum




