{"id":30754272,"url":"https://github.com/twogg-git/k8s-workshop","last_synced_at":"2026-04-11T08:02:23.088Z","repository":{"id":83441781,"uuid":"150682453","full_name":"twogg-git/k8s-workshop","owner":"twogg-git","description":"Taller práctico de Kubernetes, Docker y Docker Registry.","archived":false,"fork":false,"pushed_at":"2024-01-23T17:57:37.000Z","size":3477,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-04T13:52:59.241Z","etag":null,"topics":["docker","docker-registry","kubernetes"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/twogg-git.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-28T03:45:40.000Z","updated_at":"2024-01-23T17:48:36.000Z","dependencies_parsed_at":"2024-01-23T19:01:42.816Z","dependency_job_id":null,"html_url":"https://github.com/twogg-git/k8s-workshop","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/twogg-git/k8s-workshop","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twogg-git%2Fk8s-workshop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twogg-git%2Fk8s-workshop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twogg-git%2Fk8s-workshop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twogg-git%2Fk8s-workshop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/twogg-git","download_url":"https://codeload.github.com/twogg-git/k8s-workshop/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twogg-git%2Fk8s-workshop/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31673068,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T17:19:37.612Z","status":"online","status_checked_at":"2026-04-11T02:00:05.776Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-registry","kubernetes"],"created_at":"2025-09-04T09:07:51.933Z","updated_at":"2026-04-11T08:02:23.083Z","avatar_url":"https://github.com/twogg-git.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Taller Práctico de Kubernetes \n\u003cimg height=\"300\" width=\"500\" src=\"https://raw.githubusercontent.com/twogg-git/k8s-workshop/master/src/kubernetes.png\"\u003e\n\nTrabajaremos los conceptos claves al momento de realizar despliegues con Kubernetes, sus objetos, los comandos mas usados, los trucos, y también incluye un repaso de Docker y Docker Registry. \n\nTodos los recursos utilizados hacen parte del repositorio y los mencionare a medida que los usemos. Este taller esta pensado para que al final cuentes con tu repositorio de images de docker desplegadas en kubernetes, asi que en lo posible no te saltes la parte de Docker.\n\n## Recursos a utilizar\n- https://github.com/\n- https://hub.docker.com/\n- https://www.katacoda.com/\n\n## Slides taller\n\nLos conceptos de Kubernetes a manejar y de Docker esta en los siguientes slides, este repositorio es la base para los ejercicios explicados en los slides.   \n\nhttps://github.com/twogg-git/talks/blob/master/Kubernetes_DuraznoConf.pdf\n\n# 1. Docker\n\n## 1.1. Desplegar una muy sencilla pagina web\n\nDocker play ground para crear y ejecutar la imagen:    \nhttps://www.katacoda.com/courses/docker/persisting-data-using-volumes   \n\n- Ejecutar el primer contenedor\n```sh \ndocker container run --rm -d -p 80:80 --name nginx nginx:1.8-alpine\n``` \n\n- Creando archivos recursos para cargar nuestra propia pagina\n```sh\nmkdir website\n\ncd website\n\nvim index.html\n```\n\n- Contenido HTML pagina web\n``` sh\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n  \u003ctitle\u003eDocker\u003c/title\u003e\n\u003c/head\u003e\n\u003cbody\u003e\u003ccenter\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/twogg-git/k8s-workshop/master/src/0.0.png\"\u003e\n  \u003ch1 style=\"color:blue\"\u003eBaby steps with docker!\u003c/h1\u003e   \n\u003c/center\u003e\u003c/body\u003e\n\u003c/html\u003e\n``` \n\n- Cargar nuestra pagina con dos tipos de servidores: Nginx y Httpd\n``` sh\ndocker container run --rm -d -p 80:80 --name nginx -v /root/website:/usr/share/nginx/html nginx:1.8-alpine\n\ndocker container run --rm -d -p 8080:80 --name httpd -v /root/website/:/usr/local/apache2/htdocs/ httpd:2.4-alpine\n``` \n\n- Crear archivo Dockerfile\n``` sh\ncd ..\n\nvim Dockerfile\n``` \n\n- Contenido archivo para construir nuestra imagen\n``` sh\nFROM httpd:2.4-alpine\n\nADD website/ /usr/local/apache2/htdocs/\n\nEXPOSE 80\n``` sh\n\n- Construir archivo Dockerfile y ejecutar el contenedor\n``` sh \ndocker build -t httpd .\n\ndocker container run --rm -p 80:80 --name httpd httpd\n```\n\n## 1.2. Repositorios en GitHub\n\n```sh\nhttps://github.com/\n```\nRepositorios para el codigo fuente, yaml, y Dockerfile, tambien lo usaremos para construir imagenes en DockerHub.      \n![](https://raw.githubusercontent.com/twogg-git/k8s-workshop/master/src/github_signup.png)\n\n- Ahora a crear los repositorios de las dos imagenes, Go y Httpd   \n\u003cimg height=\"190\" width=\"150\" align=\"center\" src=\"https://raw.githubusercontent.com/twogg-git/k8s-workshop/master/src/new_repo.png\"\u003e\n\n- Tener en cuenta el nombre del repositorio lo usaremos luego!, tambien agregar el archivo readme   \n\u003cimg src=\"https://raw.githubusercontent.com/twogg-git/k8s-workshop/master/src/new_repo2.png\"\u003e\n\n- Repositorio *Httpd*, archivos Dockerfile y website-index.html. Los fuentes a crear esta en los siguientes links:     \n```sh\nhttps://repl.it/@twogg_git/index   \nhttps://repl.it/@twogg_git/DockerHttpd   \n```\n\u003cimg src=\"https://raw.githubusercontent.com/twogg-git/k8s-workshop/master/src/repo_files_html.png\"\u003e\n\n- Repositorio *Go*, archivos Dockerfile y k8s.go \n```sh\nhttps://repl.it/@twogg_git/k8s-10   \nhttps://repl.it/@twogg_git/DockerGO \n```\n\u003cimg src=\"https://raw.githubusercontent.com/twogg-git/k8s-workshop/master/src/repo_files_go.png\"\u003e\n\n## 1.3. Docker Registry\n\n```sh\nhttps://hub.docker.com/\n```\nEste es el repositorio para las imagenes Docker que vamos a crear.\n![](https://raw.githubusercontent.com/twogg-git/k8s-workshop/master/src/dockerhub_signup.png)\n\n- Ahora a crear nuestra construccion automatizada, *este paso para ambos repositorios de GitHub Go y Httpd   \n\u003cimg height=\"190\" width=\"150\" src=\"https://raw.githubusercontent.com/twogg-git/k8s-workshop/master/src/hub_new_repo.png\"\u003e\n\n- Ahora a crear nuestra construccion automatizada, *este paso para ambos repositorios Go y Httpd   \n\u003cimg height=\"190\" width=\"150\" src=\"https://raw.githubusercontent.com/twogg-git/k8s-workshop/master/src/hub_new_repo.png\"\u003e\n\n- Seleccionar repo tipo GitHub y luego buscar el que vamos a crear, ahora agregar la descripcion y crear \n\u003cimg src=\"https://raw.githubusercontent.com/twogg-git/k8s-workshop/master/src/aut_hub.png\"\u003e\n\n- Ahora, en *Build Settings* damos una version a nuestra imagen ejemplo 1.0, luego click en save y al final click trigger. \n\u003cimg src=\"https://raw.githubusercontent.com/twogg-git/k8s-workshop/master/src/build_settings.png\"\u003e\n\n- Revisamos que se construya la imagen en *Build Details*. \n\u003cimg src=\"https://raw.githubusercontent.com/twogg-git/k8s-workshop/master/src/build_details.png\"\u003e\n\n- El tag de nuestra imagen. \n\u003cimg src=\"https://raw.githubusercontent.com/twogg-git/k8s-workshop/master/src/tags.png\"\u003e\n\n# 2. Kubernetes\n\n## 2.1. Comandos básicos \n\nCodigo fuente en ejecución de la pagina HTML: [index.html](https://github.com/twogg-git/k8s-workshop/blob/1.0-baby/docker/website/index.html)\n\nKatacoda Minikube playground: https://www.katacoda.com/courses/kubernetes/launch-single-node-cluster#\n\n```sh \nkubectl get all\n\ndashboard\n\nkubectl get pods --output wide --show-labels --watch\n\nkubectl run k8sjr --image=twogghub/k8s-workshop:1.0-httpd\n\nclear \u0026\u0026 kubectl get all\n\nkubectl expose deployment k8sjr --port=80 --external-ip=$(minikube ip) --type=LoadBalancer\n\nkubectl get all\n\nkubectl describe pod k8sjr-6d9fd6c5c-htm9f\n\nkubectl label pod k8sjr-6d9fd6c5c-htm9f version=\"jrV1\"\n\nkubectl scale --replicas=5 deployment k8sjr \n\nkubectl scale --replicas=1 deployment k8sjr\n\nkubectl run k8sqa --image=twogghub/k8s-workshop:1.0-httpd --replicas=2 --labels=\"version=qa,dev=twogg\"\n\nkubectl expose deployment k8sqa --port=90 --target-port=80 --external-ip=$(minikube ip) --type=LoadBalancer\n \nkubectl get pods -L run,version\n\nkubectl get pod k8sqa-794f9b449c-hnbwg -o json\n\nkubectl get pods -o=custom-columns=\"APP:.spec.containers[*].name,POD:.metadata.name,LABELS:.metadata.labels,IMAGE:.spec.containers[*].image,IP:.status.podIP\"\n\nkubectl get pods -l run=k8sjr\n\nkubectl delete pod k8sjr-6d9fd6c5c-htm9f  \n\nkubectl delete deployment k8sjr\n\nkubectl delete deployments --all\n\nkubectl delete services --all\n```\n\n## 2.2. Selectores y Outputs\n\nCodigo fuente en ejecucion version [k8s-1.0-baby](https://repl.it/@twogg_git/k8s-10), [k8s-1.1-rolling](https://repl.it/@twogg_git/k8s-11)\n\n```sh \nclear \u0026\u0026 kubectl get all\n\nclear \u0026\u0026 kubectl get pods -o=custom-columns=\"APP:.spec.containers[*].name,POD:.metadata.name,LABELS:.metadata.labels,IMAGE:.spec.containers[*].image,IP:.status.podIP,PHASE:.status.phase\"\n\nkubectl run k8sgo --image=twogghub/k8s-workshop:1.0-baby --image-pull-policy=Always --replicas=3 --labels=\"deploy=baby\"\n\nkubectl expose deployment k8sgo --port=8080 --external-ip=$(minikube ip) --type=LoadBalancer\n\nkubectl set image deployment k8sgo k8sgo=twogghub/k8s-workshop:1.1-rolling\n\nkubectl delete pod k8sgo-84d9f99df8-d7trj\n\nkubectl scale --replicas=5 deployment k8sgo\n\nkubectl get pods,services,deployments --output wide\n\nkubectl delete deployments,services,pods,replicasets --selector=\"deploy=baby\"\n``` \n\n## 2.3. Deplieges con archivos YAML\n\nFuente archivo YAML de despliegue [k8slatest.yaml](https://github.com/twogg-git/k8s-workshop/blob/master/yamls/k8slatest.yaml)\n\n```sh \napiVersion: extensions/v1beta1\nkind: Pod\nmetadata:\n  name: k8slatest\nspec:\n  replicas: 1\n  template:  \n    metadata:  \n      labels:  \n        env: k8slatest\n    spec:\n      containers:\n        - image: twogghub/k8s-workshop:1.1-rolling\n          imagePullPolicy: Always\n          name: k8slatest\n          ports:\n          - name: http\n            containerPort: 8080\n``` \n\n```sh \nclear \u0026\u0026 kubectl get all\n\nclear \u0026\u0026 kubectl get pods -o=custom-columns=\"APP:.spec.containers[*].name,POD:.metadata.name,LABELS:.metadata.labels,IMAGE:.spec.containers[*].image,IP:.status.podIP,PHASE:.status.phase\"\n\nvim deployment.yaml\n\nkubectl create -f deployment.yaml\n\nkubectl expose deployment k8slatest --port=8080 --external-ip=$(minikube ip) --type=LoadBalancer\n\nkubectl describe deployment k8slatest\n\nkubectl delete pods,services,deployments,replicaset --all\n``` \n\n## 2.4. Politicas de despliegue\n\nCodigo fuente en ejecucion version [k8s-1.2-yaml](https://repl.it/@twogg_git/k8s-12)\n\n```sh\n...\n  strategy:\n    type: RollingUpdate\n    rollingUpdate:\n      maxSurge: 1\n      maxUnavailable: 1\n      ...\n```\n\n```sh\n...\n  strategy:\n    type: Recreate\n    ...\n```\n\n```sh\nclear \u0026\u0026 kubectl get all\n\nclear \u0026\u0026 kubectl get pods -o=custom-columns=\"APP:.spec.containers[*].name,POD:.metadata.name,LABELS:.metadata.labels,IMAGE:.spec.containers[*].image,IP:.status.podIP,PHASE:.status.phase\"\n\nkubectl create -f https://raw.githubusercontent.com/twogg-git/k8s-workshop/master/yamls/k8sqa.yaml\n\nkubectl expose deployment k8sqa --port=9090 --external-ip=$(minikube ip) --type=LoadBalancer\n\nkubectl describe deployment k8sqa\n\nkubectl create -f https://raw.githubusercontent.com/twogg-git/k8s-workshop/master/yamls/k8sprod.yaml\n\nkubectl expose deployment k8sprod --port=8080 --external-ip=$(minikube ip) --type=LoadBalancer\n\nkubectl get pods --output wide --show-labels --watch\n\nkubectl set image deployment/k8sqa k8sqa=twogghub/k8s-workshop:1.1-qaonly\n\nkubectl set image deployment/k8sprod k8sprod=twogghub/k8s-workshop:1.1-rolling\n\nkubectl delete deployments,services,pods,replicasets --selector=\"env=qa\"\n\nkubectl scale --replicas=3 deployment k8sprod\n\nkubectl set image deployment k8sprod k8sprod=twogghub/k8s-workshop:1.2-yaml\n\nkubectl rollout undo deployment/k8sprod\n\nkubectl delete deployments,services,pods,replicasets --selector=\"env=prod\"\n```\n\n## 5. Validacion del despliegue mediante endpoints  \n\nCodigo fuente en ejecucion version [k8s-1.3-livenes](https://repl.it/@twogg_git/k8s-13)\n\n```sh\n...\nspec:\n  ...\n  template:  \n    metadata:  \n      ...\n      annotations:\n        kubernetes.io/change-cause: \"HttpGet /health return error!\" \n    spec:\n      containers:\n        - image: twogghub/k8s-workshop:1.3-liveness\n          name: k8sdp\n          livenessProbe:\n            httpGet:\n              path: /health\n              port: 8080\n            initialDelaySeconds: 5\n            timeoutSeconds: 1\n            periodSeconds: 2\n            failureThreshold: 1\n          ...\n```\n\n```sh\nclear \u0026\u0026 kubectl get all\n\nclear \u0026\u0026 kubectl get pods -o=custom-columns=\"APP:.spec.containers[*].name,POD:.metadata.name,LABELS:.metadata.labels,IMAGE:.spec.containers[*].image,IP:.status.podIP,PHASE:.status.phase\"\n\nkubectl create -f https://raw.githubusercontent.com/twogg-git/k8s-workshop/1.3-liveness/yamls/k8sdp.yaml\n\nkubectl get pods -L env --output wide --watch\n\nkubectl describe deployment k8sdp\n\nkubectl expose deployment k8sdp --port=8080 --external-ip=$(minikube ip) --type=LoadBalancer\n\nkubectl set image deployment k8sdp k8sdp=twogghub/k8s-workshop:1.2-yaml --record\n\nkubectl rollout undo deployment/k8sdp\n\nkubectl rollout history deployments k8sdp\n\nkubectl delete pods,services,deployments,replicaset --all\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwogg-git%2Fk8s-workshop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwogg-git%2Fk8s-workshop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwogg-git%2Fk8s-workshop/lists"}