Skip to content

Commit 432a958

Browse files
authored
Merge branch 'dev' into audittrail-pcs
2 parents 8469833 + 7f1ca6c commit 432a958

File tree

103 files changed

+481
-356
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+481
-356
lines changed

cluster/cluster.yaml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ Resources:
714714
- !Sub "arn:aws:iam::${AWS::AccountId}:policy/ZalandoCloud-AllowPowerUser"
715715
RoleName: "{{.Cluster.LocalID}}-deployment"
716716
Type: 'AWS::IAM::Role'
717-
{{- if eq .Cluster.ConfigItems.deployment_secret_key_managed "true" }}
717+
{{- if and (eq .Cluster.ConfigItems.deployment_secret_key_managed "true") (ne .Cluster.Environment "e2e") }}
718718
DeploymentSecretKey:
719719
Properties:
720720
Description: Key used by deployment pipeline for secret encryption/decryption
@@ -876,14 +876,16 @@ Resources:
876876
- Action:
877877
- kms:Decrypt
878878
Effect: Allow
879-
{{- if eq .Cluster.ConfigItems.deployment_secret_key_managed "true" }}
879+
{{- if and (eq .Cluster.ConfigItems.deployment_secret_key_managed "true") (ne .Cluster.Environment "e2e") }}
880880
Resource:
881881
- !GetAtt DeploymentSecretKey.Arn
882882
{{- else }}
883883
Resource: "*"
884+
{{- if and (eq .Cluster.ConfigItems.deployment_secret_decrypt_any "false") (ne .Cluster.Environment "e2e") }}
884885
Condition:
885886
StringLike:
886887
"kms:RequestAlias": "alias/deployment-secret"
888+
{{- end }}
887889
{{- end }}
888890
- Action:
889891
- 'sts:AssumeRole'
@@ -1468,6 +1470,9 @@ Resources:
14681470
- Action: 'cloudwatch:List*'
14691471
Effect: Allow
14701472
Resource: '*'
1473+
- Action: 'dax:DescribeClusters'
1474+
Effect: Allow
1475+
Resource: '*'
14711476
- Action: 'ec2:Describe*'
14721477
Effect: Allow
14731478
Resource: '*'
@@ -1976,13 +1981,6 @@ Resources:
19761981
PolicyName: root
19771982
RoleName: "{{.Cluster.LocalID}}-audittrail-adapter"
19781983
Type: 'AWS::IAM::Role'
1979-
{{- if eq .Cluster.ConfigItems.dynamodb_service_link_enabled "true" }}
1980-
ServiceLinkedRoleAutoScalingDynamoDB:
1981-
Properties:
1982-
AWSServiceName: "dynamodb.application-autoscaling.amazonaws.com"
1983-
Description: "AWS service role for application autoscaling DynamoDB"
1984-
Type: "AWS::IAM::ServiceLinkedRole"
1985-
{{- end }}
19861984
RemoteFilesEncryptionKey:
19871985
Type: "AWS::KMS::Key"
19881986
Properties:

cluster/config-defaults.yaml

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,14 @@ nlb_switch: "exec"
6060
# skipper ingress settings
6161
skipper_ingress_target_average_utilization_cpu: "60"
6262
skipper_ingress_target_average_utilization_memory: "80"
63-
skipper_ingress_max_replicas: "50"
6463
skipper_ingress_hpa_scale_down_wait: "600"
6564
skipper_ingress_hpa_scale_up_max_perc: "100"
6665
{{if eq .Cluster.Environment "production"}}
6766
skipper_ingress_min_replicas: "3"
67+
skipper_ingress_max_replicas: "300"
6868
{{else}}
6969
skipper_ingress_min_replicas: "2"
70+
skipper_ingress_max_replicas: "50"
7071
{{end}}
7172
skipper_ingress_cpu: "1000m"
7273
skipper_ingress_memory: "1500Mi"
@@ -230,7 +231,7 @@ skipper_max_tcp_listener_concurrency: "-1"
230231
skipper_max_tcp_listener_queue: "-1"
231232

