Sherine Khoury
    • 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
    • Engagement control
    • 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 Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control 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
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # `oc-mirror` - Enclave Support ## What is enclave support? [Enclave](https://en.wikipedia.org/wiki/Network_enclave): *The purpose of a network enclave is to limit internal access to a portion of a network. A major difference between a DMZ or demilitarized zone and a network enclave is a DMZ allows inbound and outbound traffic access, where firewall boundaries are traversed. In an enclave, firewall boundaries are not traversed.* oc-mirror already focuses on mirroring content to disconnected environments for installing and upgrading OCP clusters. This specific feature addresses use cases where mirroring is needed for several enclaves (disconnected environments), that are secured behind at least one intermediate disconnected network. In this context, enclave users are interested in: * being able to **mirror content for several enclaves**, and centralizing it in a single internal registry. Some customers are interested in running security checks on the mirrored content, vetting it before allowing mirroring to downstream enclaves. * being able to mirror contents **directly from the internal centralized registry** to enclaves without having to restart the mirroring from internet for each enclave * **keeping the volume** of data transfered from one network stage to the other **to a strict minimum**, avoiding to transfer a blob or an image more than one time from one stage to another. ## When can I use the feature? :warning: **The Enclave support feature is still an MVP and should not be used in production.** In the 4.15 release, the enclave workflow is still an MVP (Minimal Viable Product). It will be graduating to Tech Preview in 4.16. (TOBEEDITED)After GA, this new mirroring binary is intended to replace the existing oc-mirror. Even if the disconnected environment that you are mirroring to is much simpler than the enclave scenario we described in the previous section, you may use the feature to mirror to fully disconnected clusters. To enable the enclave workflow, add `--v2` to the oc-mirror arguments passed at the command line. Example: ```bash= oc-mirror --v2 --help ``` The Enclave Support feature (`--v2`) has the **following limitations**: * Mirroring **OCP releases only**. Operator catalogs, additional images and Helm charts are not yet supported. * Mirroring to **fully disconnected clusters only**. In other words, mirroring to a registry directly (Mirror-to-mirror) is not yet available. * Mirroring is only possible by: * Generating an archive for the mirroring content described in the image set config (Mirror-to-disk) ```bash oc-mirror --v2 -c imageset_config.yaml file:///home/user/mirror_content ``` * Mirroring from the archive to the disconnected registry (disk-to-mirror) ```bash oc-mirror --v2 -c imageset_config.yaml --from file:///home/user/mirror_content docker://disconnected_registry.internal:5000/ ``` ## Reference Architecture Diagram for Enclave Support ![image](https://hackmd.io/_uploads/BylgprKua.png) ## How to mirror to an enclave? The following diagram will be used to illustrate the workflow for mirroring to enclaves, with an intermediate disconnected network stage, called airgap env in the diagram. ### Overall diagram ![Enclave_wf2](https://hackmd.io/_uploads/r1FvCKt_a.jpg) ### Phase 1 - Mirroring to the airgap env(on-premise registry) The goal of this phase is to transfer the images needed by one or several enclaves into the entreprise's central registry. The central registry (entrerpise-registry.in in the diagram) is usually in a secure network (airgap env in the diagram), not directly connected to the public internet. :bell: The steps depicted in Phase 1 match exactly the steps for mirroring to a disconnected environment. #### Phase 1a - Generating a mirror archive The end-user will execute oc-mirror in an environment with access to the public internet. This is illustrated as arrow 1 in the diagram. ```bash= oc-mirror--v2 -c isc.yaml file:///home/user/entreprise-content ``` This action collects all the OCP content into an archive and generates an archive on disk (under /home/user/entreprise-content in the diagram). Example of isc.yaml: ```yaml= apiVersion: mirror.openshift.io/v1alpha2 kind: ImageSetConfiguration # storageConfig: # The storageConfig section is no longer relevant for the enclave support feature. If added, it will be ignored mirror: platform: architectures: - "amd64" channels: - name: stable-4.15 minVersion: 4.15.0 maxVersion: 4.15.3 ``` Once the archive generated, it will be transfered to the airgap env. The transport mechanism is not part of oc-mirror, and depends on the strategies set up by the entreprise's network administrators. In some cases, the transfer is done manually: the disk is physically unplugged from one location, and plugged to another computer in the airgap env. In other cases, SFTP or other protocols may be used. #### Phase 1b - Mirroring contents into the (on-premise) airgap env registry Once the transfer of the archive generated in Phase 1a is done (to /disk1/entreprise-content in the diagram), the user can execute oc-mirror again in order to mirror the relevant archive contents to the registry (entrerpise-registry.in in the diagram). This is illustrated by arrow 3 in the diagram. ```bash= oc-mirror --v2 -c isc.yaml --from file:///disk1/entreprise-content docker://entreprise-registry.in/ ``` In the above command: * `--from` points to the folder containing the archive as generated by Phase 1a. It starts with the `file://` * The destination of the mirroring is the final argument. Being a docker registry, it is prefixed by `docker://` * `-c` or `--config` is still a mandatory argument, it allows oc-mirror to eventually mirror only sub-parts of the archive to the registry. This is specifically interesting for enclaves, where one archive may contain several OCP releases, while the airgap env (or an enclave) is only interested in mirroring a few. ### Phase 2 - Mirroring to the enclave Once all mirroring content has been transfered to the entreprise's central registry (entreprise-registry.in in the diagram), the users might be interested in mirroring OCP content from that internal registry to one or more enclaves. In order to do so, the same or a new imagesetConfig, describing the content that needs to be mirrored to the enclave is prepared. Example isc-enclave.yaml ```yaml= apiVersion: mirror.openshift.io/v1alpha2 kind: ImageSetConfiguration mirror: platform: architectures: - "amd64" channels: - name: stable-4.15 minVersion: 4.15.2 maxVersion: 4.15.2 ``` oc-mirror needs to be run on a machine with access to the disconnected registry (ie. with ref. to the diagram: in the airgap env, where entreprise-registry.in is accessible ). #### Phase 2a - Updating the registries.conf Prior to running oc-mirror in the airgap env, the user needs to setup the registries.conf file. This is illustrated by arrow 4 in the diagram. The [file specification](https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md#example) suggests to store the file under `$HOME/.config/containers/registries.conf`, otherwise `/etc/containers/registries.conf`. The TOML format of the file is also described in the above specification. Example registries.conf ```toml= [[registry]] location="registry.redhat.io" [[registry.mirror]] location="entreprise-registry.in" [[registry]] location="quay.io" [[registry.mirror]] location="entreprise-registry.in" ``` ##### Update Graph URL If you are using `graph: true`, oc-mirror will attempt to reach the cincinnati API endpoint. Since this environment is airgapped, make sure you export environment variable UPDATE_URL_OVERRIDE to reference the URL for the OSUS (OpenShift UpdateService), like so: ```bash= export UPDATE_URL_OVERRIDE=https://osus.entreprise.in/graph ``` For more information on how to setup OSUS on an OpenShift cluster, please refer to the [documentation](https://docs.openshift.com/container-platform/4.14/updating/updating_a_cluster/updating_disconnected_cluster/disconnected-update-osus.html). #### Phase 2b - Generating a mirror archive from the entreprise registry for the enclave In order to prepare an archive for the enclave1, as illustrated as arrow 5 in the diagram, the user executes oc-mirror in the entreprise airgap env, using the imageSetConfig specific for that enclave. This ensures that only images needed by that enclave are mirrored: ```bash= oc-mirror --v2 -c isc-enclave.yaml file:///disk-enc1/ ``` This action collects all the OCP content into an archive and generates an archive on disk (under /disk-enc1/ in the diagram). Once the archive generated, it will be transfered to the enclave1 network. The transport mechanism is not the responsibility of oc-mirror. #### Phase 2c- Mirroring contents to the enclave registry Once the transfer of the archive generated in Phase 2b is done (to /local-disk in the diagram), the user can execute oc-mirror again in order to mirror the relevant archive contents to the registry (registry.enc1.in in the diagram). This is illustrated by arrow 6 in the diagram. ```bash= oc-mirror --v2 -c isc-enclave.yaml --from /local-disk docker://registry.enc1.in ``` The administrators of the OCP cluster in Enclave1 are now ready to install/upgrade that cluster.

    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