Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup: adding DRIFT region tags to yaml and sh files #173

Merged
merged 18 commits into from
Mar 2, 2022
Merged
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
3 changes: 3 additions & 0 deletions anthos-bm-gcp-terraform/resources/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START anthosbaremetal_resources_init]

##############################################################################
# Commands starting with leading double underscores (__) nand ending with
Expand Down Expand Up @@ -243,3 +244,5 @@ function __print_separator__ () {

# Run the script from main()
__main__ "$@"

# [END anthosbaremetal_resources_init]
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START anthosbaremetal_resources_run_initialization_checks]

LOG_FILE=$(cut -d "=" -f2- <<< "$(grep < init.vars LOG_FILE)")
HOSTNAMES=$(cut -d "=" -f2- <<< "$(grep < init.vars HOSTNAMES)")
Expand Down Expand Up @@ -109,3 +110,5 @@ function __print_loading__ () {

# Run the script from main()
__main__ "$@"

# [END anthosbaremetal_resources_run_initialization_checks]
3 changes: 2 additions & 1 deletion anthos-bm-gcp-terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ variable "gce_vm_service_account" {
type = string
default = ""
}

# [START anthosbaremetal_node_prefix]
# [START anthos_bm_node_prefix]
###################################################################################
# The recommended instance count for High Availability (HA) is 3 for Control plane
Expand All @@ -183,3 +183,4 @@ variable "instance_count" {
}
}
# [END anthos_bm_node_prefix]
# [END anthosbaremetal_node_prefix]
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash

# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -13,6 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START anthosbaremetal_resources_abm_cluster_login]
KSA_NAME=edga-sa

echo "-------------------------------------------------------------------"
Expand Down Expand Up @@ -57,3 +59,5 @@ echo ""
echo "🚀 ------------------------------TOKEN-------------------------------- 🚀"
echo "$TOKEN"
echo "🚀 ------------------------------------------------------------------- 🚀"

# [END anthosbaremetal_resources_abm_cluster_login]
5 changes: 5 additions & 0 deletions anthos-bm-openstack-terraform/resources/abm_init_host.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash

# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -13,6 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START anthosbaremetal_resources_abm_init_host]

##############################################################################
# Commands starting with leading double underscores (__) nand ending with
# double underscores denote functions defined in this script.
Expand Down Expand Up @@ -118,3 +121,5 @@ function __print_separator__ () {

# Run the script from main()
__main__ "$@"

# [END anthosbaremetal_resources_abm_init_host]
5 changes: 5 additions & 0 deletions anthos-bm-openstack-terraform/resources/abm_setup_gcp.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash

# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -13,6 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START anthosbaremetal_resources_abm_setup_gcp]

##############################################################################
# Download the service account key in order to configure the Anthos cluster
##############################################################################
Expand Down Expand Up @@ -104,3 +107,5 @@ gcloud projects add-iam-policy-binding $PROJECT_ID \
gcloud projects add-iam-policy-binding $PROJECT_ID \
--member="serviceAccount:${SERVICE_ACCOUNT}@$PROJECT_ID.iam.gserviceaccount.com" \
--role="roles/opsconfigmonitoring.resourceMetadata.writer"

# [END anthosbaremetal_resources_abm_setup_gcp]
4 changes: 4 additions & 0 deletions anthos-bm-openstack-terraform/resources/create-certs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START anthosbaremetal_resources_create_certs]

# Define where to store the generated certs and metadata.
DIR="$(pwd)/tls"

Expand Down Expand Up @@ -136,3 +138,5 @@ openssl x509 -in "${DIR}/my-service.crt" -noout -text
# X509v3 Subject Alternative Name:
# IP Address:1.2.3.4, DNS:my.dns.name
#

