Coder Social home page Coder Social logo

devops101-w5-m5-t2's Introduction

Write Kubernetes manifests with LLama AI

Run LLama AI

docker run -d --rm -p 8080:8080 ghcr.io/sozercan/llama3.1:8b
export OPENAI_ENDPOINT="http://localhost:8080/v1"
export OPENAI_DEPLOYMENT_NAME="llama-3.1-8b-instruct"
export OPENAI_API_KEY="n/a"

Install kubectl plugin

wget https://github.com/sozercan/kubectl-ai/releases/download/v0.0.13/kubectl-ai_linux_amd64.tar.gz
tar zxf kubectl-ai_linux_amd64.tar.gz
sudo mv kubectl-ai /usr/local/bin/
alias k=kubectl

Example

Write prompt and save result to file

k ai "create deploy redis" --raw > redis-deploy.yaml
NAME PROMPT DESCRIPTION EXAMPLE
app Create a Kubernetes Pod manifest where should have labels and contain k8s image with expose http port A basic Pod definition with labels and an exposed HTTP port. link
app-livenessProbe Create a Kubernetes Pod named "app-livenessprob" in the "demo" namespace using the image "gcr.io/k8s-k3s/demo:v1.0.0" with a liveness probe checking "/" on port 8000 and exposing port 8080 for HTTP A Pod with a liveness probe and an exposed port in the "demo" namespace. link
app-readinessProbe Create a Kubernetes Pod named "app-readinessprob" using the image "gcr.io/k8s-k3s/demo:v2.0.0" with liveness and readiness probes checking "/" and "/ready" on port 8000, and exposing port 8000 for HTTP. A Pod with both liveness and readiness probes, and an exposed HTTP port. link
app-volumeMounts Create a Kubernetes Pod named "app-volume" using the image "gcr.io/kuar-demo/kuard-amd64:1" with liveness and readiness probes checking "/healthy" and "/ready" on port 8080, exposing port 8080 for HTTP, and mounting the host path "/var/lib/app" to "/data". A Pod with volume mounts and probes, sharing a volume between containers. link
app-cronjob Create a Kubernetes CronJob named "app-cronjob" that runs every 5 minutes, using the "bash" image to execute the command echo "Hello world" with a restart policy of "OnFailure". A CronJob that prints "Hello world" every 5 minutes with an "OnFailure" restart policy. link
app-job Create a Kubernetes Job named "app-job-rsync" using the "google/cloud-sdk:275.0.0-alpine" image to run sutil, mounting a GCE Persistent Disk to /data/input, and set the restart policy to "Never" with a backoff limit of 0. A Job for syncing data with gsutil, using a GCE Persistent Disk, and a "Never" restart policy. link
app-multicontainer Create a Kubernetes Pod named "app-multi-containers" with two containers: the first using the "nginx" image and mounting an empty directory at nginx/html, and the second using the "debian" image, which writes the current date to index.html every second, with both containers sharing the same empty directory volume. A Pod with multiple containers sharing a volume, where one container serves content and the other updates it regularly. link
app-resources Create a Kubernetes Pod named "app-resource" using the image "gcr.io/kuar-demo/kuard-amd64:1" with liveness and readiness probes on port 8080, exposing the same port, and specify resource requests of 100m CPU and 128Mi memory, with limits of 100m CPU and 256Mi memory. A Pod with specified resource requests and limits, including liveness and readiness probes. link
app-secret-env Create a Kubernetes Pod named "app-secret-env" using the "redis" image, with environment variables SECRET_USERNAME and SECRET_PASSWORD populated from the username and password keys in the mysecret1 secret, and set the restart policy to "Never". A Pod that uses secret values for environment variables and has a "Never" restart policy. link

Conclusion

LLama is smart model but need manual review and fixes. Maybe try another AI or more clearly prompts!?

devops101-w5-m5-t2's People

Contributors

backend-dmytro-a avatar brokerua avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.