$ gcloud certificate-manager maps list
NAME ENDPOINTS DESCRIPTION CREATE_TIME
mcg-cert-map 35.227.220.160:443 2023-12-13 05:34:53 +00:00
# with an existing certificate & entry
$ gcloud certificate-manager certificates list
NAME SUBJECT_ALTERNATIVE_NAMES DESCRIPTION SCOPE EXPIRE_TIME CREATE_TIME UPDATE_TIME
mcg-cert frontend.endpoints.e2m-private-test-01.cloud.goog 2024-03-12 05:34:47 +00:00 2023-12-13 05:34:45 +00:00 2023-12-13 05:34:45 +00:00
This file contains hidden or 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 function decomposes the funky key-value nested CSV event message Dome9 uses for regular alerts | |
| def csv_to_dict(event_message): | |
| regex = r"\[[A-Za-z0-9\s\-_,:/()|\.@=]*\]" | |
| # capture all nested kv in [] | |
| nested_msg = re.findall(regex, event_message) | |
| # remove all nested kv in | |
| msg_pruned = re.sub(regex, '', event_message) | |
| # clip [] from nested message |
This file contains hidden or 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
| apiVersion: apps/v1 | |
| kind: DaemonSet | |
| metadata: | |
| namespace: kube-system | |
| labels: | |
| k8s-app: fluentd-gcp | |
| name: fluentd-gcp-v2.0 | |
| spec: | |
| selector: | |
| matchLabels: |
This file contains hidden or 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
| # no limit - no HPA | |
| kubectl apply -f k8s_deployment-alex-no-limit.yaml | |
| ./hey_linux_amd64 -c 20 -n 100000 http://X.X.X.X/get-time | |
| Summary: | |
| Total: 10.1857 secs | |
| Slowest: 0.0477 secs | |
| Fastest: 0.0008 secs |
This file contains hidden or 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
| command to list labels: | |
| `kubectl get --raw "/apis/external.metrics.k8s.io/v1beta1/namespaces/default/istio.io|service|server|request_count" | jq` | |
| --- | |
| apiVersion: autoscaling/v2beta2 | |
| kind: HorizontalPodAutoscaler | |
| metadata: | |
| name: whereami-hpa | |
| spec: | |
| scaleTargetRef: | |
| apiVersion: apps/v1 |
This file contains hidden or 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
| apiVersion: install.istio.io/v1alpha1 | |
| kind: IstioOperator | |
| spec: | |
| values: | |
| gateways: | |
| istio-ingressgateway: | |
| type: ClusterIP |
This file contains hidden or 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
| $ kubectl get svc -n istio-system istio-ingressgateway -o yaml | |
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| annotations: | |
| cloud.google.com/app-protocols: '{"https":"HTTP2"}' | |
| cloud.google.com/backend-config: '{"default": "ingress-backendconfig"}' | |
| cloud.google.com/neg: '{"ingress": true}' | |
| cloud.google.com/neg-status: '{"network_endpoint_groups":{"443":"k8s1-61a1ca57-istio-system-istio-ingressgateway-443-f5dc8e1b"},"zones":["us-west1-a"]}' | |
| kubectl.kubernetes.io/last-applied-configuration: | |
This file contains hidden or 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
| $ kubectl get mcs -n istio-system -o yaml | |
| apiVersion: v1 | |
| items: | |
| - apiVersion: networking.gke.io/v1 | |
| kind: MultiClusterService | |
| metadata: | |
| annotations: | |
| beta.cloud.google.com/backend-config: '{"ports": {"443":"gke-ingress-config"}}' | |
| kubectl.kubernetes.io/last-applied-configuration: | | |
| {"apiVersion":"networking.gke.io/v1beta1","kind":"MultiClusterService","metadata":{"annotations":{"beta.cloud.google.com/backend-config":"{\"ports\": {\"443\":\"gke-ingress-config\"}}","networking.gke.io/app-protocols":"{\"http2\":\"HTTP2\"}"},"name":"istio-ingressgateway-multicluster-svc-1","namespace":"istio-system"},"spec":{"clusters":[{"link":"us-central1/mci-us-central1-01"},{"link":"us-east1/mci-us-east1-01"}],"template":{"spec":{"ports":[{"name":"http2","port":443,"protocol":"TCP","targetPort":8443}],"selector":{"app":"istio-ingressgateway"}}}}} |
This file contains hidden or 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 environment is 2 x clusters across 2 regions (`us-west2` and `us-central1`) with MCI in front of it with HTTPS using managed certificates | |
| i'm using a demo app i wrote called whereami hosted at https://github.com/GoogleCloudPlatform/kubernetes-engine-samples/tree/main/whereami | |
| x-cluster service discovery is enabled and i have not turned on locality load balancing, so you can see the negative impact of not using LLB from a latency perspecive | |
| test by curling the two hostnames, `frontend-1.endpoints.mci-asm-mcp.cloud.goog` and `frontend-2.endpoints.mci-asm-mcp.cloud.goog`, which are both on the same MCI resource | |
| ``` | |
| $ curl https://frontend-2.endpoints.mci-asm-mcp.cloud.goog/ | |
| { | |
| "backend_result": { | |
| "cluster_name": "gke-us-central1", | |
| "host_header": "whereami-backend-2.backend-2.svc.cluster.local", |
This file contains hidden or 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
| ### i just did an install of Istio demo profile so this is more open than it should be re: ports, but the annotations are the important bit | |
| ### i also reference a backend-config (as described in https://cloud.google.com/architecture/exposing-service-mesh-apps-through-gke-ingress#apply_backend_service_settings) | |
| ### *but* because you've already got the LB created you may have to manually create the health check to /healthz/ready on 15021 | |
| ### note the /neg annotation - i've named mine `https-443` | |
| ### my gateway resource looks almost identical to https://cloud.google.com/architecture/exposing-service-mesh-apps-through-gke-ingress#configure_the_ingress_gateway_for_external_load_balancing | |
| ### except for my istio setup the namespace is `istio-system` and the selector is `app: istio-ingressgateway` | |
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| annotations: |
OlderNewer