# [END anthosbaremetal_resources_create_certs]
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START anthos_resources_point_of_sales_service_service_api_server_lb]
####################################################
# Services - Type LoadBalancer
####################################################
Expand All @@ -27,3 +28,4 @@ spec:
- name: http
port: 80
targetPort: 8080
# [END anthos_resources_point_of_sales_service_service_api_server_lb]
14 changes: 14 additions & 0 deletions anthos-bm-openstack-terraform/resources/point-of-sales.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START anthosbaremetal_resources_point_of_sales_configmap_service_configs]
####################################################
# ConfigMap
####################################################
Expand Down Expand Up @@ -50,7 +51,9 @@ data:
imageUrl: "usr/lib/images/short.png"
quantity: 20
labels: [ "retail", "textile", "clothing" ]
# [END anthosbaremetal_resources_point_of_sales_configmap_service_configs]
---
# [START anthosbaremetal_resources_point_of_sales_deployment_api_server]
####################################################
# Deployments - API Server
####################################################
Expand Down Expand Up @@ -104,7 +107,9 @@ spec:
initialDelaySeconds: 120
periodSeconds: 5
timeoutSeconds: 10
# [END anthosbaremetal_resources_point_of_sales_deployment_api_server]
---
# [START anthosbaremetal_resources_point_of_sales_deployment_payments]
####################################################
# Deployments - Payments Service
####################################################
Expand Down Expand Up @@ -147,7 +152,9 @@ spec:
initialDelaySeconds: 120
periodSeconds: 5
timeoutSeconds: 10
# [END anthosbaremetal_resources_point_of_sales_deployment_payments]
---
# [START anthosbaremetal_resources_point_of_sales_deployment_inventory]
####################################################
# Deployments - Inventory Servies
####################################################
Expand Down Expand Up @@ -206,7 +213,9 @@ spec:
initialDelaySeconds: 120
periodSeconds: 5
timeoutSeconds: 10
# [END anthosbaremetal_resources_point_of_sales_deployment_inventory]
---
# [START anthosbaremetal_resources_point_of_sales_service_api_server_svc]
####################################################
# Services - Type ClusterIP
####################################################
Expand All @@ -222,7 +231,9 @@ spec:
- name: http
port: 8080
targetPort: 8080
# [END anthosbaremetal_resources_point_of_sales_service_api_server_svc]
---
# [START anthosbaremetal_resources_point_of_sales_service_payments_svc]
apiVersion: v1
kind: Service
metadata:
Expand All @@ -235,7 +246,9 @@ spec:
- name: http
port: 8080
targetPort: 8080
# [END anthosbaremetal_resources_point_of_sales_service_payments_svc]
---
# [START anthosbaremetal_resources_point_of_sales_service_inventory_svc]
apiVersion: v1
kind: Service
metadata:
Expand All @@ -248,3 +261,4 @@ spec:
- name: http
port: 8080
targetPort: 8080
# [END anthosbaremetal_resources_point_of_sales_service_inventory_svc]
3 changes: 2 additions & 1 deletion anthos-bm-openstack-terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ variable "ssh_key_name" {
EOF
type = string
}

# [START anthosbaremetal_openstack_node_count]
# [START anthos_bm_openstack_node_count]
###################################################################################
# The recommended instance count for High Availability (HA) is 3 for Control plane
Expand All @@ -107,3 +107,4 @@ variable "instance_count" {
}
}
# [END anthos_bm_openstack_node_count]
# [END anthosbaremetal_openstack_node_count]
4 changes: 4 additions & 0 deletions anthos-multi-cloud/AWS/modules/scripts/create_vars.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash

# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -13,6 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START anthos_scripts_create_vars]

# create vars.sh file
set -e
Expand All @@ -38,3 +40,5 @@ export NODE_POOL_INSTANCE_TYPE=${14}
#SSH_KEY_PAIR_NAME=

EOF

# [END anthos_scripts_create_vars]
4 changes: 4 additions & 0 deletions anthos-multi-cloud/Azure/modules/scripts/create_vars.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash

# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -13,6 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START anthos_scripts_create_vars]

# create vars.sh file
set -e
Expand All @@ -27,3 +29,5 @@ export SSH_PUBLIC_KEY=${5}
export SUBNET_ID=${6}

EOF

