Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Lokomotive component azure-arc-onboarding #1473

Merged
merged 3 commits into from
Jul 13, 2021
Merged

Lokomotive component azure-arc-onboarding #1473

merged 3 commits into from
Jul 13, 2021

Conversation

ipochi
Copy link
Member

@ipochi ipochi commented May 24, 2021

This PR adds a new Lokomotive component azure-arc-lokomotive for onboarding and removing a Lokomotive cluster from Azure Arc.

To test:
follow the configuration reference documentation for the component.

component azure-arc-lokomotive {
  application_client_id=""
  tenant_id=""
  application_password=""
  resource_group=""
  cluster_name=""
}
lokoctl component apply azure-arc-onboarding

@ipochi ipochi requested review from pothos and invidian May 24, 2021 08:27
@invidian
Copy link
Member

invidian commented May 24, 2021

Why azure-arc-lokomotive and not azure-arc? We know it's part of Lokomotive :)

Copy link
Member

@invidian invidian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some thoughts.

@ipochi ipochi force-pushed the imran/azure-arc branch 3 times, most recently from a09dfaa to d637217 Compare June 11, 2021 12:08
@ipochi ipochi changed the title Lokomotive component azure-arc-lokomotive Lokomotive component azure-arc-onboarding Jun 11, 2021
@ipochi ipochi requested a review from invidian June 11, 2021 12:15
@ipochi
Copy link
Member Author

ipochi commented Jun 11, 2021

Why azure-arc-lokomotive and not azure-arc? We know it's part of Lokomotive :)

#1473 (comment)

pkg/components/azure-arc/component.go Outdated Show resolved Hide resolved
pkg/components/azure-arc/image/Dockerfile Outdated Show resolved Hide resolved
pkg/components/azure-arc/image/Dockerfile Outdated Show resolved Hide resolved
Copy link
Member

@invidian invidian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not full review, but mainly addressing resolved previous conversations.

pkg/components/azure-arc/component_test.go Outdated Show resolved Hide resolved
pkg/components/azure-arc/component_test.go Outdated Show resolved Hide resolved
Copy link
Member

@invidian invidian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some smoke review comments

pkg/components/azure-arc/image/script.sh Outdated Show resolved Hide resolved
pkg/components/azure-arc/image/script.sh Outdated Show resolved Hide resolved
pkg/components/azure-arc/image/script.sh Outdated Show resolved Hide resolved
pkg/components/azure-arc/image/script.sh Outdated Show resolved Hide resolved
pkg/components/azure-arc/image/script.sh Outdated Show resolved Hide resolved
@ipochi ipochi force-pushed the imran/azure-arc branch 4 times, most recently from 0460a52 to 6105859 Compare June 24, 2021 11:55
docs/how-to-guides/azure-arc-onboarding.md Outdated Show resolved Hide resolved
pkg/components/azure-arc-onboarding/component.go Outdated Show resolved Hide resolved
pkg/components/azure-arc-onboarding/component.go Outdated Show resolved Hide resolved
pkg/components/azure-arc-onboarding/image/azure-arc.sh Outdated Show resolved Hide resolved
Copy link
Member

@surajssd surajssd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't tried myself, but would love to.

docs/how-to-guides/azure-arc-onboarding.md Outdated Show resolved Hide resolved
docs/how-to-guides/azure-arc-onboarding.md Outdated Show resolved Hide resolved
docs/how-to-guides/azure-arc-onboarding.md Outdated Show resolved Hide resolved
docs/how-to-guides/azure-arc-onboarding.md Outdated Show resolved Hide resolved
docs/how-to-guides/azure-arc-onboarding.md Outdated Show resolved Hide resolved
docs/how-to-guides/azure-arc-onboarding.md Outdated Show resolved Hide resolved
docs/how-to-guides/azure-arc-onboarding.md Outdated Show resolved Hide resolved
docs/how-to-guides/azure-arc-onboarding.md Outdated Show resolved Hide resolved
docs/how-to-guides/azure-arc-onboarding.md Outdated Show resolved Hide resolved
@ipochi ipochi force-pushed the imran/azure-arc branch 3 times, most recently from 0abab4a to d61861e Compare July 12, 2021 07:57
@ipochi ipochi requested review from surajssd and invidian July 12, 2021 10:00
Copy link
Member

@invidian invidian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor suggestions

