diff --git a/.devcontainer/scripts/postStartCommand.sh b/.devcontainer/scripts/postStartCommand.sh index aab9e46..61bbc7e 100755 --- a/.devcontainer/scripts/postStartCommand.sh +++ b/.devcontainer/scripts/postStartCommand.sh @@ -5,6 +5,7 @@ set -e # Configure Bash cat <> /home/vscode/.bashrc source <(fzf --bash) +alias kubectl=kubecolor alias k=kubectl complete -o default -F __start_kubectl k export PATH="${KREW_ROOT:-/home/vscode/.krew}/bin:$PATH" diff --git a/.github/.devcontainer/Dockerfile b/.github/.devcontainer/Dockerfile index 8d55dd2..aa81fee 100755 --- a/.github/.devcontainer/Dockerfile +++ b/.github/.devcontainer/Dockerfile @@ -1,10 +1,17 @@ # syntax=docker/dockerfile:1 FROM mcr.microsoft.com/devcontainers/base:ubuntu -## Install Taskfile +## Install Tools RUN < +[in-place-resource-resize-blog]: https://kubernetes.io/blog/2023/05/12/in-place-pod-resize-alpha/ +[understanding-kubernetes-dynamic-resource-scaling-and-cpu-boost]: https://cloud.google.com/blog/products/containers-kubernetes/understanding-kubernetes-dynamic-resource-scaling-and-cpu-boost?hl=en +[kube-startup-cpu-boost-gh]: https://github.com/google/kube-startup-cpu-boost diff --git a/discovery/in-place-resource-resize-1.27-alpha/spring-demo.deploy.yml b/discovery/in-place-resource-resize-1.27-alpha/spring-demo.deploy.yml new file mode 100644 index 0000000..f34a352 --- /dev/null +++ b/discovery/in-place-resource-resize-1.27-alpha/spring-demo.deploy.yml @@ -0,0 +1,78 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: spring-demo-app +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: spring-demo-app + template: + metadata: + labels: + app.kubernetes.io/name: spring-demo-app + spec: + containers: + - name: spring-demo-app + image: ghcr.io/google/spring-demo-app:latest + args: + - --spring.config.location=file:/config/application.yaml + env: + - name: JAVA_OPTS + value: -XX:MaxRAMPercentage=75 + volumeMounts: + - name: spring-demo-app-config + mountPath: /config + ports: + - name: http + containerPort: 8080 + startupProbe: + periodSeconds: 2 + failureThreshold: 60 + httpGet: + path: /actuator/health + port: http + scheme: HTTP + livenessProbe: + httpGet: + path: /actuator/health + port: http + scheme: HTTP + resources: + limits: + cpu: "1" + memory: 512Mi + requests: + cpu: 500m + memory: 512Mi + volumes: + - name: spring-demo-app-config + configMap: + name: spring-demo-app-config + +--- + +apiVersion: v1 +kind: ConfigMap +metadata: + name: spring-demo-app-config +data: + application.yaml: | + spring: + datasource: + url: jdbc:h2:mem:mydb + username: sa + password: password + driverClassName: org.h2.Driver + jpa: + hibernate: + ddl-auto: create + database-platform: org.hibernate.dialect.H2Dialect + defer-datasource-initialization: true + management: + endpoints: + web: + exposure: + include: + - health + - prometheus diff --git a/discovery/in-place-resource-resize-1.27-alpha/startup-cpu-boost.yml b/discovery/in-place-resource-resize-1.27-alpha/startup-cpu-boost.yml new file mode 100644 index 0000000..daafea0 --- /dev/null +++ b/discovery/in-place-resource-resize-1.27-alpha/startup-cpu-boost.yml @@ -0,0 +1,20 @@ +apiVersion: autoscaling.x-k8s.io/v1alpha1 +kind: StartupCPUBoost +metadata: + name: boost-001 +selector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: ["spring-demo-app"] +spec: + resourcePolicy: + containerPolicies: + - containerName: spring-demo-app + fixedResources: + requests: "1" + limits: "2" + durationPolicy: + fixedDuration: + unit: Seconds + value: 120 diff --git a/discovery/tasks.yml b/discovery/tasks.yml index 834e4df..43c8d5a 100644 --- a/discovery/tasks.yml +++ b/discovery/tasks.yml @@ -54,3 +54,11 @@ tasks: microcks-uninstall: desc: Uninstall Microcks. cmd: helm del -n microcks microcks + + kube-startup-cpu-boost-install: + desc: Install Startup CPU Boost. + cmd: kubectl apply -f https://github.com/google/kube-startup-cpu-boost/releases/download/v0.11.3/manifests.yaml + + kube-startup-cpu-boost-uninstall: + desc: Uninstall Startup CPU Boost. + cmd: kubectl delete -f https://github.com/google/kube-startup-cpu-boost/releases/download/v0.11.3/manifests.yaml diff --git a/kind.yml b/kind.yml index cdab1c4..95c92e1 100755 --- a/kind.yml +++ b/kind.yml @@ -5,6 +5,9 @@ featureGates: # Kubernetes 1.31 - Alpha # https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/ ImageVolume: true + # Kubernetes 1.27 - Alpha + # https://kubernetes.io/blog/2023/05/12/in-place-pod-resize-alpha/ + InPlacePodVerticalScaling: true nodes: - role: control-plane image: kindest/node:v1.32.0 diff --git a/security/ESO/README.md b/security/ESO/README.md index cb18bab..c573ac0 100755 --- a/security/ESO/README.md +++ b/security/ESO/README.md @@ -23,7 +23,7 @@ task security:eso-install ## Create Secret Store kubectl apply -f security/ESO/secretmanager.store.yml -## Storing a secret in AWS Secret Manager +## Storing a secret in AWS Secret Manager aws secretsmanager create-secret \ --name my-eso-secret \ --description "My ESO Secret." \ @@ -60,10 +60,9 @@ task security:eso-uninstall - [Secrets store CSI driver vs external secrets in a nutshel][eso-vs-csi-secrets-store] - [Clarity: secrets store CSI driver vs external secrets... what to use? #478][eso-vs-csi-secrets-store-clarity] - [eso-doc]:https://external-secrets.io/latest/ [k8s-secret-management-blog]: https://toungafranck.com/2024/05/09/gestion-des-secret-sur-kubernetes/ [eso-aws-custom-endpoints]: https://external-secrets.io/latest/provider/aws-secrets-manager/#custom-endpoints [eso-vs-csi-secrets-store]: https://www.yuribacciarini.com/secrets-store-csi-driver-vs-external-secrets-in-a-nutshel/ -[eso-vs-csi-secrets-store-clarity]: https://github.com/external-secrets/external-secrets/issues/478 \ No newline at end of file +[eso-vs-csi-secrets-store-clarity]: https://github.com/external-secrets/external-secrets/issues/478