Let's look at some basic kubectl output options.
Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).
We can start with:
kubectl get no
kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod |
# non root user example for alpine | |
# | |
# usage: | |
# $ docker build --build-arg "USER=someuser" --tag test . | |
# $ docker run --rm test | |
FROM alpine | |
ARG USER=default | |
ENV HOME /home/$USER |
+----------------------------------+---------+------------------------+----------------+ | |
| Col1 | Col2 | Col3 | Numeric Column | | |
+----------------------------------+---------+------------------------+----------------+ | |
| Value 1 | Value 2 | 123 | 10.0 | | |
| Separate | cols | with a tab or 4 spaces | -2,027.1 | | |
| This is a row with only one cell | | | | | |
+----------------------------------+---------+------------------------+----------------+ |
#!/bin/bash | |
USAGE="Attach to Docker Container | |
-------------------------- | |
Attach to Docker Container even if the container does not run | |
ssh daemon. This is accomplished by using linux containers | |
directly via 'nsenter' (see http://bit.ly/docker_nsenter). | |
To install 'nsenter', just execute: | |
$ docker run -v /usr/local/bin:/target jpetazzo/nsenter |
$ cat Makefile | |
cross-build: | |
@docker buildx create --name mybuilder --use | |
@docker buildx build --platform ${BUILDX_PLATFORMS} -t ${PROD_IMAGE} --push ./app | |
$ BUILDX_BINARY_URL="https://github.com/docker/buildx/releases/download/v0.4.2/buildx-v0.4.2.linux-amd64" | |
$ curl --output docker-buildx \ | |
--silent --show-error --location --fail --retry 3 \ | |
"$BUILDX_BINARY_URL" | |
$ mkdir -p ~/.docker/cli-plugins |
$ cat <<EOF >> Dockerfile | |
FROM alpine | |
ARG TARGETPLATFORM | |
ARG TARGETOS | |
ARG TARGETARCH | |
ARG TARGETVARIANT | |
ARG BUILDPLATFORM | |
ARG BUILDOS | |
ARG BUILDARCH |
package main | |
import ( | |
"context" | |
"fmt" | |
"golang.org/x/oauth2" | |
"golang.org/x/oauth2/endpoints" | |
"log" | |
"net" | |
"net/http" |
package main | |
import ( | |
"context" | |
"fmt" | |
"github.com/google/go-github/v32/github" | |
) | |
func main() { | |
client := github.NewClient(nil) |
#!/usr/bin/env bash | |
set -e | |
# Get the distribution | |
mkdir istio | |
cd istio | |
curl -L https://istio.io/downloadIstio | sh - | |
cd istio-1.8.0 | |
# Create a namespace for Istio |