---
# System prepended metadata

title: '**On-Prem Airgapped Install**'

---

# **On-Prem Airgapped Install**

1. Download the Miller Bundle and the Kib (File Embedded is corrupt)

2. Unpack the airgapped download 


2. Setup the Inventory File 
```
    all:
      hosts:
        10.x.x.x
    vars: 
      ansible_user: centos
      ansible_ssh_private_key_file: ~/.ssh/id_rsa`
```
3. Look at the overrides file /overrides-bundles.yaml
    - Make sure that your file locations correlate to where those files are stored in the bundle
    - Ensure your username is correct

4. Put the KIB into the right folder in the bundle
```
cp konvoy_image_bundle_v2.1.1_linux_amd64.tar.gz dkp-v2.1.1/kib/bundles/images 
```
5. Provision the Bootstrap Cluster
``` 
./konvoy-image-provision --overrides overrides-bundle.yaml --inventory-file inventory.yaml 
```
6. Create the Pre-provisioned Inventory Yaml, dkp-v2.1.1/cluster-airgapped.yaml 
```
cd ../
vi cluster-airgapped.yaml
```

7. Create a secret for your cluster
```
kubectl create secret generic $CLUSTER_NAME-ssh-key --from-file=ssh-privatekey=<path-to-ssh-private-key>
kubectl label secret $CLUSTER_NAME-ssh-key clusterctl.cluster.x-k8s.io/move=
```

8. Label the Secret
``` 
kubectl label secret airgapped-ssh-key clusterct.cluster.x-k8s.io/move=
```
9. Grab the Control Plane Endpoint from the cluster.yaml


10. Apply the Cluster Configuration
```
kubectl apply -f airgapped.yaml
```
11. Create your cluster 
```
./dkp create cluster preprovisioned --cluster-name airgapped -- control-plane-endpoint-host 10.x.x.x --virtual-ip-interface eth0
```
12. Watch the cluster deploy 
```
 watch ./dkp describe cluster -c airgapped 
```
13. Troubleshooting a cluster.. look at CAPI Logs first
```
kubectl logs -n capa-system <capi pod name> manager
```
15. To delete a cluster 
```
./dkp delete cluster -c airgapped --delete-kubernetes-resources=false
```

17. Make the cluster Self Managed - Get your kubeconfig 
```
./dkp get kubeconfig -c airgapped > airgapped.conf
```

18. Get your cluster pods for your base cluster
```
kubectl --kubeconfig airgapped.conf get pods -A
```
19. Create the boostrap controllers 
```
./dkp create boostrap controllers --kubeconfig airgapped.conf
./kubectl get pods -A --kubeconfig airgapped.conf
```

20. Move the controllers from the bootstrap to the base cluster
```
./dkp move --to-kubeconfig ${CLUSTER_NAME}.conf
```
Note: Ignore any references to AWS credential problems. We deploy all of the controllers by default. 

21. Check out your cluster's self -managed state 
```
./dkp describe cluster -c airgapped --kubeconfig airgapped.conf
```
22. Troubleshoot " WaitinforClusterInfrastructure" Problem
```
kubectl --kubeconfig airgapped.conf get machinedeployment -A

kubectl get preprovisionedmachinetemplates —kubeconfig aitgapped.conf

kubectl describe preprovisionedmachiedtemplates airgapped-control-plane --kubeconfig airgapped.conf

kubectl describe preprovisionedinventory airgapped-control-plane --kubeconfig airgapped.conf

kubectl describe preprovisionedinventory airgapped-md-0 --kubeconfig airgapped.conf

```
Looks like it was missing a label in the md-0 
```
kubectl label preprovisionedinventory airgapped-md-0 --kubeconfig airgapped.conf cluster.x-k8s.io/cluster-nammed=airgapped 
```
22. Make edits to the setup script, if needed (add in registry ip)
```
cd konvoy_v2.1.1
vi setup.sh
```
23. Run the setup script to pull images from local repo
```
./setup
```
24. Initalize Kommander
```
./kommander install --init > kommander.yaml
```
25. Override the default versions for the Kommander Addons
```
vi values.yaml
```
- Kommander Addon Values
```
// Diff
   kommander: null
---
  kommander:
    values: |
      authorizedlister:
        image:
          tag: v2.1.1-rc.4-amd64
      controller:
        containers:
          manager:
            image:
              tag: v2.1.1-rc.4-amd64
      webhook:
        image:
          tag: v2.1.1-rc.4-amd64
      fluxOperator:
        containers:
          manager:
            image:
              tag: v2.1.1-rc.4-amd64
      kommander-licensing:
        controller:
          containers:
            manager:
              image:
                tag: v2.1.1-rc.4-amd64
        webhook:
          image:
            tag: v2.1.1-rc.4-amd64
      kubetools:
        image:
          tag: v2.1.1-rc.4-amd64
```
- Traefik Addon Values
```
// Diff
   traefik: null
---
  traefik:
    values: |
      service:
        annotations:
          service.beta.kubernetes.io/aws-load-balancer-internal: "true"
```
- Update the app management image tag values
```
// Diff
appManagementImageTag: v2.1.1-rc.4
---
appManagementImageTag: v2.1.1-rc.4-amd64
airgapped:
  enabled: true
  helmMirrorImageTag: v2.1.1-rc.4-amd64
```
- Update all the values that require use of internal load balancers such as; Istio

26. Install the D2iQ addons
```
./kommander --kubeconfig airgapped.conf install --kommander-applications-repository kommander-applications-2.1.1 --installer-config values.yaml
```
26. Update MetalLB Values 
```
vi cluster-airgapped.yaml
/appManagementImageTag 

appManagementImageTag v2.1.1-rc.4-amd64
airgapped:
  enabled: true
  helmMirrorImageTag: v2.1.1-rc.4-amd64
  
/minio-operator
on the line below
metallb:
  values: |
    configinline: 
      address-pools
      - name: default
        protocol: layer2
        addresses: 
        - 10.x.x.x-10.x.x.x
 ``` 
27. Wait for the applications to become ready 
```
kubectl --kubeconfig airgapped.conf -n kommander wait --for condition=Released helmreleases --all --timeout 15m
```
28. Go back and add in the registry mirror
```
./dkp create cluster preprovisioned | 
--with-aws-bootstrap-credentials false
--cluster-name airgapped
--control-plane-endpoint-host 10.x.x.x
--control-plane-port 6443
--registry-mirror-url 10.x.x.x
--virtual-ip-interface eth0
--dry-run -kubeconfig airgapped.conf -o yaml >test_registry.yaml

```
29. Rebuild Cluster to properly populate the registry configuration

30. Checkout the cluster 

```
kubectl get hr -A --kubeconfig airgapped.conf
kubectl describe hr -n kommander kommander-appmanagement --kubeconfig airgapped.conf
```


31. 