Skip to content

Commit

Permalink
update: scripts / docs (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
codekow authored Oct 18, 2023
1 parent 507c6ba commit 86f6ef1
Show file tree
Hide file tree
Showing 35 changed files with 22 additions and 419 deletions.
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ The intention of this repository is to help support practical use of OpenShift f

- OpenShift 4.8+

Red Hat Demo Platform Options
Red Hat Demo Platform Options (Tested)

- `AWS with OpenShift Open Environment` - control plane size is `m5.4xlarge`
- `MLOps Demo: Data Science & Edge Practice`
- `Red Hat OpenShift Container Platform 4 Demo`

Expand All @@ -38,7 +39,7 @@ oc whoami
git clone <repo>
```

### Cluster Quick Start
### Cluster Quick Start for OpenShift GitOps

Execute the following script:

Expand All @@ -50,12 +51,13 @@ The `bootstrap.sh` script will:

- Install the [OpenShift GitOps Operator](components/operators/openshift-gitops-operator)
- Create an [ArgoCD instance](components/operators/openshift-gitops-operator/instance/base/openshift-gitops-cr.yaml) in the `openshift-gitops` namespace
<!-- - Bootstrap a set of ArgoCD applications to configure the cluster -->

You can run individual [functions](scripts/functions.sh) in a `bash` shell:
Many common operational tasks are provided in the [scripts library](scripts/library/). You can run individual [functions](scripts/functions.sh) in a `bash` shell:

```sh
source scripts/functions.sh

get_functions
```

<!-- ### Sealed Secrets Bootstrap
Expand Down Expand Up @@ -88,10 +90,7 @@ scripts/lint.sh

## Additional Info

- [Repo Docs](docs) - not everything fits in your head
- [Using this repo effectively](docs/APPS.md)
- [Fix GitHub Oauth](docs/LOGIN.md)
- [ArgoCD - Repo Specific](docs/ARGOCD.md)
- [Misc Docs](docs) - not everything fits in your head

## External Links

Expand Down
14 changes: 12 additions & 2 deletions scripts/library/ocp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,26 @@ ocp_control_nodes_schedulable(){
oc patch schedulers.config.openshift.io/cluster --type merge --patch '{"spec":{"mastersSchedulable": true}}'
}

ocp_set_scheduler_profile(){
SCHED_PROFILE=${1:-LowNodeUtilization}

# LowNodeUtilization, HighNodeUtilization, NoScoring
echo "see https://docs.openshift.com/container-platform/4.11/nodes/scheduling/nodes-scheduler-profiles.html"

oc patch schedulers.config.openshift.io/cluster --type merge --patch '{"spec":{"profile": "'"${SCHED_PROFILE}"'"}}'
}

# save money in aws
ocp_save_money(){

# run work on masters
ocp_control_nodes_schedulable

# scale to zero
ocp_scale_machineset 0

# https://docs.openshift.com/container-platform/4.11/nodes/scheduling/nodes-scheduler-profiles.html
oc patch schedulers.config.openshift.io/cluster --type merge --patch '{"spec":{"profile": "HighNodeUtilization"}}'
# place as many pods on as few nodes as possible
ocp_set_scheduler_profile HighNodeUtilization
}

ocp_expose_image_registry(){
Expand Down
3 changes: 2 additions & 1 deletion scripts/library/rhdp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ rhdp_fix_api_certs(){

CERT_NAME=$(oc -n openshift-ingress-operator get ingresscontrollers default --template='{{.spec.defaultCertificate.name}}')
# API_HOST_NAME=$(oc -n openshift-console extract cm/console-config --to=- | sed -n '/masterPublicURL/ s/.*:\/\///; s/:6443//p')
API_HOST_NAME=$(oc whoami --show-server | sed 's@https://@@; s@:.*@@')
# API_HOST_NAME=$(oc whoami --show-server | sed 's@https://@@; s@:.*@@')
API_HOST_NAME=api.$(oc -n openshift-ingress-operator get dns cluster --template='{{.spec.baseDomain}}')

oc -n openshift-ingress get secret "${CERT_NAME}" -o yaml | \
sed 's/namespace: .*/namespace: openshift-config/' | \
Expand Down
2 changes: 1 addition & 1 deletion scripts/library/unsorted.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ until_true(){
echo "[OK]"
}

local_argocd(){
fake_argocd(){
if [ ! -f "${1}/kustomization.yaml" ]; then
echo "Please provide a dir with \"kustomization.yaml\""
return
Expand Down
3 changes: 0 additions & 3 deletions tenants/README.md

This file was deleted.

2 changes: 0 additions & 2 deletions tenants/codekow/argocd/apps/base/kustomization.yaml

This file was deleted.

66 changes: 0 additions & 66 deletions tenants/codekow/argocd/apps/overlays/default/appset-main.yaml

This file was deleted.

This file was deleted.

7 changes: 0 additions & 7 deletions tenants/codekow/argocd/projects/base/kustomization.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions tenants/codekow/argocd/projects/base/tenant-project.yaml

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions tenants/codekow/components/configs/simple/README.md

This file was deleted.

Loading

0 comments on commit 86f6ef1

Please sign in to comment.