Skip to content

Commit

Permalink
Use Cluster.Provider instead of config item
Browse files Browse the repository at this point in the history
Signed-off-by: Rodrigo Reis <[email protected]>
  • Loading branch information
Rodrigo Reis authored and mikkeloscar committed Jun 24, 2024
1 parent 092af3c commit 891cbaa
Show file tree
Hide file tree
Showing 46 changed files with 111 additions and 111 deletions.
44 changes: 22 additions & 22 deletions cluster/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Metadata:
InfrastructureComponent: "true"
application: "kubernetes"
Resources:
{{ if eq .Cluster.ConfigItems.eks "true" }}
{{ if eq .Cluster.Provider "zalando-eks" }}
EKSClusterRole:
Type: AWS::IAM::Role
Properties:
Expand Down Expand Up @@ -707,7 +707,7 @@ Resources:
- !Ref MasterIAMRole
Version: 2012-10-17
Path: /
{{- if eq .Cluster.ConfigItems.eks "true"}}
{{- if eq .Cluster.Provider "zalando-eks"}}
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy"
- "arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly"
Expand Down Expand Up @@ -801,7 +801,7 @@ Resources:
}
]
}
{{- if eq .Cluster.ConfigItems.eks "true" }}
{{- if eq .Cluster.Provider "zalando-eks" }}
- OIDC: !Select [1, !Split ["//", !GetAtt EKSCluster.OpenIdConnectIssuerUrl]]
{{- else }}
- OIDC: "{{.Cluster.LocalID}}.{{.Values.hosted_zone}}"
Expand Down Expand Up @@ -872,7 +872,7 @@ Resources:
}
]
}
{{- if eq .Cluster.ConfigItems.eks "true" }}
{{- if eq .Cluster.Provider "zalando-eks" }}
- OIDC: !Select [1, !Split ["//", !GetAtt EKSCluster.OpenIdConnectIssuerUrl]]
{{- else }}
- OIDC: "{{.Cluster.LocalID}}.{{.Values.hosted_zone}}"
Expand Down Expand Up @@ -1294,7 +1294,7 @@ Resources:
}
]
}
{{- if eq .Cluster.ConfigItems.eks "true" }}
{{- if eq .Cluster.Provider "zalando-eks" }}
- OIDC: !Select [1, !Split ["//", !GetAtt EKSCluster.OpenIdConnectIssuerUrl]]
{{- else }}
- OIDC: "{{.Cluster.LocalID}}.{{.Values.hosted_zone}}"
Expand Down Expand Up @@ -1396,7 +1396,7 @@ Resources:
}
]
}
{{- if eq .Cluster.ConfigItems.eks "true" }}
{{- if eq .Cluster.Provider "zalando-eks" }}
- OIDC: !Select [1, !Split ["//", !GetAtt EKSCluster.OpenIdConnectIssuerUrl]]
{{- else }}
- OIDC: "{{.Cluster.LocalID}}.{{.Values.hosted_zone}}"
Expand Down Expand Up @@ -1454,7 +1454,7 @@ Resources:
}
]
}
{{- if eq .Cluster.ConfigItems.eks "true" }}
{{- if eq .Cluster.Provider "zalando-eks" }}
- OIDC: !Select [1, !Split ["//", !GetAtt EKSCluster.OpenIdConnectIssuerUrl]]
{{- else }}
- OIDC: "{{.Cluster.LocalID}}.{{.Values.hosted_zone}}"
Expand Down Expand Up @@ -1495,7 +1495,7 @@ Resources:
}
]
}
{{- if eq .Cluster.ConfigItems.eks "true" }}
{{- if eq .Cluster.Provider "zalando-eks" }}
- OIDC: !Select [1, !Split ["//", !GetAtt EKSCluster.OpenIdConnectIssuerUrl]]
{{- else }}
- OIDC: "{{.Cluster.LocalID}}.{{.Values.hosted_zone}}"
Expand Down Expand Up @@ -1656,7 +1656,7 @@ Resources:
}
]
}
{{- if eq .Cluster.ConfigItems.eks "true" }}
{{- if eq .Cluster.Provider "zalando-eks" }}
- OIDC: !Select [1, !Split ["//", !GetAtt EKSCluster.OpenIdConnectIssuerUrl]]
{{- else }}
- OIDC: "{{.Cluster.LocalID}}.{{.Values.hosted_zone}}"
Expand Down Expand Up @@ -1709,7 +1709,7 @@ Resources:
{
"Version": "2012-10-17",
"Statement": [
{{- if ne .Cluster.ConfigItems.eks "true" }}
{{- if ne .Cluster.Provider "zalando-eks" }}
{
"Action": [
"sts:AssumeRole"
Expand Down Expand Up @@ -1738,7 +1738,7 @@ Resources:
}
]
}
{{- if eq .Cluster.ConfigItems.eks "true" }}
{{- if eq .Cluster.Provider "zalando-eks" }}
- OIDC: !Select [1, !Split ["//", !GetAtt EKSCluster.OpenIdConnectIssuerUrl]]
{{- else }}
- OIDC: "{{.Cluster.LocalID}}.{{.Values.hosted_zone}}"
Expand Down Expand Up @@ -1833,7 +1833,7 @@ Resources:
Version: 2012-10-17
PolicyName: root
Type: 'AWS::IAM::Role'
{{- if ne .Cluster.ConfigItems.eks "true" }}
{{- if ne .Cluster.Provider "zalando-eks" }}
CloudControllerManagerIAMRole:
Properties:
AssumeRolePolicyDocument:
Expand Down Expand Up @@ -1986,7 +1986,7 @@ Resources:
}
]
}
{{- if eq .Cluster.ConfigItems.eks "true" }}
{{- if eq .Cluster.Provider "zalando-eks" }}
- OIDC: !Select [1, !Split ["//", !GetAtt EKSCluster.OpenIdConnectIssuerUrl]]
{{- else }}
- OIDC: "{{.Cluster.LocalID}}.{{.Values.hosted_zone}}"
Expand Down Expand Up @@ -2267,7 +2267,7 @@ Resources:
}
]
}
{{- if eq .Cluster.ConfigItems.eks "true" }}
{{- if eq .Cluster.Provider "zalando-eks" }}
- OIDC: !Select [1, !Split ["//", !GetAtt EKSCluster.OpenIdConnectIssuerUrl]]
{{- else }}
- OIDC: "{{.Cluster.LocalID}}.{{.Values.hosted_zone}}"
Expand Down Expand Up @@ -2326,7 +2326,7 @@ Resources:
}
]
}
{{- if eq .Cluster.ConfigItems.eks "true" }}
{{- if eq .Cluster.Provider "zalando-eks" }}
- OIDC: !Select [1, !Split ["//", !GetAtt EKSCluster.OpenIdConnectIssuerUrl]]
{{- else }}
- OIDC: "{{.Cluster.LocalID}}.{{.Values.hosted_zone}}"
Expand Down Expand Up @@ -2377,7 +2377,7 @@ Resources:
}
]
}
{{- if eq .Cluster.ConfigItems.eks "true" }}
{{- if eq .Cluster.Provider "zalando-eks" }}
- OIDC: !Select [1, !Split ["//", !GetAtt EKSCluster.OpenIdConnectIssuerUrl]]
{{- else }}
- OIDC: "{{.Cluster.LocalID}}.{{.Values.hosted_zone}}"
Expand Down Expand Up @@ -2629,7 +2629,7 @@ Resources:
}
]
}
{{- if eq .Cluster.ConfigItems.eks "true" }}
{{- if eq .Cluster.Provider "zalando-eks" }}
- OIDC: !Select [1, !Split ["//", !GetAtt EKSCluster.OpenIdConnectIssuerUrl]]
{{- else }}
- OIDC: "{{.Cluster.LocalID}}.{{.Values.hosted_zone}}"
Expand Down Expand Up @@ -2670,7 +2670,7 @@ Resources:
}
]
}
{{- if eq .Cluster.ConfigItems.eks "true" }}
{{- if eq .Cluster.Provider "zalando-eks" }}
- OIDC: !Select [1, !Split ["//", !GetAtt EKSCluster.OpenIdConnectIssuerUrl]]
{{- else }}
- OIDC: "{{.Cluster.LocalID}}.{{.Values.hosted_zone}}"
Expand Down Expand Up @@ -2721,7 +2721,7 @@ Resources:
}
]
}
{{- if eq .Cluster.ConfigItems.eks "true" }}
{{- if eq .Cluster.Provider "zalando-eks" }}
- OIDC: !Select [1, !Split ["//", !GetAtt EKSCluster.OpenIdConnectIssuerUrl]]
{{- else }}
- OIDC: "{{.Cluster.LocalID}}.{{.Values.hosted_zone}}"
Expand Down Expand Up @@ -2812,7 +2812,7 @@ Resources:
- "kms:*"
- "tag:TagResources"
Resource: "*"
{{- if eq .Cluster.ConfigItems.eks "true" }}
{{- if eq .Cluster.Provider "zalando-eks" }}
- Sid: "Allow EKSClusterRole access to describe the key"
Effect: "Allow"
Principal:
Expand All @@ -2835,7 +2835,7 @@ Resources:
- "kms:Encrypt"
- "kms:Decrypt"
{{- end }}
{{- if ne .Cluster.ConfigItems.eks "true" }}
{{- if ne .Cluster.Provider "zalando-eks" }}
MasterFilesEncryptionKey:
Type: "AWS::KMS::Key"
Properties:
Expand Down Expand Up @@ -2912,7 +2912,7 @@ Resources:
Action:
- "kms:Decrypt"
Outputs:
{{- if eq .Cluster.ConfigItems.eks "true" }}
{{- if eq .Cluster.Provider "zalando-eks" }}
EKSControlPlaneEndpoint:
Export:
Name: "{{.Cluster.ID}}:eks-control-plane-endpoint"
Expand Down
2 changes: 1 addition & 1 deletion cluster/manifests/01-aws-node/daemonset.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if eq .Cluster.ConfigItems.eks "true" }}
{{- if eq .Cluster.Provider "zalando-eks" }}
apiVersion: apps/v1
kind: DaemonSet
metadata:
Expand Down
2 changes: 1 addition & 1 deletion cluster/manifests/01-aws-node/sa.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if eq .Cluster.ConfigItems.eks "true"}}
{{- if eq .Cluster.Provider "zalando-eks"}}
---
apiVersion: v1
kind: ServiceAccount
Expand Down
10 changes: 5 additions & 5 deletions cluster/manifests/01-coredns-local/daemonset-coredns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
spec:
initContainers:
- name: ensure-apiserver
{{- if eq .Cluster.ConfigItems.eks "true" }}
{{- if eq .Cluster.Provider "zalando-eks" }}
image: 926694233939.dkr.ecr.eu-central-1.amazonaws.com/production_namespace/teapot/ensure-apiserver:master-6
{{- else }}
image: container-registry.zalando.net/teapot/ensure-apiserver:master-6
Expand Down Expand Up @@ -61,7 +61,7 @@ spec:
command:
- dig
- "+short"
{{- if and (eq .Cluster.ConfigItems.eks "true") (eq .Cluster.ConfigItems.eks_ip_family "ipv4") }}
{{- if and (eq .Cluster.Provider "zalando-eks") (eq .Cluster.ConfigItems.eks_ip_family "ipv4") }}
- "@127.0.0.1"
{{- else }}
- "::1"
Expand Down Expand Up @@ -101,7 +101,7 @@ spec:
{{ end }}
{{ if eq .Cluster.ConfigItems.dns_cache "dnsmasq" }}
- name: dnsmasq
{{- if eq .Cluster.ConfigItems.eks "true" }}
{{- if eq .Cluster.Provider "zalando-eks" }}
image: 926694233939.dkr.ecr.eu-central-1.amazonaws.com/production_namespace/teapot/k8s-dns-dnsmasq-nanny:1.17.4-master-15
{{- else }}
image: container-registry.zalando.net/teapot/k8s-dns-dnsmasq-nanny:1.17.4-master-15
Expand Down Expand Up @@ -147,7 +147,7 @@ spec:
cpu: {{.Cluster.ConfigItems.dns_dnsmasq_cpu}}
memory: {{.Cluster.ConfigItems.dns_dnsmasq_mem}}
- name: sidecar
{{- if eq .Cluster.ConfigItems.eks "true" }}
{{- if eq .Cluster.Provider "zalando-eks" }}
image: 926694233939.dkr.ecr.eu-central-1.amazonaws.com/production_namespace/teapot/k8s-dns-sidecar:1.17.4-master-15
{{- else }}
image: container-registry.zalando.net/teapot/k8s-dns-sidecar:1.17.4-master-15
Expand Down Expand Up @@ -181,7 +181,7 @@ spec:
memory: {{.Cluster.ConfigItems.dns_dnsmasq_sidecar_mem}}
{{ end }}
- name: coredns
{{- if eq .Cluster.ConfigItems.eks "true" }}
{{- if eq .Cluster.Provider "zalando-eks" }}
image: 926694233939.dkr.ecr.eu-central-1.amazonaws.com/production_namespace/teapot/coredns:1.11.3-master-24
{{- else }}
image: container-registry.zalando.net/teapot/coredns:1.11.3-master-24
Expand Down
2 changes: 1 addition & 1 deletion cluster/manifests/01-coredns-local/service-coredns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
spec:
selector:
component: coredns
{{- if ne .Cluster.ConfigItems.eks "true"}}
{{- if ne .Cluster.Provider "zalando-eks"}}
# TODO: what to do with eks service range?
clusterIP: 10.5.0.11
{{- end}}
Expand Down
2 changes: 1 addition & 1 deletion cluster/manifests/02-admission-control/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if eq .Cluster.ConfigItems.eks "true"}}
{{- if eq .Cluster.Provider "zalando-eks"}}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down
2 changes: 1 addition & 1 deletion cluster/manifests/02-admission-control/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if eq .Cluster.ConfigItems.eks "true"}}
{{- if eq .Cluster.Provider "zalando-eks"}}
apiVersion: v1
kind: Secret
metadata:
Expand Down
2 changes: 1 addition & 1 deletion cluster/manifests/02-admission-control/service.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if eq .Cluster.ConfigItems.eks "true"}}
{{- if eq .Cluster.Provider "zalando-eks"}}
apiVersion: v1
kind: Service
metadata:
Expand Down
Loading

0 comments on commit 891cbaa

Please sign in to comment.