# [END anthos_scripts_create_vars]
14 changes: 14 additions & 0 deletions attached-logging-monitoring/logging/aggregator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START anthos_logging_aggregator_serviceaccount_stackdriver_log_aggregator]
# Service account for Log Aggregator (Fluentd).
apiVersion: v1
kind: ServiceAccount
metadata:
name: stackdriver-log-aggregator
namespace: kube-system
# [END anthos_logging_aggregator_serviceaccount_stackdriver_log_aggregator]
---
# [START anthos_logging_aggregator_service_stackdriver_log_aggregator_in_forward]
# Service to expose in_forward plugin port on the Log Aggregator (Fluentd) side.
kind: Service
apiVersion: v1
Expand All @@ -38,7 +41,9 @@ spec:
sessionAffinity: None
selector:
app: stackdriver-log-aggregator
# [END anthos_logging_aggregator_service_stackdriver_log_aggregator_in_forward]
---
# [START anthos_logging_aggregator_networkpolicy_stackdriver_log_aggregator_in_forward]
# Network policy to only allow Log Forwarder (Fluent Bit) talking to Log Aggregator (Fluentd).
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
Expand All @@ -62,7 +67,9 @@ spec:
ports:
- protocol: TCP
port: 8989
# [END anthos_logging_aggregator_networkpolicy_stackdriver_log_aggregator_in_forward]
---
# [START anthos_logging_aggregator_networkpolicy_stackdriver_log_aggregator_prometheus_scrape]
# Network policy to allow traffic from Prometheus Scraper into Log Aggregator (Fluentd).
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
Expand Down Expand Up @@ -104,7 +111,9 @@ spec:
port: 24239
- protocol: TCP
port: 24240
# [END anthos_logging_aggregator_networkpolicy_stackdriver_log_aggregator_prometheus_scrape]
---
# [START anthos_logging_aggregator_statefulset_stackdriver_log_aggregator]
# Log Aggregator (Fluentd) Deployment to send log entries to Stackdriver.
apiVersion: apps/v1
kind: StatefulSet
Expand Down Expand Up @@ -256,7 +265,9 @@ spec:
defaultMode: 420
secretName: google-cloud-credentials
name: google-cloud-credentials
# [END anthos_logging_aggregator_statefulset_stackdriver_log_aggregator]
---
# [START anthosconfig_logging_aggregator_configmap_stackdriver_log_aggregator_input_config]
# Config map for Log Aggregator (Fluentd) input and corresponding filter
# plugins.
apiVersion: v1
Expand Down Expand Up @@ -317,7 +328,9 @@ data:
tag ${if record['stream'] == 'stderr' then 'stderr' else 'stdout' end}
remove_keys kubernetes,log,stream,_dummy_labels_,_dummy_source_location_
</match>
# [END anthosconfig_logging_aggregator_configmap_stackdriver_log_aggregator_input_config]
---
# [START anthosconfig_logging_aggregator_configmap_stackdriver_log_aggregator_output_config]
# Config map for Log Aggregator (Fluentd) multi worker settings and output
# plugins.
apiVersion: v1
Expand Down Expand Up @@ -420,3 +433,4 @@ data:
# avoid misleading errors in the log.
use_metadata_service false
</match>
# [END anthosconfig_logging_aggregator_configmap_stackdriver_log_aggregator_output_config]
10 changes: 10 additions & 0 deletions attached-logging-monitoring/logging/forwarder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START anthos_logging_forwarder_serviceaccount_stackdriver_log_forwarder2]
# Service account for Log Forwarder (Fluent Bit).
apiVersion: v1
kind: ServiceAccount
metadata:
name: stackdriver-log-forwarder
namespace: kube-system
# [END anthos_logging_forwarder_serviceaccount_stackdriver_log_forwarder2]
---
# [START anthos_logging_forwarder_clusterrole_stackdriver_user:stackdriver_log_forwarder2]
# ClusterRole with permissions required by Log Forwarder (Fluent Bit).
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand All @@ -34,7 +37,9 @@ rules:
- watch
- get
- list
# [END anthos_logging_forwarder_clusterrole_stackdriver_user:stackdriver_log_forwarder2]
---
# [START anthos_logging_forwarder_clusterrolebinding_stackdriver_user:stackdriver_log_forwarder2]
# ClusterRoleBinding for Log Forwarder (Fluent Bit).
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand All @@ -49,7 +54,9 @@ subjects:
- kind: ServiceAccount
name: stackdriver-log-forwarder
namespace: kube-system
# [END anthos_logging_forwarder_clusterrolebinding_stackdriver_user:stackdriver_log_forwarder2]
---
# [START anthos_logging_forwarder_daemonset_stackdriver_log_forwarder2]
# Log Forwarder (Fluent Bit) DaemonSet to tail log files.
apiVersion: apps/v1
kind: DaemonSet
Expand Down Expand Up @@ -121,7 +128,9 @@ spec:
rollingUpdate:
maxUnavailable: 1
type: RollingUpdate
# [END anthos_logging_forwarder_daemonset_stackdriver_log_forwarder2]
---
# [START anthos_logging_forwarder_configmap_stackdriver_log_forwarder_config2]
# Log Forwarder (Fluent Bit) configuration map.
apiVersion: v1
kind: ConfigMap
Expand Down Expand Up @@ -421,3 +430,4 @@ data:
Name k8s-container-custom-tag
Format regex
Regex ^(?<namespace_name>[^_.]+)\.(?<pod_name>[a-z0-9](?:[-a-z0-9]*[a-z0-9])?(?:\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*+)\.(?<container_name>[^.]+)$
# [END anthos_logging_forwarder_configmap_stackdriver_log_forwarder_config2]
Loading