CRC AAP Demo Configuration
Clone the aap-demo repository and safely configure it for deployment on an
existing OpenShift Local (CRC) cluster — without disrupting CRC’s preset,
resource allocations, or other settings.
Rules
Do NOT fabricate or invent command output, status, or results. Every report MUST come from actual script or command execution.
This skill requires no semantic judgment — all steps are mechanical repository cloning and configuration with deterministic outcomes.
Workflow
Step 1 — Run the setup script
The agent MUST run:
bash ~/.agents/skills/crc-aap-demo-config/scripts/setup.sh
Use --check to verify without changes. Use --target DIR for custom location.
Step 2 — Follow the detailed Steps below
The agent MUST follow the Steps section for environment-specific configuration (.env, pull secret, resource sizing).
Output Contract
- Exit 0 → setup completed successfully
- Exit 1 → prerequisite missing or setup failed
Why This Skill Exists
aap-demo was designed for MicroShift and makes assumptions that are
dangerous on an existing OpenShift CRC:
| Risk | What aap-demo does | Impact |
|---|---|---|
| Preset override | If CRC preset is openshift, defaults to microshift and runs crc config set preset microshift |
Destroys your OpenShift VM on next crc start |
| Resource downgrade | Sets CPUs=8, memory=16384, disk=100 via crc config set |
Downgrades your VM resources on next crc start |
| CoreDNS modification | Patches dns-default ConfigMap in openshift-dns |
Mostly harmless but unexpected |
| Ingress CA trust | Adds cluster CA to host trust store via sudo update-ca-trust |
Requires sudo, modifies host PKI |
This skill detects these conflicts and applies protective configuration
before any aap-demo command is run.
Prerequisites
- OpenShift Local (CRC) installed and configured
- CRC cluster running or stopped (must exist —
crc statusreturns a known state) gitinstalled- Internet access (to clone the repo)
Steps
Part 1 — Clone the Repository
-
Choose a target directory for the clone (e.g.,
~/app/playground/aap-demoor any preferred location). -
Clone the repo:
git clone https://github.com/RedHatOfficial/aap-demo.git <target-dir> cd <target-dir>If the directory already exists and contains the repo, skip the clone:
git -C <target-dir> remote get-url origin 2>/dev/null | grep -q 'aap-demo' && echo 'Already cloned'
Part 2 — Pre-Flight Checks
- Check CRC exists and get current state:
crc status --output json 2>/dev/nullExtract
crcStatus(Running, Stopped, Unknown) andpresetfrom the JSON. IfcrcStatusisUnknown, CRC has no VM — warn the user thataap-demo createwill create a new one (this is safe). - Capture current CRC resource configuration:
crc config viewRecord the values of:
cpus,memory,disk-size,preset,enable-cluster-monitoring,host-network-access,kubeadmin-password,pull-secret-file. -
Compare with aap-demo defaults:
Setting aap-demo default Source Preset microshiftincludes/crc-create.shline 175CPUs 8includes/crc-create.shline 199Memory 16384(16 GB)includes/crc-create.shline 200Disk 100GBincludes/crc-create.shline 201PV Size 50GBincludes/crc-create.shline 202Report conflicts — any case where the aap-demo default would downgrade or change a current CRC setting:
⚠️ CONFLICTS DETECTED: | Setting | Current CRC | aap-demo default | Action | |---------|-------------|-----------------|--------| | preset | openshift | microshift | PROTECT — would destroy VM | | cpus | 40 | 8 | PROTECT — would downgrade | | memory | 49152 | 16384 | PROTECT — would downgrade | | disk | 240 | 100 | PROTECT — would downgrade |If no conflicts are found (e.g., CRC doesn’t exist yet), report that and skip Part 3.
- Check CLI dependencies:
command -v kubectl && echo '✅ kubectl' || echo '❌ kubectl' command -v ansible-playbook && echo '✅ ansible' || echo '❌ ansible' command -v jq && echo '✅ jq' || echo '❌ jq' command -v python3 && echo '✅ python3' || echo '❌ python3' command -v helm && echo '✅ helm' || echo '❌ helm'Report missing dependencies.
install.shwill auto-installkubectl,ansible,jq, andpython3but the user should be informed. - Check pull secret availability:
Look for a pull secret in these locations (in order):
~/.aap-demo/pull-secret.txt ~/.aap-demo/pull-secret.json ~/Downloads/pull-secret.txt ~/Downloads/pull-secret*.txtIf the CRC cluster is running, also compare file credentials against the cluster’s pull secret to find the matching file:
oc get secret pull-secret -n openshift-config \ -o jsonpath='{.data.\.dockerconfigjson}' | base64 -d > /tmp/crc-pull-secret.jsonCompare each candidate file’s
authsagainst the cluster’s auths to identify which file matches.
Part 3 — Apply Protective Configuration
-
Create
~/.aap-demo/configwith protective values.Read the current CRC settings and write them to the config file so
aap-demo.sh’s config loader (line 58-66) sets them beforecrc-create.shapplies defaults. The config loader only sets variables that are not already in the environment:if [ -z "${!key+x}" ]; then export "$key=$value" fiGenerate the config:
mkdir -p ~/.aap-demo cat > ~/.aap-demo/config << EOF CRC_PRESET=$(crc config get preset 2>/dev/null | awk '{print $NF}') CRC_CPUS=$(crc config get cpus 2>/dev/null | awk '{print $NF}') CRC_MEMORY=$(crc config get memory 2>/dev/null | awk '{print $NF}') CRC_DISK=$(crc config get disk-size 2>/dev/null | awk '{print $NF}') CRC_PV_SIZE=50 EOFIf
~/.aap-demo/configalready exists, merge — only add keys that are missing, never overwrite existing values. -
Copy the pull secret (if not already in place):
cp <matching-pull-secret-file> ~/.aap-demo/pull-secret.txtSkip if
~/.aap-demo/pull-secret.txtalready exists.
Part 4 — Install the CLI
- Run the installer:
cd <target-dir> ./install.shThis creates a symlink at
~/.local/bin/aap-demo→<target-dir>/aap-demo.shand installs shell completions. It does not touch CRC. - Verify the CLI is accessible:
aap-demo helpIf
~/.local/binis not in$PATH, inform the user to add it.
How the Protection Works
The protection relies on how aap-demo.sh loads its config (lines 58-66):
if [ -f "$AAP_DEMO_CONFIG" ]; then
while IFS='=' read -r key value; do
if [ -z "${!key+x}" ]; then # only set if NOT already set
export "$key=$value"
fi
done < "$AAP_DEMO_CONFIG"
fi
Then includes/crc-create.sh uses ${CRC_CPUS:-8} syntax — if the variable
is already set (from the config file), the default is ignored.
For the preset, the protection works because line 168 checks the config file
for CRC_PRESET=. If found, it skips the hardcoded microshift default.
Call Chain to the Dangerous Code
aap-demo deploy (or create, redeploy-all)
→ cmd_deploy() aap-demo.sh:1929
→ cmd_create() aap-demo.sh:1905 (if no cluster exists)
→ bash crc-create.sh includes/crc-create.sh
→ line 165: preset override check ⚠️
→ line 219: crc config set cpus ⚠️
→ line 220: crc config set memory ⚠️
→ line 221: crc config set disk ⚠️
Safe vs Dangerous Entry Points
| Command | Calls crc-create.sh? | Risk |
|---|---|---|
aap-demo deploy (CRC running) |
❌ | Safe — skips create |
aap-demo deploy (CRC stopped) |
❌ | Safe — calls _start_crc_cluster only |
aap-demo deploy (no CRC) |
✅ | ⚠️ Triggers cmd_create |
aap-demo create (CRC running) |
✅ but exits | Safe — exits at line 153 |
aap-demo create (CRC stopped) |
✅ | ⚠️ Proceeds past running check |
aap-demo create (no CRC) |
✅ | ⚠️ Full create flow |
aap-demo start |
❌ | Safe — sources for CoreDNS only |
aap-demo redeploy-all |
✅ | 🔴 Destroys then creates |
Verification
- Repo cloned and accessible
~/.aap-demo/configexists withCRC_PRESET,CRC_CPUS,CRC_MEMORY,CRC_DISKmatching current CRC values~/.aap-demo/pull-secret.txtexists and matches CRC cluster credentialsaap-demo helpworks (CLI installed)crc config viewunchanged from pre-flight values
Post-Configuration
After this skill completes, the user can safely run:
aap-demo deploy # Deploy AAP to existing CRC
aap-demo status # Check deployment status
aap-demo diagnose # Health check
For the full aap-demo workflow and troubleshooting, refer to the
.claude/skills/aap-demo/SKILL.md skill in the aap-demo repository.
Changelog
See CHANGELOG.md for version history.