Compliance Oriented Kubernetes Setup for AWS, Google Cloud and Microsoft Azure.
Kubespot is an open source terraform module that attempts to create a complete compliance-oriented Kubernetes setup on AWS, Google Cloud and Azure. These add additional security such as additional system logs, file system monitoring, hard disk encryption and access control. Further, we setup the managed Redis and SQL on each of the Cloud providers with limited access to the Kubernetes cluster so things are further locked down. All of this should lead to setting up a HIPAA / PCI / SOC2 being made straightforward and repeatable.
This covers how we setup your infrastructure on AWS, Google Cloud and Azure. These are the three Cloud Providers that we currently support to run Kubernetes. Further, we use the managed service provided by each of the Cloud Providers. This document covers everything related to how infrastructure is setup within each Cloud, how we create an isolated environment for Compliance and the commonalities between them.
brew install kubectl kubernetes-helm google-cloud-sdk terraform
How to get key for cluster creation (client id and secret)
- Sign in to Azure portal
- Navigate to the Azure Active Directory
- Select "App registrations"
- If there is application already use existing one or create new one as follows
- Click on the "New registration" button to create a new application registration
- select the appropriate supported account type (e.g., "Accounts in this organizational directory only")
- Click on the "Register" button to create the application.
- After application is created, Under "Certificates & secrets," click on the "New client secret" button to create a new client secret.
- Copy the client id and client secret and pass it to cluster creation opszero module
terraform init
terraform plan
terraform apply -auto-approve
terraform destroy -auto-approve
Name | Version |
---|---|
azurerm | ~> 4.30.0 |
Name | Description | Type | Default | Required |
---|---|---|---|---|
acr_id | azure container resource id to provide access for aks | string |
"" |
no |
ad_group_ids | ActiveDirectory Groups that have access to this cluster | list |
[] |
no |
ad_user_ids | ActiveDirectory users that have access to the kubernetes admin group and attached to the cluster | list |
[] |
no |
address_spaces | List of address spaces for the VNet | list(string) |
[ |
no |
aks_sku_tier | aks sku tier. Possible values are Free ou Paid | string |
"Free" |
no |
allocation_method | Allocation method for the public IP | string |
"Static" |
no |
azurerm_resource_group_enabled | Enable creation of a new DDoS protection plan | bool |
true |
no |
cidr | The address space that is used the virtual network | string |
"10.0.0.0" |
no |
cluster_name | n/a | string |
"aks" |
no |
cmk_enabled | Flag to control resource creation related to cmk encryption. | bool |
false |
no |
create_nat_gateway | Flag to create NAT Gateway | bool |
false |
no |
default_node_pool | Default node pool configuration | object({ |
n/a | yes |
default_tags | Base tags applied to all resources | map(string) |
{ |
no |
delegation | Delegation of subnet resources | map(list(object({ |
{} |
no |
dns_servers | List of DNS servers | list(string) |
[] |
no |
edge_zone | Specifies the Edge Zone within the Azure Region where this Managed Kubernetes Cluster should exist. Changing this forces a new resource to be created. | string |
null |
no |
enable | Enable creation of a new DDoS protection plan | bool |
true |
no |
enable_azure_policy | Enable Azure Policy Addon. | bool |
true |
no |
enable_ddos_pp | Enable creation of a new DDoS protection plan | bool |
false |
no |
enable_http_application_routing | Enable HTTP Application Routing Addon (forces recreation). | bool |
false |
no |
enable_route_table | Flag to enable Route Table | bool |
false |
no |
enabled | Enable resource group creation and related resources. | bool |
true |
no |
environment_name | Name of the environment to create resources | string |
"" |
no |
existing_ddos_pp | Use an existing DDoS protection plan ID | string |
null |
no |
image_cleaner_enabled | (Optional) Specifies whether Image Cleaner is enabled. | bool |
false |
no |
image_cleaner_interval_hours | (Optional) Specifies the interval in hours when images should be cleaned up. Defaults to 48 . |
number |
48 |
no |
key_vault_id | Specifies the URL to a Key Vault Key (either from a Key Vault Key, or the Key URL for the Key Vault Secret | string |
"" |
no |
kubernetes_version | Version of Kubernetes to deploy | string |
"1.32.2" |
no |
linux_profile | Username and ssh key for accessing AKS Linux nodes with ssh. | object({ |
null |
no |
local_account_disabled | Whether local account should be disable or not | bool |
false |
no |
location | The Azure region where the resource group will be created. | string |
"East US" |
no |
lock_level | The level of the lock. Can be 'CanNotDelete' or 'ReadOnly'. | string |
"CanNotDelete" |
no |
mariadb_sql_enabled | Specify whether the mariadb is enabled | bool |
true |
no |
mariadb_sql_version | Specify the version of MariaDB to use. Possible values are 10.2 and 10.3 | string |
"10.2" |
no |
nat_gateway_idle_timeout | Timeout in minutes for idle NAT Gateway | number |
4 |
no |
network_plugin | Network plugin to use for networking. | string |
"azure" |
no |
network_policy | (Optional) Sets up network policy to be used with Azure CNI. Network policy allows us to control the traffic flow between pods. Currently supported values are calico and azure. Changing this forces a new resource to be created. | string |
null |
no |
node_resource_group | Name of the resource group in which to put AKS nodes. If null default to MC_ | string |
null |
no |
nodes_desired_capacity | The number of Amazon EC2 instances that should be running in the group | number |
1 |
no |
nodes_pools | List of additional node pools | list(object({ |
[] |
no |
notes | Optional notes about the lock. | string |
"Resource group lock to prevent accidental deletion" |
no |
outbound_type | The outbound (egress) routing method which should be used for this Kubernetes Cluster. Possible values are loadBalancer and userDefinedRouting . |
string |
"loadBalancer" |
no |
postgres_sql_enabled | Specify whether postgres sql is enabled | bool |
false |
no |
postgres_sql_version | Specify the version of PostgreSQL to use. Valid values are 9.5, 9.6, 10, 10.0, and 11 | string |
"11" |
no |
prefix | (Optional) The prefix for the resources created in the specified Azure Resource Group. Omitting this variable requires both var.cluster_log_analytics_workspace_name and var.cluster_name have been set. Only one of var.prefix,var.dns_prefix_private_cluster can be specified. |
string |
"" |
no |
private_cluster_enabled | Configure AKS as a Private Cluster : https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_cluster#private_cluster_enabled | bool |
false |
no |
private_dns_zone_id | Id of the private DNS Zone when <private_dns_zone_type> is custom | string |
null |
no |
private_dns_zone_type | n/a | string |
null |
no |
redis_capacity | The size of the Redis cache to deploy | number |
1 |
no |
redis_enabled | Specify whether the redis cluster is enabled | bool |
false |
no |
redis_family | The SKU family/pricing group to use. Valid values are C (for Basic/Standard SKU family) and P (for Premium) | string |
"C" |
no |
redis_shard_count | Only available when using the Premium SKU The number of Shards to create on the Redis Cluster | number |
0 |
no |
redis_sku_name | The SKU of Redis to use. Possible values are Basic, Standard and Premium | string |
"Standard" |
no |
region | The Azure Region where the Resource Group should exist. | string |
"Central US" |
no |
registry_enabled | Specify whether the container registry is enabled | bool |
true |
no |
registry_name | n/a | string |
"acrprodtyj" |
no |
resource_group_name | Use an existing DDoS protection plan ID | string |
"" |
no |
resource_lock_enabled | Flag to enable resource lock on the resource group. | bool |
false |
no |
role_based_access_control_enabled | Whether role based acces control should be enabled or not | bool |
true |
no |
route_table_name | Name of the route table | string |
null |
no |
routes | Routes to be added to the route table | list(object({ |
[] |
no |
service_cidr | CIDR used by kubernetes services (kubectl get svc). | string |
"10.0.0.0/16" |
no |
service_endpoint_policy_ids | Service Endpoint Policy IDs for subnet | list(string) |
null |
no |
service_endpoints | Service Endpoints for subnet | list(string) |
[] |
no |
sku | SKU for the Public IP | string |
"Standard" |
no |
sku_name | SKU for NAT Gateway | string |
"Standard" |
no |
specific_name_subnet | Specific subnet names if needed | bool |
false |
no |
specific_subnet_names | n/a | list(string) |
[] |
no |
sql_master_password | The Password associated with the administrator_login for the PostgreSQL/MariaDB Server | string |
"" |
no |
sql_master_username | The Administrator login for the PostgreSQL/MariabDB Server | string |
"prod" |
no |
sql_sku_name | Specify the SKU Name for this PostgreSQL Server | string |
"GP_Gen5_2" |
no |
sql_storage_in_mb | Max storage allowed for a MariaDB server | number |
10240 |
no |
subnet_names | Subnet names | list(string) |
[] |
no |
subnet_prefixes | Subnet prefixes for address allocation | list(string) |
[] |
no |
tags | Additional tags that override or extend default_tags | map(string) |
{} |
no |
timeouts | Timeout values for resource group operations. | object({ |
{} |
no |
zones | Zones for NAT Gateway | list(string) |
[] |
no |
Name | Description |
---|---|
aks_cluster_name | The name of the AKS cluster |
aks_fqdn | FQDN of the AKS cluster |
aks_kube_config | Raw kubeconfig for the AKS cluster |
nat_gateway_id | The ID of the NAT Gateway |
redis_id | ID of the Redis cache |
registry_name | Name of the Azure Container Registry |
resource_group_location | The location of the created resource group |
resource_group_name | The name of the created resource group |
subnet_id | n/a |
subnet_ids | The IDs of the created subnets |
vnet_id | The ID of the created Virtual Network |
Since 2016 opsZero has been providing Kubernetes expertise to companies of all sizes on any Cloud. With a focus on AI and Compliance we can say we seen it all whether SOC2, HIPAA, PCI-DSS, ITAR, FedRAMP, CMMC we have you and your customers covered.
We provide support to organizations in the following ways:
- Modernize or Migrate to Kubernetes
- Cloud Infrastructure with Kubernetes on AWS, Azure, Google Cloud, or Bare Metal
- Building AI and Data Pipelines on Kubernetes
- Optimizing Existing Kubernetes Workloads
We do this with a high-touch support model where you:
- Get access to us on Slack, Microsoft Teams or Email
- Get 24/7 coverage of your infrastructure
- Get an accelerated migration to Kubernetes
Please schedule a call if you need support.