| Policy | Goal | Trade-offs | Reference |
|---|---|---|---|
| 1. ApplicationSet syncPolicy | Control creation, update, and deletion of generated Applications | + Fine-grained lifecycle control; prevents costly deletions. – Overrides may not be enabled; risk of misconfiguration. |
Docs: ApplicationSet spec |
| 2. ApplicationSet preserveResourcesOnDeletion | Prevent cascading deletion of Application-managed resources | + Avoids mass resource deletion when Applications are removed.– May leave orphaned resources requiring manual cleanup. | [Docs: ApplicationSet spec](https://argo-cd.readthedocs.i |
This file contains hidden or 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
| # parse input | |
| #include <sstream> | |
| #include <vector> | |
| #include <iostream> | |
| using namespace std; | |
| vector<int> parseInts(string str) { | |
| vector<int> *result = new vector<int>(); | |
| stringstream ss(str); |
This file contains hidden or 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
| #!/bin/python3 | |
| import math | |
| import os | |
| import random | |
| import re | |
| import sys | |
| # |
This file contains hidden or 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 Prompt | |
| > Write the step-by-step instructions for the following problem, grouping the information in sections titled "Overview," "Prerequisites," "Steps," "Validation," "Troubleshooting," and "References." | |
| > | |
| > I want the result in markdown format that I can use on a README.md file. | |
| > | |
| > On each step, add a "Command reference" link to the original documentation page describing the commands. | |
| > | |
| > Here is the problem: | |
| > |
kubenstein:
You are a Kubernetes administrator asked to validate whether a cluster is running properly.
I am logged in to the cluster as a system administrator and can invoke the "kubectl" command-line interface from a terminal.
It is extremely important that you give me a single command at a time and wait for me to execute the command and give you the output.
Whenever you give me a command, observe the rules in this list named "prompt-rules":
This file contains hidden or 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
| #!/bin/sh | |
| infra_id=$(kubectl get Infrastructure cluster -o jsonpath='{.status.infrastructureName}') | |
| instance_size=${1:-c5a.xlarge} | |
| kubectl get MachineSet \ | |
| -n openshift-machine-api \ | |
| -l hive.openshift.io/machine-pool=worker \ | |
| -l hive.openshift.io/managed=true \ | |
| -o yaml \ |
This file contains hidden or 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
| # All containers, probes, restarts, duration of startup, and an assessment of probe settings relative to the startup time: | |
| cat<<EOF > podlist.gotemplate | |
| {{- range .items -}}{{\$pod := .}} | |
| {{- .metadata.name -}}{{- "," -}} | |
| {{- .metadata.namespace -}}{{- "," -}} | |
| {{- range .status.conditions -}} | |
| {{- if eq .type "PodScheduled" -}} | |
| {{- .lastTransitionTime -}} | |
| {{- end -}} |
This file contains hidden or 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
| function delete_namespace() { | |
| local namespace=${1} | |
| kubectl get namespace ${namespace} -o jsonpath={.status.conditions} \ | |
| | jq '.[] | select(.type=="NamespaceContentRemaining" and .reason=="SomeResourcesRemain") .message' \ | |
| | sed "s| |\\n|g" | grep "\." \ | |
| | xargs -Iresource oc get resource -n ${namespace} -o name \ | |
| | xargs -I r2 oc patch r2 -n ${namespace} --type=merge --patch '{"metadata":{"finalizers":[]}}' | |
| } | |
| delete_namespace ${1} |
This file contains hidden or 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
| # | |
| # Updates the target branch for all ArgoCD applications on a namespace | |
| # | |
| # arg1 name of the new gitops branch | |
| # arg2 namespace for the ArgoCD applications to be patched | |
| # | |
| function set_argo_branch() { | |
| local new_branch=${1} | |
| local namespace=${2:-openshift-gitops} | |
This file contains hidden or 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
| ### (Optional) Create local DB2 instance | |
| #### Create local network | |
| ``` | |
| docker network create workshop_nw | |
| ``` | |
| #### Create DB2 database (local docker container) |
NewerOlder