Tommy Scherer
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Airgapped FIPS 2.3.1 RHEL 8.4 on Vsphere ** ## vSphere Prerequisites * RHEL Subscription satalite or airgapped licencse for RHEL 8.4 https://access.redhat.com/solutions/3121571 * access to a RHEL repo or ability to copy packages to the airgappped machines (packages needed bzip2 yum utils on the template) * Docker 18.04 or greater on the bastion bootstrap host (need packages docker-ce docker-ce-cli containerd.io wget) ## Bastion Node Creation (vSphere VM) **1. Download RHEL-8.4 boot ISO to local host** ``` https://developers.redhat.com/content-gateway/file/rhel-8.4-x86_64-boot.iso ``` You will need to authenticate with your Red Hat Developer credentials. Make sure to keep them handy as you will need them later. **2. Copy the ISO to a datastore that is acessible by all ESX nodes in the cluster** **3. Create a "New Virtual Machine":** from the Vsphere web UI right click on cluster you plan to use for DKP and select Create a "New Virtual Machine" * Name: rhel-boot-8.4 * Select the "Datacenter" you want to deploy DKP on * Select the "vCenter Cluster" you want to deploy DKP on * Select the "Datastore" you plan to use for DKP * select "ESXI 6.7 and later" compatibility * select "OS family" Linux * select "OS Version" Red Hat Enterprise Linux 8 (64-bit) * Hardware Configuration * CPU 2 * Memory 8GB * New Hard disk 20GB * New CD/DVD Drive Datastore ISO file * Select Rhel-8.4-x86_64-boot.iso * select the Connect the CD/DVD Drive box **4. Once the OS boots open a virtual console and configure the following items:** * Manual Drive partioning * delete swap and add free space to / * Enable the network interface * Set the time zone * Add the RHEL subscription * select minimal install without any additional packages * Start the install * Create a new admin user "admin" password "admin" ** The user name can be anything you want admin/admin is the exmple * allow install to finish then reboot * allow passwordless sudo for wheel group * sudo vi /etc/sudoers * uncomment # * %wheel ALL=(all) NOPASSWD:ALL * sudo yum install -y yum-utils bzip2 * fips-mode-setup --enable * reboot the system * fips-mode-setup --check * ensure that tar is install by checking yum install tar **5. Poweroff the vm and Take a snapshot** * right click on the base os vm * select snapshots * the take snapshot and name it root ## Create OVA Template for Cluster Nodes **6. Clone the Base-RHEL-OS to a VM** * Right click on base-rhel-os select clone to vm * select 4vcpus 8GB RAM and a 80GB vdisk * make sure to check and adjust MAC adress so there isn't conflict **7. Install Docker (Only on Bastion Host)** Add the repo for upstream docker... ``` sudo yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo ``` **8. Then install Docker and Kubectl** ``` sudo yum install -y docker-ce docker-ce-cli containerd.io tar -xvf /root/dkp/dkp-v2.3.1/artifacts/kubectl-1.23.12-0.x86_64.rpm rpm -ivh /root/dkp/dkp-v2.3.1/artifacts/kubectl-1.23.12-0.x86_64.rpm ``` **9. Create directory for DKP CLI** ``` mkdir /root/dkp ``` **11. Get the needed D2iQ Software** Download/Decompress the airgapped bundle... ``` cd /root/dkp wget http://downloads.d2iq.com/dkp/v2.3.1/dkp_airgapped_bundle_v2.3.1_linux_amd64.tar.gz tar -xvf dkp_airgapped_bundle_v2.3.1_linux_amd64.tar.gz ``` Deploy your offline Repo using Docker ``` //Start Registry docker run -d -p 5000:5000 --restart=always --name registry registry:2 //once locahost registry is created go to the DKp folder and run docker load -i registry_2.tar //push image bundle This will push and set up your offline registry with the containers for konvoy ./dkp push image-bundle --image-bundle konvoy_image_bundle_v2.3.1_linux_amd64.tar --to-registry-insecure-skip-tls-verify --to-registry 172.16.0.181:5000 ``` **12. Create a folder and resource pool in vCenter for DKP cluster** Folder Right click on the datacenter * select New Folder * select host and cluster folder * name folder "D2IQ" Resource Pool Right click on the vCenter cluster you plan to use for DKP * select New Resource Pool * Adjust values if you need to restrict resources for DKP **13. build template using konvoy image builder** ```` vi /root/dkp/dkp-v2.3.1/kib/images/ova/rhel-84.yaml ```` **14. Adjust the packer file for your Vsphere cluster** ```` --- download_images: true build_name: "vsphere-rhel-84" packer_builder_type: "vsphere" guestinfo_datasource_slug: "https://raw.githubusercontent.com/vmware/cloud-init-vmware-guestinfo" guestinfo_datasource_ref: "v1.4.0" guestinfo_datasource_script: "{{guestinfo_datasource_slug}}/{{guestinfo_datasource_ref}}/install.sh" packer: vcenter_server: "10.0.1.52" vsphere_username: "administrator@vsphere.local" vsphere_password: "Password" cluster: "cluster1" datacenter: "dc1" datastore: "vsanDatastore" folder: "d2iq" insecure_connection: "true" network: "VM Network" resource_pool: "D2IQ" template: "rhel-boot-8.4" vsphere_guest_os_type: "rhel8_64Guest" guest_os_type: "rhel8-64" # goss params distribution: "RHEL" distribution_version: "8.4" ```` **15. Create overides for offline bundle location** Navigate to the directorey with konvoy-image... ``` cd /root/dkp/root/dkp/dkp-v2.3.1/kib cp -r ../artifacts . ``` Ensure that the artificats folder is sitting inside the kib folder ...and create the overrides file (you can override the passwordless sudo user w/ the ssh_username and password) ``` vi /root/dkp/dkp-v2.3.1/kib/overrides-bundles.yaml os_packages_local_bundle_file: /root/dkp/dkp-v2.3.1/artifacts/1.23.12_redhat_8_x86_64_fips.tar.gz pip_packages_local_bundle_file: /root/dkp/dkp-v2.3.1/artifacts/pip-packages.tar.gz images_local_bundle_dir: /root/dkp/dkp-v2.3.1/artifacts/images containerd_local_bundle_file: /root/dkp/dkp-v2.3.1/artifacts/containerd-1.4.13-d2iq.1-rhel-8.4-x86_64_fips.tar.gz packer: ssh_username: "username you created" ssh_password: "password you created" ``` ``` vi /root/dkp/dkp-v2.3.1/kib/overrides/fips.yaml --- k8s_image_registry: docker.io/mesosphere fips: enabled: true configure: false build_name_extra: -fips kubernetes_build_metadata: fips.0 default_image_repo: hub.docker.io/mesosphere #kubernetes_rpm_repository_url: "https://packages.d2iq.com/konvoy/stable/linux/repos/el/kubernetes-v{{ kubernetes_version }}-fips/x86_64" #docker_rpm_repository_url: "\ # https://containerd-fips.s3.us-east-2.amazonaws.com\ # /{{ ansible_distribution_major_version|int }}\ # /x86_64" ``` ``` vi /root/dkp/dkp-v2.3.1/kib/overrides/offline-fips.yaml # fips os-packages os_packages_local_bundle_file: "{{ playbook_dir }}/../artifacts/{{ kubernetes_version }}_{{ ansible_distribution|lower }}_{{ ansible_distribution_major_version }}_x86_64_fips.tar.gz" containerd_local_bundle_file: "{{ playbook_dir }}/../artifacts/{{ containerd_tar_file }}" pip_packages_local_bundle_file: "{{ playbook_dir }}/../artifacts/pip-packages.tar.gz" images_local_bundle_dir: "{{ playbook_dir}}/../artifacts/images" ``` **16. Build template using konvoy image builder** ``` ./konvoy-image build images/ova/rhel-84.yaml --overrides overrides/fips.yaml --overrides overrides/offline-fips.yaml --overrides overrides-bundles.yaml ``` !add -v6 for troubleshooting at the end of the command ## Create DKP cluster on vSphere **17. Export your vSphere Environment Variables** copy the below set of "exports" to a text document in a notepad so that you can modify them and copy/paste into the terminal. Save for later referance or use. ``` export CLUSTER_NAME=dkp export CLUSTER_FOLDER=d2iq export DKP_CONTROLPLANE=172.16.0.50 export VSPHERE_SERVER=172.16.0.15 export VSPHERE_USERNAME="administrator@vsphere.local" export VSPHERE_PASSWORD='Gap$#oba108' export VSPHERE_NETWORK="VM Network" export VSPHERE_NETOWRK_INTERFACE="eth0" export VSPHERE_DATA_CENTER="ICBM" export VSPHERE_DATA_STORE="flash" export VSPHERE_RESOURCE_POOL="dkp" export VSPHERE_KIB_IMAGE="konvoy-rhel-84-fips-1.23.12+fips.0-1666189477" export SSH_PUBLIC_KEY="/root/.ssh/id_rsa.pub" export DOCKER_REGISTRY_ADDRESS="http://172.16.0.181:5000" export CP_NODES=3 export CP_CPU=8 export CP_DISK=120 export CP_MEMORY=16 export WORKER_NODES=4 export WORKER_CPU=8 export WORKER_DISK=120 export WORKER_MEMORY=32 ``` Retrieve the Vsphere Thumbprint ``` openssl s_client -connect ${VSPHERE_SERVER}:443 < /dev/null 2>/dev/null | openssl x509 -fingerprint -noout -in /dev/stdin ``` Export the Vsphere THumbprint ``` export VSPHERE_TLS_THUMBPRINT="86:15:2B:54:27:29:5B:55:4D:67:57:B5:3E:97:31:57:D2:80:A9:C1" ``` **18. Build the Bootstrap Cluster** ``` cd /root/dkp/dkp-v2.3.1 ./dkp create bootstrap ``` **19. Update Vsphere Credentials** ``` ./dkp update bootstrap credentials wsphere ``` **20. Create the DKP cluster deplotment yaml** If you are not using self-signed certificates, remove the last line of the command`--tls-thumb-print=` below ``` ./dkp create cluster vsphere --cluster-name=${CLUSTER_NAME} --network="VM Network" --control-plane-endpoint-host=${DKP_CONTROLPLANE} --virtual-ip-interface=${VSPHERE_NETOWRK_INTERFACE} --data-center=${VSPHERE_DATA_CENTER} --data-store=${VSPHERE_DATA_STORE} --folder=${CLUSTER_FOLDER} --server=${VSPHERE_SERVER} --ssh-public-key-file=${SSH_PUBLIC_KEY} --resource-pool=${VSPHERE_RESOURCE_POOL} --vm-template=${VSPHERE_KIB_IMAGE} --tls-thumb-print=${VSPHERE_TLS_THUMBPRINT} --registry-mirror-url=${DOCKER_REGISTRY_ADDRESS} --control-plane-cpus=${CP_CPU} --control-plane-disk-size=${CP_DISK} --control-plane-memory=${CP_MEMORY} --control-plane-replicas=${CP_NODES} --worker-cpus=${WORKER_CPU} --worker-disk-size=${WORKER_DISK} --worker-memory=${WORKER_MEMORY} --worker-replicas=${WORKER_NODES} --dry-run -o yaml > ${CLUSTER_NAME}.yaml ``` **22. Check out the ${cluster}.yaml** {In this example its DKP.yaml} ``` vi ${cluster}.yaml ``` **23. Deploy the cluster** ``` kubectl create -f ${CLUSTER_NAME}.yaml ``` **24. Watch Your Cluster Build** ``` watch ./dkp describe cluster -c ${CLUSTER_NAME} ``` **25. Extract the kubeconfig** ``` ./dkp get kubeconfig -c ${CLUSTER_NAME} > ${CLUSTER_NAME}.conf ``` **26. Deploy MetalLB Configuration** Change the IP range to open Ips on your network that are not being used. ``` cat <<EOF > metallb.yaml apiVersion: v1 kind: ConfigMap metadata: namespace: metallb-system name: config data: config: | address-pools: - name: default protocol: layer2 addresses: - 10.0.0.50-10.0.0.51 EOF kubectl --kubeconfig ${CLUSTER_NAME}.conf apply -f metallb.yaml ``` **27. Pivot the Cluster Controllers Create CAPI Controllers on Cluster...** ``` ./dkp create capi-components --kubeconfig ${CLUSTER_NAME}.conf ``` ...and move the configuration to the cluster** ``` ./dkp move capi-resources --to-kubeconfig ${CLUSTER_NAME}.conf ``` You Now have a Self-Managing Kubernetes Cluster deployed on vSphere! **28. Adjust the Storage class to only allow PVs on a specfic VMware datastore** ``` kubectl delete sc vsphere-raw-block-sc --kubeconfig ${CLUSTER_NAME}.conf ``` Create a storage class yaml with the URL of the VMware datastore you want to use Replace the ds below with the proper ds tag for the vmware storage you are using ``` vi sc.yaml apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: annotations: storageclass.kubernetes.io/is-default-class: "true" name: vsphere-raw-block-sc provisioner: csi.vsphere.vmware.com allowVolumeExpansion: true parameters: datastoreurl: "ds:///vmfs/volumes/vsan:5238a205736fdb1f-c71f7ec7a0353662/" reclaimPolicy: Delete volumeBindingMode: WaitForFirstConsumer ``` Apply the Storage class yaml to create a new default SC ``` kubectl apply -f sc.yaml --kubeconfig ${DKP_CLUSTER_NAME}.conf ``` ## Kommander Deployment **29 Deploy Kommander to the DKP Cluster** Go to DKP folder ``` cd root/dkp/dkp-v2.3.1 ``` kommander-image-bundle-v2.3.1.tar is double tarred so you need to untar it one time ``` tar -xvf kommander-image-bundle-v2.3.1.tar ``` Push the image bundle to your offline registry ``` ./dkp push image-bundle --image-bundle kommander-image-bundle-v2.3.1.tar --to-registry-insecure-skip-tls-verify --to-registry 172.16.0.181:5000 ``` Create a Kommander Air gapped yaml file ``` ./dkp install kommander --init --airgapped > install.yaml ``` Validate that there is a line that says airgap instlal:true Time to install DKP UI {kommander} ``` ./dkp install kommander --installer-config install.yaml --kommander-applications-repository kommander-applications-v2.3.1 --charts-bundle dkp-kommander-charts-bundle-v2.3.1.tar.gz --kubeconfig ${CLUSTER_NAME}.conf1 ``` **30 Watch the Helm Releases Deploy** Wait for all the helm release to turn TRUE ``` watch kubectl get hr -A --kubeconfig ${CLUSTER_NAME}.conf ``` **31 Watch the Helm Releases Deploy** Get the IP and root login for the DKP UI ``` ./dkp open dashboard --kubeconfig=${CLUSTER_NAME}.conf ```

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully