Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ description: Enable Calico network policy in AKS.
title: Installing on AKS
---

import ProductAdvocate from '/src/___new___/components/ProductAdvocate';

# Microsoft Azure Kubernetes Service (AKS)

## Big picture

Enable $[prodname] in AKS managed Kubernetes service.

<ProductAdvocate />

## Value

AKS has built-in support for $[prodname], providing a robust implementation of the full Kubernetes Network Policy API. AKS users wanting to go beyond Kubernetes network policy capabilities can make full use of the $[prodname] Network Policy API.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ title: Installing on EKS

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import ProductAdvocate from '/src/___new___/components/ProductAdvocate';

## Big picture

Enable $[prodname] in EKS managed Kubernetes service.

<ProductAdvocate />

## Value

EKS has built-in support for $[prodname], providing a robust implementation of the full Kubernetes Network Policy API. EKS users wanting to go beyond Kubernetes network policy capabilities can make full use of the Calico Network Policy API.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ description: Review the requirements for using OpenShift with Calico.
title: System requirements
---


import ProductAdvocate from '/src/___new___/components/ProductAdvocate';
import SystemRequirements from '../../../_includes/partials/_system-requirements.mdx';
export const platform='openshift';

# System requirements for OpenShift

<ProductAdvocate messageId="ovn-to-calico" />

<SystemRequirements platform={platform} />

3 changes: 3 additions & 0 deletions calico/getting-started/kubernetes/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ description: Quickstart for Calico.
---

import Screenshot from '/src/___new___/components/Screenshot';
import ProductAdvocate from '/src/___new___/components/ProductAdvocate';

export let figCount = 1;

# Calico quickstart guide
Expand All @@ -23,6 +25,7 @@ You'll need to install a few tools to complete this tutorial:
This is the tool you'll use to interact with your cluster.
For installation instructions, see the [Kubernetes documentation](https://kubernetes.io/docs/tasks/tools/#kubectl)

<ProductAdvocate />

## Step 1: Create a cluster

Expand Down
5 changes: 5 additions & 0 deletions calico/getting-started/kubernetes/rancher.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@ description: Install Calico on a Rancher Kubernetes Engine cluster.
title: Installing on RKE
---

import ProductAdvocate from '/src/___new___/components/ProductAdvocate';

# Rancher Kubernetes Engine (RKE)

## Big picture

Install $[prodname] as the required CNI for networking and/or network policy on Rancher-deployed clusters.

<ProductAdvocate />


## Concepts

$[prodname] supports the Calico CNI with Calico network policy:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ description: Enable Calico network policy in AKS.
title: Installing on AKS
---

import ProductAdvocate from '/src/___new___/components/ProductAdvocate';

# Microsoft Azure Kubernetes Service (AKS)

## Big picture

Enable $[prodname] in AKS managed Kubernetes service.

<ProductAdvocate />

## Value

AKS has built-in support for $[prodname], providing a robust implementation of the full Kubernetes Network Policy API. AKS users wanting to go beyond Kubernetes network policy capabilities can make full use of the $[prodname] Network Policy API.
Expand All @@ -35,6 +39,7 @@ The geeky details of what you get:
details='Policy:Calico,IPAM:Azure,CNI:Azure,Overlay:Yes,Routing:VPC Native,Datastore:Kubernetes'
/>


To enable $[prodname] network policy enforcement, follow these step-by-step instructions: [Create an AKS cluster and enable network policy](https://docs.microsoft.com/en-us/azure/aks/use-network-policies).

### Install AKS with $[prodname] networking
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ title: Installing on EKS

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import ProductAdvocate from '/src/___new___/components/ProductAdvocate';

## Big picture

Enable $[prodname] in EKS managed Kubernetes service.

<ProductAdvocate />

## Value

EKS has built-in support for $[prodname], providing a robust implementation of the full Kubernetes Network Policy API. EKS users wanting to go beyond Kubernetes network policy capabilities can make full use of the Calico Network Policy API.
Expand All @@ -29,6 +32,7 @@ The geeky details of what you get:
details='Policy:Calico,IPAM:AWS,CNI:AWS,Overlay:No,Routing:VPC Native,Datastore:Kubernetes'
/>


:::note

When using the Amazon VPC CNI plugin, $[prodname] does not support enforcement of network policy on IPv6 pods with `ENABLE_V4_EGRESS` set to `true`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ title: System requirements


import SystemRequirements from '../../../_includes/partials/_system-requirements.mdx';
import ProductAdvocate from '/src/___new___/components/ProductAdvocate';

export const platform='openshift';

# System requirements for OpenShift

<ProductAdvocate messageId="ovn-to-calico" />

<SystemRequirements platform={platform} />
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ description: Quickstart for Calico.
---

import Screenshot from '/src/___new___/components/Screenshot';
import ProductAdvocate from '/src/___new___/components/ProductAdvocate';

export let figCount = 1;

# Calico quickstart guide
Expand All @@ -23,6 +25,7 @@ You'll need to install a few tools to complete this tutorial:
This is the tool you'll use to interact with your cluster.
For installation instructions, see the [Kubernetes documentation](https://kubernetes.io/docs/tasks/tools/#kubectl)

<ProductAdvocate />

## Step 1: Create a cluster

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@ description: Install Calico on a Rancher Kubernetes Engine cluster.
title: Installing on RKE
---

import ProductAdvocate from '/src/___new___/components/ProductAdvocate';

# Rancher Kubernetes Engine (RKE)

## Big picture

Install $[prodname] as the required CNI for networking and/or network policy on Rancher-deployed clusters.

<ProductAdvocate />


## Concepts

$[prodname] supports the Calico CNI with Calico network policy:
Expand Down
45 changes: 45 additions & 0 deletions src/___new___/components/ProductAdvocate/advocacyMessages.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
export interface AdvocacyMessage {
id: string;
title: string;
description: string;
socialProof: string;
imageUrl: string;
imageAlt: string;
overlayBadge: string;
link: string;
bgGradient?: string;
}

export const advocacyMessages: AdvocacyMessage[] = [
{
id: "security-first",
title: "Zero Trust Network Security for Kubernetes",
description: "Implement zero-trust security principles with Calico's advanced network policies. Protect your workloads with micro-segmentation and threat detection that adapts to your environment.",
socialProof: "🔐 Securing 50M+ containers globally",
imageUrl: "https://www.tigera.io/app/uploads/2023/02/tutorial-observability-troubleshooting-532x200-1.png",
imageAlt: "Cybersecurity and network protection concept",
overlayBadge: "🛡️ Zero Trust",
link: "https://www.tigera.io/learn/guides/security/zero-trust/",
},
{
id: "observability",
title: "Real-time Network Visibility & Monitoring with Calico Whisker",
description: "Gain complete visibility into your network traffic with Calico's advanced observability tools. Monitor, analyze, and troubleshoot network issues with powerful dashboards and alerts.",
socialProof: "📈 99.9% uptime guarantee",
imageUrl: "https://www.tigera.io/app/uploads/2025/05/tutorial-Kubernetes-with-Whisker-532x200-1.png",
imageAlt: "Data analytics and monitoring dashboard",
overlayBadge: "📊 Live Monitoring",
link: "https://www.tigera.io/tutorials/?_sf_s=Kubernetes%20Observability%20with%20Calico%20Whisker",
},
{
id: "vmware-migration",
title: "VM migration using Kubevirt and Calico",
description: "Learn how to run virtual machines in a Kubernetes environment",
socialProof: "🎓 Interactive course in your browser!",
imageUrl: "https://www.tigera.io/app/uploads/2023/01/tutorial-VM-migration-Kubevirt-Calico-532x200-1.png",
imageAlt: "Team collaboration and support",
overlayBadge: "🎓 Free Course",
link: "https://www.tigera.io/tutorials/?_sf_s=VM%20migration%20using%20Kubevirt%20and%20Calico",
bgGradient: "linear(to-r, cyan.500, blue.500)"
}
];
115 changes: 115 additions & 0 deletions src/___new___/components/ProductAdvocate/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
import * as React from 'react';
import { Card, CardBody, Image, Text, Heading, Box, Flex } from "@chakra-ui/react"
import { advocacyMessages, AdvocacyMessage } from './advocacyMessages';

interface ProductAdvocateProps {
messageId?: string;
}


Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sure you format this file


const ProductAdvocate: React.FC<ProductAdvocateProps> = ({ messageId, ...rest }) => {

// Select message based on messageId or randomly if not provided
const [selectedMessage] = React.useState(() => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to use state here. Just assign it to a variable

const selectedMessage = advocacyMessages.find(msg => msg.id === messageId ?? fallbackId);

Or better yet, use an object instead of an array

const selectedMessage = advocacyMessages[messageId ?? fallbackId];

You could create a type from your message ids and use that in your props for better typing

if (messageId) {
const targetedMessage = advocacyMessages.find(msg => msg.id === messageId);
if (targetedMessage) {
return targetedMessage;
}
// Fallback to random if messageId not found
console.warn(`Message with ID "${messageId}" not found, falling back to random selection`);
}

const randomIndex = Math.floor(Math.random() * advocacyMessages.length);
return advocacyMessages[randomIndex];
});

const handleCardClick = () => {
window.open(selectedMessage.link, '_blank');
};

// Default gradient fallback
const defaultGradient = "linear(to-r, blue.500, purple.600)";

return (
<Card
w="100%"
maxW="100%"
h={{ base: "auto", md: "150px" }}
maxH="150px"
overflow="hidden"
bgGradient={selectedMessage.bgGradient || defaultGradient}
color="white"
boxShadow="xl"
borderRadius="lg"
position="relative"
_hover={{ transform: 'translateY(-2px)', boxShadow: '2xl', cursor: 'pointer' }}
transition="all 0.3s ease"
onClick={handleCardClick}
>
<Flex direction={{ base: "column", md: "row" }} align="center" h="100%">
<CardBody flex="1" p={{ base: 4, md: 6 }} h="100%" display="flex" flexDirection="column" justifyContent="center">
<Flex direction="column" h="100%" justify="space-between">
<Box>
<Heading _firstLetter={{ textTransform: "uppercase" }}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because you're using a heading, this is showing in the TOC. Not sure if you meant that? @ctauchen

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you really need to use textTransform: "uppercase". Your content is static and can be controlled from the data.

size="md"
mb={2}
bgGradient="linear(to-r, yellow.200, orange.200)"
bgClip="text"
fontWeight="bold"
lineHeight="tight"
noOfLines={1}
>
{selectedMessage.title}
</Heading>

<Text fontSize="sm" mb={3} opacity={0.9} lineHeight="tight" noOfLines={2}>
{selectedMessage.description}
</Text>
</Box>

<Box>
<Text fontSize="xs" opacity={0.7} noOfLines={1}>
{selectedMessage.socialProof}
</Text>
</Box>
</Flex>
</CardBody>

<Box
flexShrink={0}
w={{ base: "100%", md: "200px" }}
h={{ base: "120px", md: "150px" }}
position="relative"
>
<Image
src={selectedMessage.imageUrl}
alt={selectedMessage.imageAlt}
w="100%"
h="100%"
objectFit="cover"
borderLeftRadius={{ base: "none", md: "lg" }}
borderTopRadius={{ base: "lg", md: "none" }}
/>
<Box
position="absolute"
top={2}
right={2}
bg="blackAlpha.700"
color="white"
px={2}
py={0.5}
borderRadius="sm"
fontSize="xs"
fontWeight="bold"
>
{selectedMessage.overlayBadge}
</Box>
</Box>
</Flex>
</Card>
);
};

export default ProductAdvocate;
23 changes: 23 additions & 0 deletions src/___new___/components/ProductAdvocate/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
How advocate works?
===
pretty simple add the following import to the document header
```
import ProductAdvocate from '/src/___new___/components/ProductAdvocate';
```

add the following code to where you want the advocate to appear
```
<ProductAdvocate />
```

> note you can provide an id to get a specific message for a page.

for exmaple:

Check failure on line 15 in src/___new___/components/ProductAdvocate/readme.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'exmaple'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'exmaple'?", "location": {"path": "src/___new___/components/ProductAdvocate/readme.md", "range": {"start": {"line": 15, "column": 5}}}, "severity": "ERROR"}
```
<ProductAdvocate messageId="ebpf" />
```
this will link your advocate to the id in the `advocacyMessages.ts` file.

How can I change/add/delete a message?
===
navigate to advocacyMessages.ts and do your thing.
Empty file.