• kind: local Kubernetes cluster (minikube alternative)

    4 min read

    kind Kubernetes kind local cluster

    kind is a tool for runnint local Kubernetes clusters on Docker, just in the same way minikube can work (if configuring it to use docker). It was primarily designed for testing Kubernetes itself, but we can use it for local development or CI as well.

    29/09/2021

    Read more...
  • Kubernetes: List objects from a specific api group (name collision)

    1 min read

    name clash name collision

    When we have different apiGroups providing objects with the same name (same kind), kubectl needs a way of telling them apart:

    $ kubectl api-resources | grep '\bconfigs\b'
    configs                                                   config.gatekeeper.sh/v1alpha1                   true         Config
    configs                                                   operator.openshift.io/v1                        false        Config
    

    28/09/2022

    Read more...
  • go get: Add a module from a private GitHub repository

    2 min read

    GitHub private repository go get

    If you try to add a golang module that is on a private repository you'll get an error similar to this:

    $ go get github.com/pet2cattle/golang-demo
    go: downloading github.com/pet2cattle/golang-demo v0.0.0-20220925191817-0b4b7026fa7f
    go: github.com/pet2cattle/golang-demo@v0.0.0-20220925191817-0b4b7026fa7f: verifying module: github.com/pet2cattle/golang-demo@v0.0.0-20220925191817-0b4b7026fa7f: reading https://sum.golang.org/lookup/github.com/pet2cattle/golang-demo@v0.0.0-20220925191817-0b4b7026fa7f: 404 Not Found
            server response:
            not found: github.com/pet2cattle/golang-demo@v0.0.0-20220925191817-0b4b7026fa7f: invalid version: git ls-remote -q origin in /tmp/gopath/pkg/mod/cache/vcs/75d68059a7355b978972dea177e930262ce90abe410680b8db8a45a587e02c26: exit status 128:
                    fatal: could not read Username for 'https://github.com': terminal prompts disabled
            Confirm the import path was entered correctly.
            If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.
    

    26/09/2022

    Read more...
  • ComponentStatus is going to be deprecated in v1.19+

    2 min read

    componentstatuses deprecated

    If you are using kubectl get componentstatuses you might have noticed that have been deprecated:

    $ kubectl get componentstatuses
    Warning: v1 ComponentStatus is deprecated in v1.19+
    NAME                 STATUS    MESSAGE   ERROR
    controller-manager   Healthy   ok        
    scheduler            Healthy   ok        
    

    23/09/2022

    Read more...
  • Install a development Vault on Kubernetes

    2 min read

    Helm Vault chart development testing

    If you are using Vault for storing secrets, it is desirable to have a different Vault for testing, CI and development. Having to setup an alternate production-grade Vault can be just not worth it (specially for volatile environments)

    For local environments it comes handy to use the dev server mode, for Kubernetes we can use the pet2cattle/helm-testvault to deploy it as an in-cluster service

    22/09/2022

    Read more...
  • AWS Controllers for Kubernetes - S3

    3 min read

    kubernetes aws s3 operator

    Amazon has recently released a set of controllers (actually they are operators because they are using CRDs) to create resources on AWS using Kubernetes objects. It works in the same way it crossplane works

    Let's install an test the ACK S3

    21/09/2022

    Read more...
  • Install awstools on a Mac

    4 min read

    AWS awstools

    awstools is a CLI tool that provides a small set of commands to manage the most commonly EC2 resources. It's installation it's not hard since it is a python script that has a list of dependencies on the requirements.txt file, but now it's even easier on Mac since there is a tap available

    20/09/2022

    Read more...
  • Patching a kubernetes object with kubectl patch and a patch file

    2 min read

    kubernetes kubectl patch file

    We can use the kubectl patch command with the -p option to update an existing kubernetes object:

    $ kubectl patch sc gp2 -p '{"allowVolumeExpansion": true}'
    storageclass.storage.k8s.io/gp2 patched
    

    When the patch is small is a very convenient way of patching it but as the patch grows it becomes less convenient

    19/09/2022

    Read more...
  • Kubernetes: Apply parts of a manifest by labels

    2 min read

    kubernetes kubectl selector apply

    Sometimes we might have a manifest file with a lot of objects in it but we don't really need them all. We can use it's labels to install just the objects that have a specific label.

    15/09/2022

    Read more...
  • Install minikube on an Apple Sillicon without Docker Desktop

    4 min read

    minikube docker colima apple M1 arm64 apple sillicon

    If you try to install minikube on an Apple Sillicon (such as Apple M1, M2...) you will face that some hypervisors doesn't support arm64 yet. Using Docker Destop, on the other hand, has recently changed it's license so it might not be suitable to you

    $ minikube start
    😄  minikube v1.26.1 on Darwin 12.5.1 (arm64)  Automatically selected the parallels driver. Other choices: ssh, qemu2 (experimental)
    
      Exiting due to DRV_UNSUPPORTED_OS: The driver 'parallels' is not supported on darwin/arm64
    
    $ minikube start --driver docker
    😄  minikube v1.26.1 on Darwin 12.5.1 (arm64)  Using the docker driver based on user configuration
    
    💣  Exiting due to PROVIDER_DOCKER_NOT_RUNNING: "docker version --format -" exit status 1: Cannot connect to the Docker daemon at unix:///Users/jordiprats/.rd/docker.sock. Is the docker daemon running?
    💡  Suggestion: Start the Docker service
    📘  Documentation: https://minikube.sigs.k8s.io/docs/drivers/docker/
    

    There are several alternatives to Docker Desktop but the one that I found more convenient and easier to install is Colima

    14/09/2022

    Read more...

Older content...

From pet to cattle
Treat your kubernetes clusters like cattle, not pets