-
Notifications
You must be signed in to change notification settings - Fork 819
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
Deploy ESO on EKS #4930
Merged
Merged
Deploy ESO on EKS #4930
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
8 changes: 8 additions & 0 deletions
8
infra/aws/terraform/prow-build-cluster/resources/external-secrets/README.md
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,8 @@ | ||
Please run this command to upgrade External Secret Secrets Operator: | ||
|
||
``` | ||
helm template external-secrets \ | ||
external-secrets/external-secrets \ | ||
-f=values \ | ||
-n=external-secrets > external-secrets.yaml | ||
``` |
20 changes: 20 additions & 0 deletions
20
infra/aws/terraform/prow-build-cluster/resources/external-secrets/configmaps.yaml
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,20 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: google-adc | ||
namespace: external-secrets | ||
data: | ||
adc.json: | | ||
{ | ||
"type": "external_account", | ||
"audience": "//iam.googleapis.com/projects/773781448124/locations/global/workloadIdentityPools/prow-eks/providers/oidc", | ||
"subject_token_type": "urn:ietf:params:oauth:token-type:jwt", | ||
"token_url": "https://sts.googleapis.com/v1/token", | ||
"service_account_impersonation_url": "https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/kubernetes-external-secrets@k8s-infra-prow-build.iam.gserviceaccount.com:generateAccessToken", | ||
"credential_source": { | ||
"file": "/var/run/secrets/google-iam-token/serviceaccount/token", | ||
"format": { | ||
"type": "text" | ||
} | ||
} | ||
} |
7,361 changes: 7,361 additions & 0 deletions
7,361
infra/aws/terraform/prow-build-cluster/resources/external-secrets/external-secrets.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
infra/aws/terraform/prow-build-cluster/resources/external-secrets/values
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,23 @@ | ||
extraVolumes: | ||
- name: google-iam-token | ||
projected: | ||
defaultMode: 420 | ||
sources: | ||
- serviceAccountToken: | ||
audience: sts.googleapis.com | ||
expirationSeconds: 86400 | ||
path: token | ||
- name: google-adc | ||
configMap: | ||
name: google-adc | ||
|
||
extraEnv: | ||
- name: GOOGLE_APPLICATION_CREDENTIALS | ||
value: /etc/google/adc.json | ||
|
||
extraVolumeMounts: | ||
- mountPath: /var/run/secrets/google-iam-token/serviceaccount | ||
name: google-iam-token | ||
readOnly: true | ||
- mountPath: /etc/google | ||
name: google-adc |
54 changes: 54 additions & 0 deletions
54
infra/aws/terraform/prow-build-cluster/resources/kube-system/create-loop-devs_daemonset.yaml
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,54 @@ | ||
# A daemonset to create /dev/loopX device nodes before they are | ||
# needed. | ||
# | ||
# Normally, new nodes are created dynamically by the kernel. But nodes | ||
# in a KIND cluster are started with a copy of /dev from the host and | ||
# loop devices created later on do not show up in that static /dev | ||
# (https://github.com/kubernetes-sigs/kind/issues/1248). Creating | ||
# "enough" (100 in this daemonset) in advance avoids running out of | ||
# loop devices. | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: create-loop-devs | ||
namespace: kube-system | ||
labels: | ||
app: create-loop-devs | ||
spec: | ||
selector: | ||
matchLabels: | ||
name: create-loop-devs | ||
template: | ||
metadata: | ||
labels: | ||
name: create-loop-devs | ||
spec: | ||
tolerations: | ||
- operator: Exists | ||
effect: NoSchedule | ||
containers: | ||
- name: loopdev | ||
command: | ||
- sh | ||
- -c | ||
- | | ||
while true; do | ||
for i in $(seq 0 1000); do | ||
if ! [ -e /dev/loop$i ]; then | ||
mknod /dev/loop$i b 7 $i | ||
fi | ||
done | ||
sleep 100000000 | ||
done | ||
image: alpine:3.6 | ||
imagePullPolicy: IfNotPresent | ||
resources: {} | ||
securityContext: | ||
privileged: true | ||
volumeMounts: | ||
- name: dev | ||
mountPath: /dev | ||
volumes: | ||
- name: dev | ||
hostPath: | ||
path: /dev |
10 changes: 10 additions & 0 deletions
10
infra/aws/terraform/prow-build-cluster/resources/namespaces.yaml
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,10 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: test-pods | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: external-secrets |
5 changes: 5 additions & 0 deletions
5
infra/aws/terraform/prow-build-cluster/resources/test-pods/build-serviceaccounts.yaml
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,5 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: prow-build | ||
namespace: test-pods |
10 changes: 10 additions & 0 deletions
10
infra/aws/terraform/prow-build-cluster/resources/test-pods/cpu-limit-range_limitrange.yaml
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,10 @@ | ||
apiVersion: v1 | ||
kind: LimitRange | ||
metadata: | ||
name: cpu-limit-range | ||
namespace: test-pods | ||
spec: | ||
limits: | ||
- defaultRequest: | ||
cpu: 250m | ||
type: Container |
81 changes: 81 additions & 0 deletions
81
infra/aws/terraform/prow-build-cluster/resources/test-pods/externalsecrets.yaml
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,81 @@ | ||
# This is a place holder for adding kubernetes external secrets, please add the | ||
# ExternalSecret CR here, separated by `---`. | ||
|
||
# NOTE !!! | ||
# THIS CLUSTER USES EXTERNAL SECRETS OPERATOR INSTEAD OF KUBERNETES EXTERNAL SECRETS. | ||
# The CRDs are different from other prow clusters. Sample guide that explains the diff https://wiki.cac.washington.edu/display/MCI/Transition+from+KES+to+ESO | ||
# --- | ||
# apiVersion: kubernetes-client.io/v1 | ||
# kind: ExternalSecret | ||
# metadata: | ||
# name: service-account # The name of the Kubernetes Secret | ||
# namespace: test-pods | ||
# spec: | ||
# backendType: gcpSecretsManager | ||
# projectId: k8s-infra-prow-build | ||
# data: | ||
# - key: prow-build-service-account # The name of the GSM Secret | ||
# name: service-account.json # The key to write to in the Kubernetes Secret | ||
# version: latest # The version of the GSM Secret | ||
# --- | ||
# apiVersion: kubernetes-client.io/v1 | ||
# kind: ExternalSecret | ||
# metadata: | ||
# name: ssh-key-secret # The name of the Kubernetes Secret | ||
# namespace: test-pods | ||
# spec: | ||
# backendType: gcpSecretsManager | ||
# projectId: k8s-infra-prow-build | ||
# data: | ||
# - key: prow-build-ssh-key-secret-ssh-public # The name of the GSM Secret | ||
# name: ssh-public # The key to write to in the Kubernetes Secret | ||
# version: latest # The version of the GSM Secret | ||
# - key: prow-build-ssh-key-secret-ssh-private # The name of the GSM Secret | ||
# name: ssh-private # The key to write to in the Kubernetes Secret | ||
# version: latest # The version of the GSM Secret | ||
# --- | ||
# apiVersion: kubernetes-client.io/v1 | ||
# kind: ExternalSecret | ||
# metadata: | ||
# name: aws-credentials-768319786644 # The name of the Kubernetes Secret | ||
# namespace: test-pods | ||
# spec: | ||
# backendType: gcpSecretsManager | ||
# projectId: k8s-infra-prow-build | ||
# data: | ||
# - key: gke_k8s-prow-builds_us-central1-f_prow__test-pods__aws-credentials-768319786644 # The name of the GSM Secret | ||
# name: credentials # The key to write to in the Kubernetes Secret | ||
# version: latest # The version of the GSM Secret | ||
# property: credentials | ||
# --- | ||
# apiVersion: kubernetes-client.io/v1 | ||
# kind: ExternalSecret | ||
# metadata: | ||
# name: aws-credentials-607362164682 # The name of the Kubernetes Secret | ||
# namespace: test-pods | ||
# spec: | ||
# backendType: gcpSecretsManager | ||
# projectId: k8s-infra-prow-build | ||
# data: | ||
# - key: gke_k8s-prow-builds_us-central1-f_prow__test-pods__aws-credentials-607362164682 # The name of the GSM Secret | ||
# name: credentials # The key to write to in the Kubernetes Secret | ||
# version: latest # The version of the GSM Secret | ||
# property: credentials | ||
# --- | ||
# apiVersion: kubernetes-client.io/v1 | ||
# kind: ExternalSecret | ||
# metadata: | ||
# name: aws-ssh-key-secret # The name of the Kubernetes Secret | ||
# namespace: test-pods | ||
# spec: | ||
# backendType: gcpSecretsManager | ||
# projectId: k8s-infra-prow-build | ||
# data: | ||
# - key: gke_k8s-prow-builds_us-central1-f_prow__test-pods__aws-ssh-key-secret # The name of the GSM Secret | ||
# name: aws-ssh-private # The key to write to in the Kubernetes Secret | ||
# version: latest # The version of the GSM Secret | ||
# property: aws-ssh-private | ||
# - key: gke_k8s-prow-builds_us-central1-f_prow__test-pods__aws-ssh-key-secret # The name of the GSM Secret | ||
# name: aws-ssh-public # The key to write to in the Kubernetes Secret | ||
# version: latest # The version of the GSM Secret | ||
# property: aws-ssh-public |
10 changes: 10 additions & 0 deletions
10
infra/aws/terraform/prow-build-cluster/resources/test-pods/mem-limit-range_limitrange.yaml
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,10 @@ | ||
apiVersion: v1 | ||
kind: LimitRange | ||
metadata: | ||
name: mem-limit-range | ||
namespace: test-pods | ||
spec: | ||
limits: | ||
- defaultRequest: | ||
memory: 1Gi | ||
type: Container |
31 changes: 31 additions & 0 deletions
31
...a/aws/terraform/prow-build-cluster/resources/test-pods/test-pods-poddisruptionbudget.yaml
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,31 @@ | ||
# Copyright 2020 The Kubernetes Authors All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# The purpose of the PodDisruptionBudget here is to never allow evicting pods created by prow. | ||
# Eviction of pods can happen for one of two reasons: | ||
# * Cluster autoscaler downscaling | ||
# * Someome/Something using `kubectl drain` | ||
# | ||
# It is still possible to delete the pods via a normal delete call. See https://kubernetes.io/docs/tasks/administer-cluster/safely-drain-node/#the-eviction-api | ||
upodroid marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
apiVersion: policy/v1beta1 | ||
kind: PodDisruptionBudget | ||
metadata: | ||
name: prow-pods | ||
namespace: test-pods | ||
spec: | ||
maxUnavailable: 0 | ||
selector: | ||
matchLabels: | ||
created-by-prow: "true" |
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do this via Terraform?
k8s.io/infra/aws/terraform/prow-build-cluster/eks.tf
Lines 104 to 107 in c5181fa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can, it is easier to apply the existing manifest :D