Marques Johansson
    • 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
    ## Have you Ever? Has this happened to you? "Man, Equinix Metal is cool, but I just wish I could push a button and deploy an application!" Maybe you've tried containers? Or perhaps you've attempted to install kuberenetes? *User clicks on kubernetes logo, gets error message* Or maybe even service mesh? *user clicks on istio icon and gets complicated deployment graphic, screams and gets sledge hammer* Does it feel like things are harder than they have to be? *User crying on floor* "There's got to be a better way!" *rocks back and forth Well now there is! Introducing the Equinix App Market! With Patented One Click Technology! Now applications deploy like Equinix Metal servers--in minutes! Kubernetes! Click...show sped up deployment flow. End with node list and "Ahhs" Wordpress! Databases! Crypto Miners! Elastic Search! GitOps! Grafana! Harbor! RabbitMQ! Docker! Prometheus! MySQL! All these and more can be yours for the low low price of *FREE!* Act now and get a free gift...a Minecraft server! Operators are standing by, come to https://metal.equinix.com/appmarket and get your clickops on today! *offer not valid in Wyoming and parts of New Mexico. Web apps shown may be closer than they appear. Crypto currency past performance is not indicative of future gains. Docker has a whale for a logo. Terms and conditions apply. CALL TODAY! ## Create Cluster ### Install Brew ``` /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` ### Install Tools ``` brew upgrade brew install kind brew install kubectl brew install helm ``` ### Create Cluster ```sh kind create cluster ``` <!-- don't need this: --image kindest/node:v1.23.0 --wait 5m --> ## Install Crossplane ``` kubectl create namespace crossplane-system helm repo add crossplane-stable https://charts.crossplane.io/stable helm repo update helm install crossplane --namespace crossplane-system crossplane-stable/crossplane ``` ## Install Crossplane CLI ``` curl -sL https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh | sh ``` ## Provider ```sh kubectl crossplane install provider crossplane/provider-jet-equinix:v0.2.0 ``` Wait for the provider to be Installed and Healthy ``` kubectl get provider ``` Alternatively: https://github.com/crossplane-contrib/provider-jet-equinix/blob/main/examples/install.yaml #### Configure Secret Update credentials and install: https://github.com/crossplane-contrib/provider-jet-equinix/blob/main/examples/providerconfig/secret.yaml.tmpl ```sh eval $(metal env) cat << EOF | kubectl apply -f - apiVersion: v1 kind: Secret metadata: name: example-creds namespace: crossplane-system type: Opaque stringData: credentials: | { "client_id": "PlaceYour32CharacterClientIDHere", "client_secret": "t0ps3cr3t11", "auth_token": "$METAL_AUTH_TOKEN", "request_timeout": "30", "response_max_page_size": "100", "endpoint": "https://api.equinix.com" } EOF ``` #### Configure Provider ```sh cat << EOF | kubectl apply -f - --- apiVersion: equinix.jet.crossplane.io/v1alpha1 kind: ProviderConfig metadata: name: default spec: credentials: source: Secret secretRef: name: example-creds namespace: crossplane-system key: credentials --- EOF ``` ## Create Compositions Install the demo compositions. **See <https://github.com/crossplane-contrib/provider-jet-equinix/pull/12/files#r985311946> (or the merged files) for the latest.** For more information about Composition: * <https://crossplane.io/docs/v1.9/concepts/composition.html> * <https://crossplane.io/docs/v1.9/reference/composition.html> For more information about the Equinix resources: * `kubectl api-resources | grep equinix` * `kubectl explain devices.metal.equinix.jet.crossplane.io/v1alpha1.spec.forProvider` * <https://doc.crds.dev/github.com/crossplane-contrib/provider-jet-equinix> C: args: - k3stoken - metro resources: Proj - create a secret that is userdata + k3stoken DevCP - userdatasecretref: ^ - want to create a userdata secret for agents to use - createConnectionSecret: fmt with userdata + k3stoken + server ip DevDP - userdatasecretref: ^ (see the pull request linked above for the latest yaml) ```sh kubectl apply -f - << EOF --- apiVersion: apiextensions.crossplane.io/v1 kind: Composition metadata: name: k3sclusters.deployments.equinix.com spec: writeConnectionSecretsToNamespace: crossplane-system compositeTypeRef: apiVersion: deployments.equinix.com/v1alpha1 kind: K3sCluster resources: - name: k3s-server base: apiVersion: metal.equinix.jet.crossplane.io/v1alpha1 kind: Device metadata: labels: k3s-server: 'true' spec: forProvider: hostname: k3s-server plan: c3.small.x86 operatingSystem: ubuntu_20_04 billingCycle: hourly locked: false networkType: hybrid tags: - crossplane writeConnectionSecretToRef: name: server namespace: crossplane-system reclaimPolicy: Delete patches: - type: ToCompositeFieldPath fromFieldPath: status.atProvider.accessPublicIpv4 toFieldPath: status.serverIP - type: FromCompositeFieldPath fromFieldPath: spec.metro toFieldPath: spec.forProvider.metro - type: CombineFromComposite toFieldPath: spec.forProvider.userdata combine: variables: - fromFieldPath: spec.k3stoken strategy: string string: fmt: | #cloud-config write_files: #- permissions: '0660' # path: /etc/rancher/k3s/config.yaml # content: | # # k3s config runcmd: - sudo apt update - sudo apt upgrade -y - curl -sfL https://get.k3s.io | \ INSTALL_K3S_EXEC="server" \ K3S_TOKEN=%s sh - - name: k3s-agent base: apiVersion: metal.equinix.jet.crossplane.io/v1alpha1 kind: Device metadata: labels: k3s-agent: 'true' spec: forProvider: hostname: k3s-agent plan: c3.small.x86 operatingSystem: ubuntu_20_04 billingCycle: hourly locked: false networkType: hybrid tags: - crossplane writeConnectionSecretToRef: name: crossplane-conformance namespace: crossplane-system reclaimPolicy: Delete patches: # TODO we reuse metro patches. create a 'patchtype' - type: FromCompositeFieldPath fromFieldPath: spec.metro toFieldPath: spec.forProvider.metro - type: CombineFromComposite toFieldPath: spec.forProvider.userdata policy: fromFieldPath: Required combine: variables: - fromFieldPath: spec.k3stoken - fromFieldPath: status.serverIP # TODO how to get server address? strategy: string string: fmt: | #cloud-config write_files: #- permissions: '0660' # path: /etc/rancher/k3s/config.yaml # content: | # # k3s config runcmd: - sudo apt update - sudo apt upgrade -y - curl -sfL https://get.k3s.io | \ K3S_TOKEN=%s \ K3S_URL=https://%s:6443 sh - --- EOF ``` ```sh kubectl apply -f - << EOF --- apiVersion: apiextensions.crossplane.io/v1 kind: CompositeResourceDefinition metadata: name: k3sclusters.deployments.equinix.com spec: group: deployments.equinix.com names: kind: K3sCluster listKind: K3sClusterList plural: k3sclusters singular: k3scluster versions: - name: v1alpha1 served: true referenceable: true schema: openAPIV3Schema: description: Managed resources for provider-jet-equinix crossplane K3s Cluster type: object properties: spec: type: object properties: metro: type: string description: metro k3stoken: type: string description: K3s Token required: - metro - k3stoken status: type: object properties: serverIP: type: string description: IPv4 of the K3s Server --- EOF ``` ### Instances of Compositions Try out the compositions with custom values ```sh kubectl apply -f - << EOF --- apiVersion: deployments.equinix.com/v1alpha1 kind: K3sCluster metadata: name: sv-k3s spec: metro: sv k3stoken: topsecret --- EOF ``` #### Unused Misc Notes ```sh kubectl apply -f - <<<EOS ... apiVersion: apiextensions.crossplane.io/v1 kind: Composition metadata: name: demoapp.apps.acme.com spec: writeConnectionSecretsToNamespace: crossplane-system compositeTypeRef: apiVersion: apps.acme.com/v1alpha1 kind: Demoapp resources: - base: apiVersion: metal.equinix.jet.crossplane.io/v1alpha1 kind: Project spec: forProvider: name: demoapp-crossplane providerConfigRef: name: default - base: apiVersion: metal.equinix.jet.crossplane.io/v1alpha1 kind: Device spec: forProvider: hostname: demoapp-crossplane plan: c3.small.x86 operatingSystem: ubuntu_20_04 billingCycle: hourly locked: false networkType: hybrid tags: - crossplane providerConfigRef: name: equinix-metal-provider writeConnectionSecretToRef: name: crossplane-conformance namespace: crossplane-system projectIdRef: matchControllerRef: true patches: - fromFieldPath: spec.metro toFieldPath: spec.forProvider.metro - base: apiVersion: vlan.metal.equinix.com/v1alpha1 kind: VirtualNetwork spec: forProvider: description: conformance provisioned VLAN providerConfigRef: name: equinix-metal-provider patches: - fromFieldPath: spec.metro toFieldPath: spec.forProvider.metro - base: apiVersion: ports.metal.equinix.com/v1alpha1 kind: Assignment spec: forProvider: deviceIdSelector: matchControllerRef: true virtualNetworkIdSelector: matchControllerRef: true name: eth1 providerConfigRef: name: equinix-metal-provider EOS ```

    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