# INDEED Day 21/06/2021 - 24/06/2021
## Trainers
[Rafael Tanaka](mailto:rafaek.tanaka@jetstack.io)
## Setup
| Meeting ID | Password |
| ---------- | ---------- |
| Zoom | to confirm |
### Links
- [Download Zoom](https://zoom.us/download#client_4meeting)
- [This Doc]()
- [FlightDeck](https://flightdeck.jetstack.io) - you will receive an invitation email on the first day
## Schedule (BST)
| | |
|--|--|
|Start|15:00|
|break|16:45-17:00|
|Finish|18:30|
## Attendee Resources
Requests on GPU:
https://kubernetes.io/docs/tasks/manage-gpus/scheduling-gpus/
Worker node or minion:
https://github.com/kubernetes/kubernetes/issues/1111
Minikube, great one node cluster you can install locally to play around:
https://minikube.sigs.k8s.io/docs/start/
https://labs.play-with-k8s.com/
PostStart and PreStop hooks:
https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/
HPA cooldown:
```
--horizontal-pod-autoscaler-downscale-stabilization: Specifies the duration of the downscale stabilization time window. Horizontal Pod Autoscaler remembers the historical recommended sizes and only acts on the largest size within this time window. The default value is 5 minutes (5m0s).
```
https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
Answer to the Online Boutique Challenge:
1 - The dep-shipping.yaml had not been deployed
2 - The dep-shipping.yaml had kind as “deployment” correct is **Deployment**
3 - The dep-shipping.yaml had incorrect labels “app=shippingsservice” correct is **app=shippingservice**
4 - The svc-shipping.yaml had targetPort as “50500” correct is **50501**. If you retrive the logs from the shipping Pod you would be able to see the port the application had started listening for requests (50501).
5 - The svc-payment.yaml had name “payment-service” correct is **paymentservice**. The name of the Service always receives a DNS pointing to the IP address of the Service. Also several of the microservices were configured to reach the Payment services over the host **paymentservice**.
## Pod readiness
https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-readiness-gate
FEATURE STATE: Kubernetes v1.14 [stable]
Your application can inject extra feedback or signals into PodStatus: Pod readiness. To use this, set readinessGates in the Pod's spec to specify a list of additional conditions that the kubelet evaluates for Pod readiness.
Readiness gates are determined by the current state of status.condition fields for the Pod. If Kubernetes cannot find such a condition in the status.conditions field of a Pod, the status of the condition is defaulted to "False".
Here is an example:
kind: Pod
```yaml
spec:
readinessGates:
- conditionType: "www.example.com/feature-1"
status:
conditions:
- type: Ready # a built in PodCondition
status: "False"
lastProbeTime: null
lastTransitionTime: 2018-01-01T00:00:00Z
- type: "www.example.com/feature-1" # an extra PodCondition
status: "False"
lastProbeTime: null
lastTransitionTime: 2018-01-01T00:00:00Z
containerStatuses:
- containerID: docker://abcd...
ready: true
```
The Pod conditions you add must have names that meet the Kubernetes label key format.
## NOMITATED NODES:
When scheduling a pod, evaluating all nodes looking for the best candidate can be time-consuming in large clusters. To speed up the process, this feature lets you define a preferred node with the .status.nominatedNodeName field inside a Pod. If the pod doesn’t fit in the nominated node, the scheduling cycle will continue to evaluate the rest of the nodes in the cluster as usual.
More details here: https://github.com/kubernetes/enhancements/blob/master/keps/sig-scheduling/1923-prefer-nominated-node/README.md
InitContainers:
```
Use activeDeadlineSeconds on the Pod and livenessProbe on the container to prevent init containers from failing forever. The active deadline includes init containers.
```
https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
Feedback form =)
https://docs.google.com/forms/d/1I3zfYBuEYEf5Y9dvrz9Nc4S2ABVebcHiP2zurnqioro/edit