The goal of this PoC is to enable Insights Operator on a disconnected cluster.
flowchart LR
subgraph Managed Cluster
IO[Insights Operator]
end
subgraph Hub Cluster| .env |
Get all the Helm resources that are deployed in the cluster
echo "KIND,NAME,NAMESPACE,HELM_RELEASE" > resources.csv
source main.sh
namespaces=("ccx-prod" "ccx-qa" "ccx-supplementary"); for ns in "${namespaces[@]}";
get_resources "$ns" | awk '{$1=$1; OFS=",";} 1' |
grep -v -E 'Pod|Job|ReplicationController|ReplicaSet' | awk -F, '$1 != "Build"' >> resources.csvI'm using zsh's git plugin for the alias like gp.
master/main (default) branch for the repo and pull the latest changes.DEFAULT_BRANCH=$(git remote show origin | grep "HEAD branch" | sed 's/.*: //') && \
git checkout "$DEFAULT_BRANCH" && \
git pull origin "$DEFAULT_BRANCH"| #/bin/bash | |
| namespaces=$(oc get projects -o template --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}') | |
| echo "Namespace,Name,Type,Limits CPU,Limits Memory,PersistentVolumeClaims,Pods,Requests Storage" | |
| for namespace in $namespaces | |
| do | |
| for type in "hard" "used" | |
| do |
| *.dat |
In order to quickly check the status of your Merge Request, you can run these two commands.
Note that a MR needs to be reviewed before entering the merge queue. That's why checking both is sometimes needed.
Install glow or use your favourite markdown renderer.
❯ git clone [email protected]:RedHatInsights/ccx-notification-writer.git
❯ cd ccx-notification-writer
❯ make build
❯ ./ccx-notification-writer db-init
❯ cd ..
❯ export PGPASSWORD=postgres
❯ psql --username=postgres --host=localhost --port=5432 --dbname notification -f init.sql; done
| version: "3" | |
| services: | |
| # Auxiliar services the external data pipeline needs | |
| db: | |
| ports: | |
| - 5432:5432 | |
| image: registry.redhat.io/rhscl/postgresql-13-rhel7 | |
| environment: | |
| - POSTGRESQL_USER=user | |
| - POSTGRESQL_PASSWORD=password |