You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This GitHub Actions **reusable workflow** automates Kubernetes application deployment using [Kustomize](https://kubectl.docs.kubernetes.io/references/kustomize/) and [ArgoCD](https://argo-cd.readthedocs.io/en/stable/).
3
+
This GitHub Actions **reusable workflow** automates Kubernetes application deployment using [Kustomize](https://kubectl.docs.kubernetes.io/references/kustomize/) and [ArgoCD](https://argo-cd.readthedocs.io/en/stable/).
4
4
It renders and templates your manifest files, commits the results to your **continuous deployment (CD) repo**, and uses the **ArgoCD REST API** to create and sync applications.
5
5
6
6
> ✅ **ArgoCD Applications are auto-created if missing**, so first-time deployments work out-of-the-box.
7
-
> ⚠️ **v2 is currently in BETA** — APIs and inputs may evolve slightly.
7
+
> ⚠️ **v2 is currently in BETA** — inputs and behavior may evolve slightly.
|`cd_repo`| ✅ | string | Continuous deployment repo where templated manifests are stored |
18
+
|`github_environment`| ✅ | string |**GitHub Environment** name for this job (enables approvals & env-scoped secrets in repo settings) |
19
+
|`target`| ✅ | string |**Logical environment** to deploy to (e.g. `dev`, `qa`, `prod`). If `env_map[target]` has multiple clusters, you **must** also set `target_cluster`. |
20
+
|`target_cluster`| ❌ | string | Specific cluster to use **when**`target` maps to multiple clusters in `env_map` (e.g. `aks-prod-weu`). For single-cluster envs leave empty. |
21
+
|`namespace`| ✅ | string | Kubernetes namespace for deployment |
22
+
23
+
> 🔎 **`github_environment` vs `target`**
24
+
> `github_environment` ties the job to a GitHub Environment (for approvals and env-scoped secrets).
25
+
> `target` is your **logical deployment environment** used to look up clusters via `env_map`.
You can provide the environment map in **two ways**. The workflow will use **`inputs.env_map` first**, and if it’s empty, it will fall back to the **`ENV_MAP` environment variable**.
> ℹ️ **Format:** `env_map` must be **valid JSON** (not YAML).
90
+
> ❗ If `target` maps to multiple clusters in `env_map` and `target_cluster` is empty, the workflow fails and lists valid cluster options.
91
+
92
+
71
93
---
72
94
73
95
## 🔑 UAMI Mapping for Azure Workload Identity
74
96
75
-
When deploying to **Azure AKS**, this workflow supports exporting**User Assigned Managed Identity (UAMI)** client IDs as environment variables for templating.
97
+
When deploying to **Azure AKS**, this workflow exports **User Assigned Managed Identity (UAMI)** client IDs as environment variables for templating.
76
98
77
99
### How it works
78
100
- Each `uami_map` entry from `env_map` is processed.
@@ -82,12 +104,11 @@ When deploying to **Azure AKS**, this workflow supports exporting **User Assigne
82
104
2. All `-` characters are replaced with `_`.
83
105
- Example: `sidecar-uami`→ `sidecar_uami`
84
106
3. If the resulting name doesn’t start with `[A-Za-z_]`, an `_` is prepended.
85
-
86
-
-The transformed name is exported into the workflow environment and set to the UAMI’s `client_id`.
107
+
- The transformed name is exported and set to the UAMI’s `client_id`.
108
+
- All exported variables are logged for visibility.
87
109
88
110
### Example
89
111
Given this `env_map` cluster entry:
90
-
91
112
```json
92
113
{
93
114
"cluster": "devcluster",
@@ -100,16 +121,13 @@ Given this `env_map` cluster entry:
100
121
}
101
122
```
102
123
103
-
The following environment variables will be exported for templating:
104
-
124
+
Exports:
105
125
```
106
126
app_uami=1111-aaaa
107
127
sidecar_uami=2222-bbbb
108
128
```
109
129
110
-
### Usage in Manifests
111
-
You can now reference these UAMIs in your Kubernetes manifests with `envsubst`:
112
-
130
+
Use in manifests:
113
131
```yaml
114
132
env:
115
133
- name: APP_UAMI_CLIENT_ID
@@ -118,24 +136,20 @@ env:
118
136
value: ${sidecar_uami}
119
137
```
120
138
121
-
### Notes
122
-
- All exported variables are printed in the workflow logs for debugging.
123
-
- Duplicate names (after transformation) are skipped with a warning.
124
-
- This ensures UAMI variables are **safe for shell substitution** and consistent across clusters.
125
-
126
-
139
+
---
127
140
128
-
### ArgoCD / Misc
141
+
## ArgoCD / Misc
129
142
| Name | Required | Type | Default | Description |
0 commit comments