232233
# opentracing
233-
skipper_ingress_opentracing_excluded_proxy_tags: "skipper.route"
234+
skipper_ingress_opentracing_excluded_proxy_tags: ""
234235
skipper_ingress_opentracing_backend_name_tag: "true"
235236
skipper_opentracing_disable_filter_spans: "true"
236237
# lightstep
@@ -316,7 +317,7 @@ skipper_open_policy_agent_styra_token: ""
316317
# - production: runs the controller
317318
#
318319
fabric_gateway_controller_mode: "disabled"
319-
fabric_gateway_controller_version: "master-231"
320+
fabric_gateway_controller_version: "master-234"
320321
fabric_gateway_controller_cpu: "50m"
321322
fabric_gateway_controller_memory: "150Mi"
322323
fabric_gateway_crd_v1_enabled: "false"
@@ -374,7 +375,7 @@ journald_reader_cpu: "1m"
374375
journald_reader_memory: "30Mi"
375376

376377
# Logging settings
377-
logging_s3_bucket: "zalando-logging-{{.InfrastructureAccount | getAWSAccountID}}-{{.Region}}"
378+
logging_s3_bucket: "zalando-logging-{{ .Cluster.InfrastructureAccount | getAWSAccountID}}-{{ .Cluster.Region }}"
378379
scalyr_team_token: ""
379380
log_destination_infra: "scalyr/stups"
380381
log_destination_both: "scalyr/main+stups"
@@ -404,6 +405,9 @@ prometheus_remote_min_backoff: "3s"
404405
# Maximum retry delay.
405406
prometheus_remote_max_backoff: "10s"
406407

408+
# Comma-separated list of user ids allowed to access Prometheus UI
409+
prometheus_ui_users: ""
410+
407411
# dashboard metrics scraper resource limits
408412
dashboard_metrics_scraper_cpu_min: "50m"
409413
dashboard_metrics_scraper_mem_min: "200Mi"
@@ -551,7 +555,7 @@ teapot_admission_controller_namespace_delete_protection_enabled: "false"
551555
teapot_admission_controller_resolve_vanity_images: "true"
552556

553557
{{if eq .Cluster.Environment "e2e"}}
554-
teapot_admission_controller_ignore_namespaces: "^kube-system|((downward-api|kubectl|projected|statefulset|pod-network|scope-selectors|resourcequota|limitrange)-.*)$"
558+
teapot_admission_controller_ignore_namespaces: "^kube-system|((downward-api|kubectl|projected|statefulset|pod-network|scope-selectors|resourcequota|limitrange|sysctl|node-tests|e2e-kubelet-etc-hosts)-.*)$"
555559
teapot_admission_controller_crd_ensure_no_resources_on_delete: "false"
556560
{{else}}
557561
teapot_admission_controller_ignore_namespaces: "^kube-system$"
@@ -607,6 +611,21 @@ teapot_admission_controller_configmap_deletion_protection_enabled: "false"
607611
teapot_admission_controller_configmap_deletion_protection_enabled: "true"
608612
{{end}}
609613

614+
# Enable and configure Pod Security Policy rules implemented in admission-controller.
615+
teapot_admission_controller_pod_security_policy_enabled: "true"
616+
617+
# comma separated list of service accounts that are allowed to use privileged
618+
# pod security policy rules. Format: `<namespace>_<service-account-name>`
619+
{{ if eq .Cluster.Environment "e2e" }}
620+
teapot_admission_controller_pod_security_policy_privileged_service_accounts: "psp-privileged-zalando_privileged-sa,psp-privileged-deployment-zalando_privileged-sa"
621+
{{ else }}
622+
teapot_admission_controller_pod_security_policy_privileged_service_accounts: ""
623+
{{ end }}
624+
teapot_admission_controller_pod_security_policy_privileged_allow_privilege_escalation: "false"
625+
626+
# Optionally disable PodSecurityPolicy. Make sure `teapot_admission_controller_pod_security_policy_enabled` is true if this is disabled, otherwise there are no Pod security Policy enforcement in the cluster.
627+
pod_security_policy_enabled: "false"
628+
610629
# Prevent the use of a particular AZ as much as possible
611630
blocked_availability_zone: ""
612631

