Skip to content

Instantly share code, notes, and snippets.

View daniconil's full-sized avatar

Daniel M. daniconil

View GitHub Profile
@daniconil
daniconil / K8s cheatsheet
Created March 8, 2024 11:18
A complete guide with k8s commands
### 1.1 COMMON COMMANDS
| Name | Command |
| --- | --- |
| Run curl test temporarily | kubectl run --generator=run-pod/v1 --rm mytest --image=yauritux/busybox-curl -it |
| Run wget test temporarily | kubectl run --generator=run-pod/v1 --rm mytest --image=busybox -it wget |
| Run nginx deployment with 2 replicas | kubectl run my-nginx --image=nginx --replicas=2 --port=80 |
| Run nginx pod and expose it | kubectl run my-nginx --restart=Never --image=nginx --port=80 --expose |
| Run nginx deployment and expose it | kubectl run my-nginx --image=nginx --port=80 --expose |
| List authenticated contexts | kubectl config get-contexts, ~/.kube/config |
@daniconil
daniconil / user-data
Last active March 8, 2024 10:13
Ubuntu 20.04 user-data files for Autoinstall method
#cloud-config
autoinstall:
version: 1
keyboard:
layout: es
variant: winkeys
# The language used by default is English, so we don't need any locale value. The GNOME language pack is not required in this case
# locale: es_ES.UTF-8
refresh-installer:
update: no
def validarNumero(mensaje):
    while True:
        try:
            dato = float(input(mensaje))
            return dato
        except ValueError:
            print("debes ingresar un dato entero o decimal")
def validarTexto(mensaje):
    while True:
        try: