-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
1,584 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.certs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Work in progress! | ||
|
||
Started cililum-26 with these network options: | ||
|
||
AKS_NETWORK_OPTIONS=( | ||
--network-plugin "azure" | ||
--network-plugin-mode overlay | ||
--network-dataplane cilium | ||
) | ||
Setup Advanced Networking with managed Cilium, but bring your own Grafana/Prometheus | ||
https://learn.microsoft.com/en-us/azure/aks/advanced-network-observability-bring-your-own-cli?tabs=non-cilium | ||
|
||
az aks update --resource-group clusters-dev --name cilium-26 --enable-advanced-network-observability | ||
```shell | ||
k get pods -n kube-system -l k8s-app=hubble-relay | ||
# NAME READY STATUS RESTARTS AGE | ||
# hubble-relay-55b65f695c-6bnwk 1/1 Running 0 4m9s | ||
``` | ||
Level 7 / DNS & HTTP visiblity: | ||
https://docs.cilium.io/en/latest/observability/visibility/#layer-7-protocol-visibility | ||
|
||
Note: We should enable --hubble-redact-enabled to redact sensitive http data like query/headers/auth cookies etc | ||
|
||
```shell | ||
kubectl port-forward svc/hubble-ui 12000:80 -n kube-system | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
apiVersion: cilium.io/v2 | ||
kind: CiliumNetworkPolicy | ||
metadata: | ||
name: "tofqdn-dns-visibility" | ||
namespace: kube-system | ||
spec: | ||
endpointSelector: | ||
matchLabels: {} | ||
# matchLabels: | ||
# any:org: alliance | ||
egress: | ||
- toEndpoints: | ||
- matchLabels: | ||
"k8s:io.kubernetes.pod.namespace": kube-system | ||
"k8s:k8s-app": kube-dns | ||
toPorts: | ||
- ports: | ||
- port: "53" | ||
protocol: ANY | ||
rules: | ||
dns: | ||
- matchPattern: "*" | ||
# - toFQDNs: | ||
# - matchName: "equinor.com" | ||
# - matchName: "sub.cilium.io" | ||
# - matchPattern: "*.sub.cilium.io" | ||
--- | ||
apiVersion: "cilium.io/v2" | ||
kind: CiliumNetworkPolicy | ||
metadata: | ||
name: "l7-visibility" | ||
spec: | ||
endpointSelector: | ||
matchLabels: | ||
"k8s:io.kubernetes.pod.namespace": radix-web-console-qa | ||
egress: | ||
- toPorts: | ||
- ports: | ||
- port: "53" | ||
protocol: ANY | ||
rules: | ||
dns: | ||
- matchPattern: "*" | ||
- toEndpoints: | ||
- matchLabels: | ||
"k8s:io.kubernetes.pod.namespace": default | ||
toPorts: | ||
- ports: | ||
- port: "80" | ||
protocol: TCP | ||
- port: "8000" | ||
protocol: TCP | ||
- port: "8080" | ||
protocol: TCP | ||
- port: "3000" | ||
protocol: TCP | ||
- port: "3001" | ||
protocol: TCP | ||
- port: "3002" | ||
protocol: TCP | ||
- port: "3003" | ||
protocol: TCP | ||
rules: | ||
http: [{}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
set -x | ||
|
||
# Directory where certificates will be stored | ||
CERT_DIR="$(pwd)/.certs" | ||
mkdir -p "$CERT_DIR" | ||
|
||
declare -A CERT_FILES=( | ||
["tls.crt"]="tls-client-cert-file" | ||
["tls.key"]="tls-client-key-file" | ||
["ca.crt"]="tls-ca-cert-files" | ||
) | ||
|
||
for FILE in "${!CERT_FILES[@]}"; do | ||
KEY="${CERT_FILES[$FILE]}" | ||
JSONPATH="{.data['${FILE//./\\.}']}" | ||
|
||
# Retrieve the secret and decode it | ||
kubectl get secret hubble-relay-client-certs -n kube-system \ | ||
-o jsonpath="${JSONPATH}" | \ | ||
base64 -d > "$CERT_DIR/$FILE" | ||
|
||
# Set the appropriate hubble CLI config | ||
hubble config set "$KEY" "$CERT_DIR/$FILE" | ||
done | ||
|
||
hubble config set tls true | ||
hubble config set tls-server-name instance.hubble-relay.cilium.io |
Oops, something went wrong.