@@ -622,9 +641,8 @@ etcd_instance_type: "t3.medium"
622641
{{end}}
623642

624643
etcd_scalyr_key: ""
625-
etcd_ami: {{ amiID "zalando-ubuntu-etcd-production-v3.5.9-amd64-main-21" "861068367966"}}
626644

627-
dynamodb_service_link_enabled: "false"
645+
etcd_ami: {{ amiID "zalando-ubuntu-etcd-production-v3.5.9-amd64-main-24" "861068367966"}}
628646

629647
cluster_dns: "coredns"
630648
coredns_log_svc_names: "true"
@@ -874,11 +892,20 @@ stackset_routegroup_support_enabled: "true"
874892
stackset_ingress_source_switch_ttl: "5m"
875893

876894
# enable/disable configmap support for stackset
895+
{{if eq .Cluster.Environment "e2e"}}
896+
stackset_configmap_support_enabled: "true"
897+
{{else}}
877898
stackset_configmap_support_enabled: "false"
899+
{{end}}
878900

879901
# enable/disable traffic segment support for stackset
902+
{{if eq .Cluster.Environment "e2e"}}
903+
stackset_enable_traffic_segments: "true"
904+
stackset_annotated_traffic_segments: "true"
905+
{{else}}
880906
stackset_enable_traffic_segments: "false"
881907
stackset_annotated_traffic_segments: "false"
908+
{{end}}
882909

883910
# Enable/Disable profiling for Kubernetes components
884911
enable_control_plane_profiling: "false"
@@ -1010,3 +1037,4 @@ cronjob_time_zone_enabled: "true"
10101037
# or not. When set to a value != "true" the key will be removed from the stack.
10111038
# TODO: remove after migrating out of all cluster stacks.
10121039
deployment_secret_key_managed: "true"
1040+
deployment_secret_decrypt_any: "true"

cluster/etcd/files.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ files:
1111
data: "{{ .Cluster.ConfigItems.etcd_client_server_key }}"
1212
permissions: 0400
1313
encrypted: true
14+
- path: /etc/scalyr-agent-2/userdata.yaml
15+
data: {{ printf "scalyr_api_key: %s\ncluster_alias: %s\n" .Cluster.ConfigItems.etcd_scalyr_key .Cluster.Alias | base64 }}
16+
permissions: 0400
17+
encrypted: true

cluster/etcd/stack.yaml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,6 @@ Resources:
5151
Fn::Base64: !Sub |
5252
#cloud-config
5353
write_files:
54-
- path: /etc/scalyr-agent-2/userdata.yaml
55-
permissions: 0644
56-
content: |
57-
scalyr_api_key: "{{.Values.etcd_scalyr_key}}"
58-
stack_name: ${AWS::StackName}
5954
- path: /etc/default/etcd
6055
permissions: 0644
6156
content: |
@@ -64,8 +59,8 @@ Resources:
6459
ETCD_TRUSTED_CA_FILE=/etc/etcd/ssl/ca.cert
6560
ETCD_LOG_LEVEL=info
6661
HOSTED_ZONE="{{.Values.hosted_zone}}"
67-
S3_CERTS_BUCKET="{{ .S3GeneratedFilesPath }}"
68-
AWS_DEFAULT_REGION=eu-central-1
62+
S3_CERTS_BUCKET="{{ .Values.S3GeneratedFilesPath }}"
63+
AWS_DEFAULT_REGION="{{ .Cluster.Region }}"
6964
runcmd:
7065
- [ cfn-signal, --success, 'true', --stack, ${AWS::StackName}, --resource, AppServer, --region, ${AWS::Region} ]
7166
- [ complete-asg-lifecycle.py, 'etcd-server-lifecycle-hook' ]

