Skip to content

Commit

Permalink
Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
danielscholl committed Jan 22, 2024
1 parent e21568c commit a6cde1d
Show file tree
Hide file tree
Showing 15 changed files with 86 additions and 361 deletions.
60 changes: 36 additions & 24 deletions bicep/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ param cmekConfiguration object = {
identityId: ''
}

// @description('Optional: Specify the AD Users and/or Groups that can manage the cluster.')
// param clusterAdminIds array = []


//*****************************************************************//
// Common Section //
Expand Down Expand Up @@ -1654,39 +1651,54 @@ module configMap './modules/aks_configmap.bicep' = if (enableConfigMap) {
namespace: 'default'
dataMap: [
{
key: 'keyvault'
value: keyvault.outputs.name
key: 'tenant'
value: subscription().tenantId
}
{
key: 'subscription'
value: subscription().subscriptionId
}
{
key: 'clientId'
value: appIdentity.outputs.clientId
}
{
key: 'keyvault'
value: keyvault.outputs.name
}
]
}
dependsOn: [
cluster
keyvault
]
}
// var configmapValues = '--from-literal=keyvault={1} --from-literal=clientId={2}'
// module configMap './modules/aks-run-command/main.bicep' = if (enableConfigMap) {
// name: '${serviceLayerConfig.name}-cluster-configmap'
// params: {
// aksName: cluster.outputs.aksClusterName
// location: location
// commands: [
// format(
// 'kubectl create configmap app-config {0} -n default --save-config',
// format(configmapValues, keyvault.outputs.name, appIdentity.outputs.clientId)
// )
// ]
// cleanupPreference: 'Always'
// }
// dependsOn: [
// cluster
// keyvault
// ]
// }

module workloadIdentityValues './modules/aks_configmap.bicep' = if (enableConfigMap) {
name: '${serviceLayerConfig.name}-configmap-dev-sample'
params: {
cluster: cluster.outputs.aksClusterName
location: location
name: 'workload-identity-values'
namespace: 'default'
dataMap: [
{
key: 'values.yaml'
value: format('''
azureWorkloadIdentity:
clientId: '{0}'
tenantId: '{1}'
''', appIdentity.outputs.clientId, subscription().tenantId)
}
]
}
dependsOn: [
cluster
]
}




//--------------Flux Config---------------
module fluxConfiguration 'br/public:avm/res/kubernetes-configuration/flux-configuration:0.3.1' = if(enableSoftwareLoad) {
Expand Down
3 changes: 3 additions & 0 deletions bicep/main.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
"remoteNetworkPrefix": {
"value": "${REMOTE_NETWORK_PREFIX}"
},
"softwareRepository": {
"value": "${SOFTWARE_REPOSITORY}"
},
"softwareBranch": {
"value": "${SOFTWARE_BRANCH}"
}
Expand Down
5 changes: 1 addition & 4 deletions charts/env-debug/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,5 @@ Install the helm chart.
```bash
# Create Namespace
NAMESPACE=dev-sample
kubectl create namespace $NAMESPACE
# Install Charts
helm install env-tool . -n $NAMESPACE -f custom_values.yaml
helm install dev-sample . -n $NAMESPACE --create-namespace
```
18 changes: 9 additions & 9 deletions charts/env-debug/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# apiVersion: v1
# kind: ServiceAccount
# metadata:
# name: {{ include "env-debug.serviceAccountName" . }}
# annotations:
# azure.workload.identity/client-id: {{ .Values.azureWorkloadIdentity.clientId }}
# azure.workload.identity/tenant-id: {{ .Values.azureWorkloadIdentity.tenantId }}
# labels:
# azure.workload.identity/use: "true"
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "env-debug.serviceAccountName" . }}
annotations:
azure.workload.identity/client-id: {{ .Values.azureWorkloadIdentity.clientId }}
azure.workload.identity/tenant-id: {{ .Values.azureWorkloadIdentity.tenantId }}
labels:
azure.workload.identity/use: "true"
113 changes: 0 additions & 113 deletions charts/env-debug/templates_orig/kv-secrets.yaml

This file was deleted.

44 changes: 0 additions & 44 deletions charts/env-debug/templates_orig/pvc.yaml

This file was deleted.

26 changes: 5 additions & 21 deletions charts/env-debug/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# This file contains the essential configs for the osdu on azure helm chart

replicaCount: 1

nameOverride: ""
Expand All @@ -12,35 +10,21 @@ service:

serviceAccount:
create: true
name: "" #Leave empty and it'll default to the name of the app, thanks to the _helpers.tpl
name: ""

azureWorkloadIdentity:
clientId: ""
tenantId: ""

autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 3
targetCPUUtilizationPercentage: 80

################################################################################
# Specify the azure environment specific values
#
azure:
enabled: false
# tenant: <tenant_id>
# subscription: <subscription_id>
# resourcegroup: <central_resource_group>
# identity: <identity_name>
# identity_id: <identity_id>
# keyvault: <keyvault_name>
# appid: <client_id>

env:
- name: MESSAGE
value: Hello World!
# - name: AZURE_TENANT_ID
# secret:
# name: active-directory
# key: tenantid
# - name: WORKSPACE_ID
# secret:
# name: central-logging
# key: log-workspace-id
10 changes: 5 additions & 5 deletions software/applications/dev-sample/namespace.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ---
# apiVersion: v1
# kind: Namespace
# metadata:
# name: dev-sample
---
apiVersion: v1
kind: Namespace
metadata:
name: dev-sample
26 changes: 11 additions & 15 deletions software/applications/dev-sample/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: env-tool
name: dev-sample
namespace: default
annotations:
clusterconfig.azure.com/use-managed-source: "true"
spec:
chart:
spec:
Expand All @@ -16,29 +18,23 @@ spec:
install:
remediation:
retries: 3
targetNamespace: default
targetNamespace: dev-sample
values:
replicaCount: 1
nameOverride: ""
fullnameOverride: env-debug
service:
type: ClusterIP
port: 80
autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 3
targetCPUUtilizationPercentage: 80
serviceAccount:
create: true
name: ""
azureWorkloadIdentity:
clientId: ""
tenantId: ""
azure:
enabled: false
env:
- name: MESSAGE
value: Hello World!
# - name: AZURE_TENANT_ID
# secret:
# name: active-directory
# key: tenantid
# - name: WORKSPACE_ID
# secret:
# name: central-logging
# key: workspace-id

Loading

0 comments on commit a6cde1d

Please sign in to comment.