Parse the kubernetes manifest in yaml or json, don't care a manifest type.
Examples:
package main
import (
"bytes"
"context"
#!/bin/sh | |
run(){ | |
name="$1" | |
shift | |
( | |
set -x | |
# defailt parameters | |
fio -name="$name" -filename=$disk -output-format=json -ioengine=libaio -direct=1 -randrepeat=0 "$@" > results/$disk_dashed-$name.json | |
) |
local p = import '../../params.libsonnet'; | |
local params = p.components.victoriametrics; | |
local k = import '1.21/main.libsonnet'; | |
local vm = importstr 'data://victoriametrics/github.com/VictoriaMetrics/helm-charts/raw/347d4558d9c25cd341718bf5a2ee167da042c080/packages/victoria-metrics-cluster-0.9.6.tgz'; | |
{ | |
local ns = k.core.v1.namespace, | |
namespace:: |
#!/bin/bash | |
set -e | |
IMAGE_URL=https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img | |
IMAGE_FILE=$(basename $IMAGE_URL) | |
if [ ! -e $IMAGE_FILE ]; then | |
wget $IMAGE_URL | |
fi |
Parse the kubernetes manifest in yaml or json, don't care a manifest type.
Examples:
package main
import (
"bytes"
"context"
#!/bin/bash | |
# Simple conversion script of ISO 9660 image into image based | |
# on ext2/3/4 filesytem. Completely unprivileged, without needing | |
# to mount both images. Free to use under Apache 2.0 License. | |
# 2020, Vlastimil Holer <vlastimil.holer@gmail.com> | |
set -e -o pipefail | |
TYPE=${TYPE:-ext2} |
// +build darwin linux | |
package main | |
import ( | |
"os" | |
"syscall" | |
"unsafe" | |
) |
Change apiVersion
from:
- apiVersion: v1
(or apiVersion: apps.openshift.io/v1
)
to:
- name: Load kube-apiserver.yaml | |
slurp: | |
src: "{{tmpconfdir.path}}/etc/kubernetes/manifests/kube-apiserver.yaml" | |
register: "apiserver_yaml" | |
# Implement https://github.com/kubernetes/kubeadm/issues/1105#issuecomment-544887733 | |
- name: Patch apiserver healthcheck | |
vars: | |
mixin: | | |
{spec+: {containers: [super.containers[0] + { |
module Oned = | |
autoload xfm | |
(* primitives *) | |
let sep = del /[ \t]*=[ \t]*/ " = " | |
let eol = del /\n/ "\n" | |
let opt_space = del /[ \t]*/ "" | |
let opt_space_nl = del /[ \t\n]*/ "\n" | |
let comma = del /,/ "," | |
let left_br = del /\[/ "[" |
# get api token with proper perms, ensure full "repos" for private repo access. | |
$ export auth="Authorization: token 123345465hfghfghfghgfhgfhfg" | |
$ export org="your_org" | |
# get the last page in the Link header. github API limits per_page to 100. Anything over this will require pagination. | |
$ curl -I -H "$auth" https://api.github.com/orgs/$org/repos | |
# go over all pages. Put this in a script, and save it. | |
#!/bin/bash |