diff --git a/kubernetes_101/hands_on/deployment.yml b/kubernetes_101/hands_on/deployment.yml new file mode 100644 index 0000000..d4af294 --- /dev/null +++ b/kubernetes_101/hands_on/deployment.yml @@ -0,0 +1,40 @@ +--- +kind: Deployment +apiVersion: apps/v1 +metadata: + name: my-deployment + namespace: my-namespace + labels: + app: web +spec: + selector: + matchLabels: + app: web + replicas: 3 + template: + metadata: + labels: + app: web + spec: + containers: + - name: nginx + image: docker.io/nginxinc/nginx-unprivileged:stable + imagePullPolicy: Always + ports: + - name: http + containerPort: 8080 + protocol: TCP + volumeMounts: + - name: webroot + mountPath: /usr/share/nginx/html + securityContext: + allowPrivilegeEscalation: false + runAsUser: 1000 + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumes: + - name: webroot + persistentVolumeClaim: + claimName: my-pvc + restartPolicy: Always + diff --git a/kubernetes_101/hands_on/namespace.yml b/kubernetes_101/hands_on/namespace.yml new file mode 100644 index 0000000..a544f31 --- /dev/null +++ b/kubernetes_101/hands_on/namespace.yml @@ -0,0 +1,6 @@ +--- +kind: Namespace +apiVersion: v1 +metadata: + name: my-namespace + diff --git a/kubernetes_101/hands_on/pvc.yml b/kubernetes_101/hands_on/pvc.yml new file mode 100644 index 0000000..7db806e --- /dev/null +++ b/kubernetes_101/hands_on/pvc.yml @@ -0,0 +1,15 @@ +--- +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: my-pvc + namespace: my-namespace +spec: + accessModes: + - ReadWriteOnce + volumeMode: Filesystem + resources: + requests: + storage: 1Gi + storageClassName: default + diff --git a/kubernetes_101/hands_on/service.yml b/kubernetes_101/hands_on/service.yml new file mode 100644 index 0000000..5dec3dd --- /dev/null +++ b/kubernetes_101/hands_on/service.yml @@ -0,0 +1,14 @@ +--- +kind: Service +apiVersion: v1 +metadata: + name: my-service + namespace: my-namespace +spec: + selector: + app: web + ports: + - port: 80 + targetPort: 8080 + protocol: TCP + diff --git a/kubernetes_101/index.md b/kubernetes_101/index.md index 32cf6b2..9091624 100644 --- a/kubernetes_101/index.md +++ b/kubernetes_101/index.md @@ -58,7 +58,8 @@ The emojis probably make no sense, ignore them if they confuse you. # Agenda part 2 - Advanced topics - 🏭 Deployments -- ? StatefulSets +- 🧰 DaemonSet +- πŸ—ƒοΈ StatefulSets - 🌐 Ingress Controller - πŸ“‘ Cluster DNS - πŸ’Ύ Container Storage Interface (CSI) @@ -137,15 +138,27 @@ Example: Simple PHP app --- +# You survived, take a cookie! + +# :cookie: + +--- + +# πŸ’£ Hands on + +Let's deploy a simple web app with a volume. + +--- + # 🏭 Deployments --- -# 🏘️ ReplicaSets +# 🧰 DaemonSets --- -# ? StatefulSets +# πŸ—ƒοΈ StatefulSets --- @@ -171,21 +184,36 @@ Example: Simple PHP app --- -# Containers - Hands on +# Kubernetes distribution -```shell -$ podman run -it --rm docker.io/debian:stable +- πŸ’» On bare metal + - [RedHat OpenShift][openshift] + - [OKD][okd] + - [Rancher][rancher] + - [k3s][k3s]/[k3os][k3os] ([RaspberryPi][rpi]) +- β›… In the cloud: + - Amazon (EKS, ECS) + - Google (GCP) -$ systemctl --user status user.slice +[openshift]: https://www.redhat.com/en/technologies/cloud-computing/openshift +[okd]: https://www.okd.io/ +[rancher]: https://rancher.com/ +[k3s]: https://k3s.io/ +[k3os]: https://k3os.io/ +[rpi]: https://www.raspberrypi.com/ -$ podman-compose up -``` +--- - +# Still not enough? + +- πŸ”‘ Secrets +- πŸ“‘ Control Plane +- πŸ”© Operators +- πŸ•‘ Jobs and CronJobs +- πŸ—ΊοΈ ConfigMaps +- πŸ” Pod Security Policies +- πŸͺͺ Role Based Access Control (RBAC) +- πŸͺ΅ Resource Quotas ---