pkg/components/azure-arc-onboarding/component_test.go Outdated Show resolved Hide resolved
pkg/components/azure-arc-onboarding/component_test.go Outdated Show resolved Hide resolved
pkg/components/azure-arc-onboarding/component_test.go Outdated Show resolved Hide resolved
pkg/components/azure-arc-onboarding/component_test.go Outdated Show resolved Hide resolved
pkg/components/azure-arc-onboarding/component_test.go Outdated Show resolved Hide resolved
Copy link
Member

@surajssd surajssd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few language related changes.

- Delegate access and manage security policies for resources using role-based access control (RBAC) and [Azure
Lighthouse](https://azure.microsoft.com/en-in/services/azure-lighthouse/).

- Organise and inventory assets through a variety of Azure scopes, such as management groups, subscriptions,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Organise and inventory assets through a variety of Azure scopes, such as management groups, subscriptions,
- Organise and inventory assets through various Azure scopes, such as management groups, subscriptions,

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Microsoft page on Azure arc has a variety of

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added it since it is too wordy. Nothing right or wrong about it.


## Learning objectives

At the end of this tutorial you will have onboarded a Lokomotive cluster on Azure Arc, create an Azure Arc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
At the end of this tutorial you will have onboarded a Lokomotive cluster on Azure Arc, create an Azure Arc
At the end of this tutorial, you will have onboarded a Lokomotive cluster on Azure Arc, created an Azure Arc

Copy link
Member Author

@ipochi ipochi Jul 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rephrased to

By the end of this guide, the following things would be accomplished:
* Onboard a Lokomotive cluster on Azure Arc
* Create Azure Arc Kubernetes configuration for the GitOps agent.
* Watch the GitOps agent deploy Kubernetes resources from the git repository.

Let me know what you think ?

## Learning objectives

At the end of this tutorial you will have onboarded a Lokomotive cluster on Azure Arc, create an Azure Arc
Kubernetes configuration and deploy configuration of a sample Nginx Deployment using GitOps.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Kubernetes configuration and deploy configuration of a sample Nginx Deployment using GitOps.
Kubernetes configuration and deployed a sample Nginx Deployment configuration using GitOps.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- Delegate access and manage security policies for resources using role-based access control (RBAC) and [Azure
Lighthouse](https://azure.microsoft.com/en-in/services/azure-lighthouse/).

- Organise and inventory assets through a variety of Azure scopes, such as management groups, subscriptions,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Organise and inventory assets through a variety of Azure scopes, such as management groups, subscriptions,
- Organise and inventory assets through various Azure scopes, such as management groups, subscriptions,

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a new component `azure-arc-onboarding` that can onboard
and remove a Lokomotive cluster in Azure Arc.

In its current incarnation, component deploys a Job which executes the
commands needed to onboard or remove the Lokomotive cluster from Azure
Arc.

Signed-off-by: Imran Pochi <imran@kinvolk.io>
This commit adds a Dockerfile that is used to build `az-cli-with-helm`
docker image.

`azurearc.sh` is executed whenever the pod is created during
onboarding/removing the Lokomotive cluster in Azure arc.

Versions of `az` and `helm` used are:

az   - v2.25.0
helm - v3.6.1

Signed-off-by: Imran Pochi <imran@kinvolk.io>
@ipochi
Copy link
Member Author

ipochi commented Jul 13, 2021

@invidian @surajssd

Added a cleanup section which was forgotten and I have addressed your comments. PTAL.

@ipochi ipochi requested review from invidian and surajssd July 13, 2021 07:10
Copy link
Member

@invidian invidian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some remaining nits, otherwise LGTM 👍

invidian
invidian previously approved these changes Jul 13, 2021
Copy link
Member

@invidian invidian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

This commit adds a configuration reference document for the component
and a how-to-guide.

How-to-guide : GitOps with Azure Arc enabled Lokomotive cluster

This How-to guide targets a use case of Deploying configurations using
GitOps on an Azure arc enabled Lokomotive cluster.

Signed-off-by: Imran Pochi <imran@kinvolk.io>
@ipochi ipochi merged commit b50a724 into master Jul 13, 2021
@ipochi ipochi deleted the imran/azure-arc branch July 13, 2021 13:10
@invidian invidian added this to the v0.9.0 milestone Jul 16, 2021
@invidian invidian added the area/components Items related to components label Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/components Items related to components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants