Giter VIP home page Giter VIP logo

open-cluster-management-examples's Introduction

Overview

The examples in this repository are focused on helping new users understand what is possible with open-cluster-management.

All content provided in this repository is provided reference and can be modified within the terms of the Apache2 License.

Deploying the examples

Policies

Most policies demonstrate how to apply various kinds of Configuration across your fleet of clusters. There are 2 policies that have placeholder values that will need to be updated for your specific usage.

Creating default users for your clusters

The example policies are defined to allow you to create and distribute users consistently across all of your clusters.

  1. To define your desired users, follow these steps for each user:
touch htpasswd.txt
htpasswd -b -B htpasswd.txt username password
  1. Generate the base64 encoded contents to include in the kustomization template (below).
cat htpasswd.txt | base64

Update your kustomization template for your environment

After you have defined your users and have the base64 encoded form of the htpasswd file, you can then update the kustomization template to parameterize your policies.

  1. Copy kustomization.yaml.template to kustomization.yaml
cp policies/kustomization.yaml.template policies/kustomization.yaml
  1. To update the .htpasswd configuration for the custom Authentication provider, edit the kustomization.yaml and replace TO_BE_UPDATED_BASE64_ENCODED_HTPASSWD_FILE_CONTENTS. Protect the contents of the file once edited as the secret is used to add authenticated users to your cluster.
  2. Also, update TO_BE_UPDATED_WITH_RHACM_WEB_CONSOLE_URL with the URL for your RHACM console, for example https://multicloud-console.apps.clusterName.baseDomain/multicloud/clusters
...
patches:
- target:
    group: policy.open-cluster-management.io
    version: v1
    kind: Policy
    name: policy-consolelink
  patch: |-
    - op: replace
      path: /spec/policy-templates/0/objectDefinition/spec/object-templates/0/objectDefinition/spec
      value:
        applicationMenu:
          imageURL: https://www.vectorlogo.zone/logos/openshift/openshift-icon.svg
        href: TO_BE_UPDATED_WITH_RHACM_WEB_CONSOLE_URL
- target:
    group: policy.open-cluster-management.io
    version: v1
    kind: Policy
    name: policy-auth-provider
  patch: |-
    - op: replace
      path: /spec/policy-templates/0/objectDefinition/spec/object-templates/1/objectDefinition/data/htpasswd
      value: TO_BE_UPDATED_BASE64_ENCODED_HTPASSWD_FILE_CONTENTS

Apply the policies to your hub cluster

export KUBECONFIG=/path/to/hub/kubeconfig
kustomize build policies/ | oc apply -f -

open-cluster-management-examples's People

Contributors

mdelder avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.