-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
156 additions
and
34 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
# shellcheck disable=SC1091 | ||
. /scripts/ocp.sh | ||
|
||
ocp_allow_router_on_control_plane(){ | ||
oc -n openshift-ingress-operator \ | ||
patch ingresscontroller default \ | ||
--type=merge --patch '{"spec":{"nodePlacement":{"tolerations":[{"key":"node-role.kubernetes.io/master","operator":"Exists","effect":"NoSchedule"}]}}}' | ||
} | ||
|
||
ocp_aws_cluster || exit 0 | ||
ocp_clean_install_pods | ||
ocp_scale_machineset 1 | ||
ocp_control_nodes_not_schedulable | ||
ocp_set_scheduler_profile HighNodeUtilization | ||
ocp_allow_router_on_control_plane |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
generateName: job-setup-cluster- | ||
name: job-setup-cluster | ||
# annotations: | ||
# argocd.argoproj.io/hook: Sync | ||
# argocd.argoproj.io/hook-delete-policy: HookSucceeded | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: job-setup-cluster | ||
# image: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest | ||
image: registry.redhat.io/openshift4/ose-cli | ||
command: | ||
- /bin/bash | ||
- -c | ||
- /scripts/job.sh | ||
volumeMounts: | ||
- name: scripts | ||
mountPath: /scripts | ||
volumes: | ||
- name: scripts | ||
configMap: | ||
name: job-setup-cluster | ||
defaultMode: 0755 | ||
restartPolicy: Never | ||
terminationGracePeriodSeconds: 30 | ||
serviceAccount: cluster-admin-minion | ||
serviceAccountName: cluster-admin-minion |
15 changes: 15 additions & 0 deletions
15
gitops/00-cluster-config/adhoc-ops/00-job/kustomization.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: kustomize.config.k8s.io/v1alpha1 | ||
kind: Component | ||
|
||
resources: | ||
- job.yaml | ||
|
||
generatorOptions: | ||
disableNameSuffixHash: true | ||
|
||
configMapGenerator: | ||
- name: job-setup-cluster | ||
files: | ||
# - functions.sh | ||
- job.sh | ||
- https://raw.githubusercontent.com/redhat-na-ssa/demo-ai-gitops-catalog/v0.05/scripts/library/ocp.sh |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# adhoc-ops | ||
|
||
## Purpose | ||
|
||
You ~~are lazy~~ want to avoid running imperative commands on the local command line to setup your cluster. | ||
|
||
This component has been tested using AWS based OpenShift instances provisioned by [demo.redhat.com](https://demo.redhat.com). | ||
|
||
NOTE: The creates a service account with `cluster-admin` - DO NOT DO THIS IN PRODUCTION! Setup specific roles for a task | ||
|
||
## Usage | ||
|
||
```yaml | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
resources: | ||
- base | ||
|
||
components: | ||
- 00-job | ||
- 01-job | ||
``` |
11 changes: 11 additions & 0 deletions
11
gitops/00-cluster-config/adhoc-ops/base/kustomization.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
namespace: adhoc-ops | ||
|
||
resources: | ||
- namespace.yaml | ||
- rbac.yaml | ||
|
||
components: | ||
- setup-job |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: adhoc-ops | ||
annotations: | ||
openshift.io/display-name: "Adhoc Ops" | ||
openshift.io/description: | | ||
I Make This Look Easy |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: cluster-admin-minion | ||
namespace: adhoc-ops | ||
annotations: | ||
NOT-FOR-PRODUCTION: EVER | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: cluster-admin-minion | ||
annotations: | ||
NOT-FOR-PRODUCTION: EVER | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: cluster-admin | ||
subjects: | ||
- kind: ServiceAccount | ||
name: cluster-admin-minion | ||
namespace: adhoc-ops |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
namespace: adhoc-ops | ||
|
||
resources: | ||
- base | ||
|
||
components: | ||
- 00-job |
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
2 changes: 1 addition & 1 deletion
2
gitops/02-components/link-github.yaml → gitops/00-cluster-config/link-github.yaml
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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
namespace: ml-demo | ||
|
||
resources: | ||
- ../user-components | ||
- namespace.yaml | ||
- ns-rb-view.yaml |
File renamed without changes.
File renamed without changes.
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
5 changes: 0 additions & 5 deletions
5
gitops/02-components/kustomization.yaml → gitops/user-components/kustomization.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,9 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
namespace: ml-demo | ||
|
||
resources: | ||
- ../../components/custom-image | ||
- ../../components/label-studio | ||
- ../../components/minio | ||
- ../../components/yolo-api/base | ||
- ../../components/pipelines | ||
- link-github.yaml | ||
- namespace.yaml | ||
- ns-rb-view.yaml |
This file was deleted.
Oops, something went wrong.
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