Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Kubernertes CRDs

Kubernertes CRDs

Charla que di en Nerdear.la 2019 en donde hablo de CRDs en Kubernetes.

Pablo Fredrikson

October 17, 2019
Tweet

More Decks by Pablo Fredrikson

Other Decks in Technology

Transcript

  1. Pablo Fredrikson @pablokbs • Nerd • Lead SRE @ Invision

    • 13 años con Linux / Software Libre • 5+ años con Docker • 3 años con Kubernetes en producción • 4º Nerdear.la
  2. Kubernetes en 3 minutos MASTER API server Kube Scheduler Controller

    Manager Cloud Controller Manager API Kubernetes Cluster Services API Kubernetes Cluster Services API etcd deployment pod1: - container1 - container2 replicas: 3 pod2: - container3 replicas: 2 Kubelet Kubelet Kubelet P1R3 P1R1 P2R1 P1R2 P2R2
  3. Kubernetes en 3 minutos Kubelet P2R1 Kubelet P1R2 Kubelet Kubernetes

    Cluster Services API deployment pod1: - container1 - container2 replicas: 3 pod2: - container3 replicas: 2 P1R3 P1R1 P2R2 P1R3 P1R1
  4. Kubernetes resources $ kubectl get pods NAME READY STATUS RESTARTS

    AGE hello-world-5847b8d4b6-fjbhv 1/1 Running 4 23d $ kubectl get svc NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE hello-world ClusterIP 10.99.2.206 <none> 8000/TCP 23d kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 100d
  5. Extendiendo la API de Kubernetes: CRDs apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition

    metadata: name: crontabs.stable.example.com spec: group: stable.example.com version: v1 scope: Namespaced names: plural: crontabs singular: crontab kind: CronTab shortNames: - ct
  6. Extendiendo la API de Kubernetes: CRDs apiVersion: "stable.example.com/v1" kind: CronTab

    metadata: name: my-new-cron-object spec: cronSpec: "* * * * /5" image: my-awesome-cron-image
  7. Extendiendo la API de Kubernetes: CRDs $ kubectl apply -f

    mycronjob.yaml $ kubectl get crontabs NAME KIND my-new-cron-object CronTab.v1.stable.example.com