Skip to content

Commit

Permalink
Merge pull request #7 from ShibraAmin18/gcp
Browse files Browse the repository at this point in the history
Added Gcp provider
  • Loading branch information
RohitSquareops authored Aug 28, 2023
2 parents e4d58ec + b690503 commit a614363
Show file tree
Hide file tree
Showing 18 changed files with 325 additions and 9 deletions.
35 changes: 31 additions & 4 deletions IAM.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
## IAM Permission

The Policy required to deploy this module is:

```
The Policy required to deploy this module:
```json
{
"Version": "2012-10-17",
"Statement": [
Expand All @@ -18,6 +17,34 @@ The Policy required to deploy this module is:
}
]
}
```
## Azure Role Permissions

```json
{
"Name": "AKS Describe Role",
"IsCustom": true,
"Description": "Allows describing AKS clusters",
"Actions": [
"Microsoft.ContainerService/managedClusters/read"
],
"DataActions": [],
"NotDataActions": [],
"AssignableScopes": [
"/subscriptions/{subscriptionId}"
]
}
```

## Google IAM Permissions

```json
{
"title": "GKE Describe Role",
"description": "Allows describing GKE clusters",
"stage": "GA",
"includedPermissions": [
"container.clusters.get"
]
}
```
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
This module deploys ArgoCD with Redis High Availability (HA) as the backend data store, and Slack notifications configured for real-time updates about deployments. With this module, you can automate your application deployment process with the GitOps methodology and ensure that the desired state of your application is always in sync with the actual state. Redis HA provides enhanced resilience and availability, while Slack notifications keep you informed of the status of your deployments.

## Important Notes:
This module is compatible with EKS version 1.23,1.24 and 1.25 which is great news for users deploying the module on an EKS cluster running that version. Review the module's documentation, meet specific configuration requirements, and test thoroughly after deployment to ensure everything works as expected.
This module is compatible with EKS, AKS & GKE which is great news for users deploying the module on an AWS, Azure & GCP cloud. Review the module's documentation, meet specific configuration requirements, and test thoroughly after deployment to ensure everything works as expected.

## Supported Versions:

| Argocd Helm Chart Version | K8s supported version |
| Argocd Helm Chart Version | K8s supported version (EKS, AKS & GKE) |
| :-----: | :--- |
| **5.4.0** | **1.23,1.24,1.25** |
| **5.4.0** | **1.23,1.24,1.25,1.26,1.27** |


## Usage Example
Expand All @@ -35,7 +35,9 @@ module "argocd" {
}
```
Refer [examples](https://github.com/squareops/terraform-kubernetes-argocd/tree/main/examples/complete) for more details.
- Refer [AWS examples](https://github.com/squareops/terraform-kubernetes-argocd/tree/main/examples/complete/aws) for more details.
- Refer [Azure examples](https://github.com/squareops/terraform-kubernetes-argocd/tree/main/examples/complete/azure) for more details.
- Refer [GCP examples](https://github.com/squareops/terraform-kubernetes-argocd/tree/main/examples/complete/gcp) for more details.

## IAM Permissions
The required IAM permissions to create resources from this module can be found [here](https://github.com/squareops/terraform-kubernetes-argocd/blob/main/IAM.md)
Expand Down
3 changes: 3 additions & 0 deletions examples/complate/README.md → examples/complete/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
### [SquareOps Technologies](https://squareops.com/) Your DevOps Partner for Accelerating cloud journey.
<br>
This example will be very useful for users who are new to a module and want to quickly learn how to use it. By reviewing the examples, users can gain a better understanding of how the module works, what features it supports, and how to customize it to their specific needs.

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Requirements

Expand All @@ -17,6 +18,8 @@ No requirements.
| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | n/a |
| <a name="provider_azure"></a> [azure](#provider\_azure) | n/a |
| <a name="provider_gcp"></a> [gcp](#provider\_gcp) | n/a |

## Modules

Expand Down
35 changes: 35 additions & 0 deletions examples/complete/aws/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# AWS Argocd Terraform Kubernetes Module
<!-- BEGIN_TF_DOCS -->
## Requirements

No requirements.

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | n/a |

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_argocd"></a> [argocd](#module\_argocd) | squareops/argocd/kubernetes | n/a |

## Resources

| Name | Type |
|------|------|
| [aws_eks_cluster.cluster](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/eks_cluster) | data source |
| [aws_eks_cluster_auth.cluster](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/eks_cluster_auth) | data source |

## Inputs

No inputs.

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_argocd_credentials"></a> [argocd\_credentials](#output\_argocd\_credentials) | Argocd\_Info |
<!-- END_TF_DOCS -->
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module "argocd" {
values_yaml = file("./helm/values.yaml")
redis_ha_enabled = true
autoscaling_enabled = true
slack_notification_token = "xoxb-qQ8486bluEuvmxrYx"
slack_notification_token = ""
argocd_notifications_enabled = true
}
}
File renamed without changes.
File renamed without changes.
35 changes: 35 additions & 0 deletions examples/complete/azure/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Azure Argocd Terraform Kubernetes Module

<!-- BEGIN_TF_DOCS -->
## Requirements

No requirements.

## Providers

| Name | Version |
|------|---------|
| <a name="provider_azurerm"></a> [azurerm](#provider\_azurerm) | 3.71.0 |

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_argocd"></a> [argocd](#module\_argocd) | squareops/argocd/kubernetes | n/a |

## Resources

| Name | Type |
|------|------|
| [azurerm_kubernetes_cluster.primary](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/kubernetes_cluster) | data source |

## Inputs

No inputs.

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_argocd_credentials"></a> [argocd\_credentials](#output\_argocd\_credentials) | Argocd\_Info |
<!-- END_TF_DOCS -->
56 changes: 56 additions & 0 deletions examples/complete/azure/helm/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
controller:
resources:
limits:
cpu: 400m
memory: 512Mi
requests:
cpu: 100m
memory: 200Mi
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "Addons-Services"
operator: In
values:
- "true"
repoServer:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "Addons-Services"
operator: In
values:
- "true"

server:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "Addons-Services"
operator: In
values:
- "true"

redis:
resources:
limits:
cpu: 400m
memory: 500Mi
requests:
cpu: 100m
memory: 150Mi
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "Addons-Services"
operator: In
values:
- "true"
21 changes: 21 additions & 0 deletions examples/complete/azure/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
locals {
region = "us-east-2"
additional_tags = {
Owner = "organization_name"
Expires = "Never"
Department = "Engineering"
environment = "prod"
}
}

module "argocd" {
source = "squareops/argocd/kubernetes"
argocd_config = {
hostname = "argocd.skaf.squareops.in"
values_yaml = file("./helm/values.yaml")
redis_ha_enabled = true
autoscaling_enabled = true
slack_notification_token = ""
argocd_notifications_enabled = true
}
}
4 changes: 4 additions & 0 deletions examples/complete/azure/output.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
output "argocd_credentials" {
value = module.argocd.argocd
description = "Argocd_Info"
}
26 changes: 26 additions & 0 deletions examples/complete/azure/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
provider "azurerm" {
features {}
}

data "azurerm_kubernetes_cluster" "primary" {
name = ""
resource_group_name = ""
}

provider "kubernetes" {
host = data.azurerm_kubernetes_cluster.primary.kube_config.0.host
username = data.azurerm_kubernetes_cluster.primary.kube_config.0.username
password = data.azurerm_kubernetes_cluster.primary.kube_config.0.password
client_certificate = base64decode(data.azurerm_kubernetes_cluster.primary.kube_config.0.client_certificate)
client_key = base64decode(data.azurerm_kubernetes_cluster.primary.kube_config.0.client_key)
cluster_ca_certificate = base64decode(data.azurerm_kubernetes_cluster.primary.kube_config.0.cluster_ca_certificate)
}

provider "helm" {
kubernetes {
host = data.azurerm_kubernetes_cluster.primary.kube_config.0.host
client_key = base64decode(data.azurerm_kubernetes_cluster.primary.kube_config.0.client_key)
client_certificate = base64decode(data.azurerm_kubernetes_cluster.primary.kube_config.0.client_certificate)
cluster_ca_certificate = base64decode(data.azurerm_kubernetes_cluster.primary.kube_config.0.cluster_ca_certificate)
}
}
35 changes: 35 additions & 0 deletions examples/complete/gcp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# GCP Argocd Terraform Kubernetes Module
<!-- BEGIN_TF_DOCS -->
## Requirements

No requirements.

## Providers

| Name | Version |
|------|---------|
| <a name="provider_google"></a> [google](#provider\_google) | n/a |

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_argocd"></a> [argocd](#module\_argocd) | squareops/argocd/kubernetes | n/a |

## Resources

| Name | Type |
|------|------|
| [google_client_config.default](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/client_config) | data source |
| [google_container_cluster.primary](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/container_cluster) | data source |

## Inputs

No inputs.

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_argocd_credentials"></a> [argocd\_credentials](#output\_argocd\_credentials) | Argocd\_Info |
<!-- END_TF_DOCS -->
26 changes: 26 additions & 0 deletions examples/complete/gcp/helm/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
controller:
resources:
limits:
cpu: 200m
memory: 500Mi
requests:
cpu: 50m
memory: 150Mi

server:
resources:
limits:
cpu: 200m
memory: 200Mi
requests:
cpu: 50m
memory: 100Mi

redis:
resources:
limits:
cpu: 200m
memory: 150Mi
requests:
cpu: 50m
memory: 75Mi
21 changes: 21 additions & 0 deletions examples/complete/gcp/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
locals {
region = "us-east-2"
additional_tags = {
Owner = "organization_name"
Expires = "Never"
Department = "Engineering"
environment = "prod"
}
}

module "argocd" {
source = "squareops/argocd/kubernetes"
argocd_config = {
hostname = "argocd.prod.in"
values_yaml = file("./helm/values.yaml")
redis_ha_enabled = true
autoscaling_enabled = true
slack_notification_token = ""
argocd_notifications_enabled = true
}
}
4 changes: 4 additions & 0 deletions examples/complete/gcp/output.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
output "argocd_credentials" {
value = module.argocd.argocd
description = "Argocd_Info"
}
Loading

0 comments on commit a614363

Please sign in to comment.