cluster/manifests/01-admission-control/config.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,33 @@ data:
8282
# This setting enables and disables replacement of vanity images with ECR images during pod admission (during create and update)
8383
pod.vanity-image-replacement.enable: "{{ .Cluster.ConfigItems.teapot_admission_controller_resolve_vanity_images }}"
8484

85+
# Pod Security Policy
86+
pod.pod-security-policy.enable: "{{ .Cluster.ConfigItems.teapot_admission_controller_pod_security_policy_enabled }}"
87+
88+
# service accounts that need privileged PSP should be defined here as `<namespace>_<sa-name>`
89+
pod.pod-security-policy.privileged-service-accounts.kube-system_kube-proxy: ""
90+
pod.pod-security-policy.privileged-service-accounts.kube-system_skipper-ingress: ""
91+
pod.pod-security-policy.privileged-service-accounts.kube-system_node-monitor: ""
92+
pod.pod-security-policy.privileged-service-accounts.kube-system_nvidia: ""
93+
pod.pod-security-policy.privileged-service-accounts.kube-system_audittrail-adapter: ""
94+
pod.pod-security-policy.privileged-service-accounts.kube-system_kube-aws-iam-controller: ""
95+
pod.pod-security-policy.privileged-service-accounts.kube-system_kube2iam: ""
96+
pod.pod-security-policy.privileged-service-accounts.kube-system_ebs-csi-node-sa: ""
97+
pod.pod-security-policy.privileged-service-accounts.kube-system_flannel: ""
98+
pod.pod-security-policy.privileged-service-accounts.kube-system_etcd-backup: ""
99+
pod.pod-security-policy.privileged-service-accounts.kube-system_coredns: ""
100+
pod.pod-security-policy.privileged-service-accounts.kube-system_efs-provisioner: ""
101+
pod.pod-security-policy.privileged-service-accounts.visibility_logging-agent: ""
102+
{{- range $sa := split .Cluster.ConfigItems.teapot_admission_controller_pod_security_policy_privileged_service_accounts "," }}
103+
pod.pod-security-policy.privileged-service-accounts.{{ $sa }}: ""
104+
{{- end}}
105+
106+
{{- range $sysctl := split .Cluster.ConfigItems.allowed_unsafe_sysctls "," }}
107+
pod.pod-security-policy.allowed-unsafe-sysctls.{{ $sysctl }}: ""
108+
{{- end}}
109+
110+
pod.pod-security-policy.allow-privilege-escalation: "{{ .Cluster.ConfigItems.teapot_admission_controller_pod_security_policy_privileged_allow_privilege_escalation }}"
111+
85112
deployment.default.rolling-update-max-surge: "{{ .Cluster.ConfigItems.teapot_admission_controller_deployment_default_max_surge }}"
86113
deployment.default.rolling-update-max-unavailable: "{{ .Cluster.ConfigItems.teapot_admission_controller_deployment_default_max_unavailable }}"
87114

cluster/manifests/01-admission-control/skipper-webhook.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ webhooks:
1515
resources: ["routegroups"]
1616
clientConfig:
1717
url: "https://localhost:9085/routegroups"
18-
caBundle: "{{ .ConfigItems.ca_cert_decompressed }}"
18+
caBundle: "{{ .Cluster.ConfigItems.ca_cert_decompressed }}"
1919
admissionReviewVersions: ["v1"]
2020
sideEffects: None
2121
timeoutSeconds: 5
@@ -29,7 +29,7 @@ webhooks:
2929
resources: ["ingresses"]
3030
clientConfig:
3131
url: "https://localhost:9085/ingresses"
32-
caBundle: "{{ .ConfigItems.ca_cert_decompressed }}"
32+
caBundle: "{{ .Cluster.ConfigItems.ca_cert_decompressed }}"
3333
admissionReviewVersions: ["v1"]
3434
sideEffects: None
3535
timeoutSeconds: 5

0 commit comments

Comments
 (0)