new-operator/
├── bindata ➊
│ └── new-operand/
│ └── resource.yaml
├── manifests/ ➋
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
operator=kube-apiserver-operator | |
org=sanchezl | |
repository=${org}/origin-cluster-${operator} | |
tag=$(date --utc +%Y%m%d_%H%M%SZ) | |
echo "Building ${repository} image..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
cluster_name=$1 | |
hosted_zone_dns_name=$2 | |
hosted_zone_id=$( | |
aws route53 list-hosted-zones-by-name \ | |
--dns-name ${hosted_zone_dns_name} \ | |
--query HostedZones[0].Id \ | |
--output text |
Not directly imported by the module code. Either imported by another dependency,
or added manually with go get
(in which case would disappear after go tidy
if never used).
The dependecy has a semver tag (vM.m.p
), but the package name does not end with /vM
, implying
that it is not really a go module.
Scripts to use as inspiration for your own OpenShift clusters.
- Create a directory with the name of the cluster you want to create.
- Generate an
install-config.yaml
(for example, using openshift-install create install-configs). - Copy your
install-config.yaml
toinstall-config.yaml.save
. This ensures you still have a copy after the installer deletesinstall-config.yaml
. Add abin/
subdirectory and add it to the begining of your PATH. I recommend you use [direnv
][1] to manage this (sudo dnf install direnv
).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
for arg in "$@"; do | |
shift | |
case "$arg" in | |
--version) echo 1.2.1 ; exit ;; | |
--allow-pull) ;; | |
*) set -- "$@" "$arg" ;; | |
esac | |
done | |
buildah bud "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This jq filter takes as input a List of APIRequestCounts and outputs | |
# json objects with the following properties: | |
# - namespace: the namespace of the request | |
# - api: the api that the request invoked | |
# - requestCount: how many request were made in the current hour | |
# WARNING: There is no actual namespace information in the APIRequestCount. | |
# The namespace outputted by this filter is derived from the username | |
# that ServiceAccounts present as in the requests, which are of the | |
# form: system:serviceaccount:<namespace>:<sa-name>. | |
# This tool will not report any non-service account usage. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
prometheus_host="$1" | |
token="$2" | |
prometheus_rules_url="https://${prometheus_host}/api/v1/rules" | |
curl --silent --insecure --header "Authorization: Bearer ${token}" "$prometheus_rules_url" \ | |
| jq -r '.data.groups[]|.rules[]|select(.name==("APIRemovedInNextReleaseInUse","APIRemovedInNextEUSReleaseInUse"))|.alerts[]|[.labels.alertname,.state,(.labels|.resource+"."+.version+"."+.group)]|@tsv' \ | |
| sort \ | |
| column -t -N ALERT,STATUS,API\ | |
| sed \ | |
-e "1!s/^\S*/$(tput setaf 6)\0$(tput sgr0)/" \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
openshiftMasterRef="openshift/master" | |
kubernetesRef="v1.25.0" | |
mergeBase=$(git merge-base ${openshiftMasterRef} ${kubernetesRef}) | |
# Generates a list (tab separated values) of the OpenShift commits | |
# that will need to be rebased onto the target kubernetes version. | |
# | |
# Assumes the following steps have already been executed in your |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reduce (inputs | select(.annotations|has("authentication.k8s.io/legacy-token"))) as $e ({}; | |
$e.annotations."authentication.k8s.io/legacy-token" as $sa | |
| $e.userAgent as $workload | |
| ( $e.requestURI | split("?")[0] | if ($e.verb == "get" or $e.verb == "update") then (split("/")[:-1]|join("/")) else . end) as $path | |
| .[$sa][$workload][$path].count +=1 | |
| .[$sa][$workload][$path].verbs |= ((. + [$e.verb])|unique) | |
| .[$sa][$workload][$path].names |= ((. + [$e.objectRef.name // empty])|unique) | |
| .[$sa][$workload][$path].names |= if . | length == 0 then empty else . end | |
) |