As compute demand grows and climate change worsens, it's "paramount to be energy conscious" as an industry, Microsoft Azure Principal Product Management Lead Jorge Palma said during a KubeCon Europe 2023 keynote.

"We want to make sure that software – which is a big part of our lives – takes center stage in this conversation," but "it hasn't so far, even though software runs the world," Palma argued.

To address the environmental impacts of data centers and cloud computing, The Green Software Foundation outlined principles of sustainable software that should guide both developers and vendors: energy efficiency, hardware efficiency and carbon awareness.

For Microsoft, that first principle of energy efficiency "is all about making sure our code is efficient," Palma explained.

Even still, efficient code needs an efficient machine to run on. "Everything that we do or use today needs carbon to be produced and disposed of," he noted. Using fewer devices and hardware components in product offerings, for example, could reduce the embodied carbon associated with compute.

The third principle, carbon awareness, is focused on the distinction between clean and dirty energy, Palma noted. "It's all about knowing, based on that, when to do more and when to do less," he explained.

Clean, renewable energies like solar, wind and hydroelectric power have a much lower carbon intensity compared to dirty fossil-fuel based energies like oil and gas. Carbon intensity, Palma explained, refers to the measure of how much carbon is produced during the energy creation process.

Given the sun doesn't always shine and the wind doesn't always blow, Palma noted that different combinations of clean and dirty energy are often needed to meet grid power demands. "That will increase our carbon intensity," he noted.

Combating clean energy availability with carbon awareness

But how might the use of wind power or fossil fuels impact Kubernetes and cloud-native applications? "That's where the Kubernetes Event-Driven Autoscaler (KEDA) comes in," Palma said, adding KEDA is in the incubation stage at the Cloud Native Computing Foundation (CNCF).

Microsoft is developing a carbon-aware scaler for the KEDA open source project founded on a demand-shaping feature that automatically scales workloads based on the carbon intensity of the infrastructure those workloads are running on and the energy available in those data center regions.

KEDA is implemented using a Kubernetes operator, which reads infrastructure data based on a configuration map that includes both point-in-time and historical data.

Since some cloud providers won't have that type of data available today, "we actually created another operator that builds on some of the Green Software Foundation's carbon aware software development kit (SDK) – an open source wrapper for public sources of data, so that config map will be created and available for everyone to use and kick the tires on this new carbon-aware scaler," Palma said.