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

ci: Remove Service account annotation for Karpenter and Prometheus #5274

Merged
merged 1 commit into from
Dec 8, 2023
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
10 changes: 5 additions & 5 deletions .github/actions/e2e/install-karpenter/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ runs:
- uses: ./.github/actions/e2e/install-helm
with:
version: v3.12.3 # Pinned to this version since v3.13.0 has issues with anonymous pulls: https://github.com/helm/helm/issues/12423
- name: create karpenter namespace
engedaam marked this conversation as resolved.
Show resolved Hide resolved
# Label namespace to enforce security stranded and scrape prometheus metrics
# https://kubernetes.io/docs/concepts/security/pod-security-standards/
- name: add labels to kube-system namespace
shell: bash
run: |
engedaam marked this conversation as resolved.
Show resolved Hide resolved
kubectl create ns karpenter || true
kubectl label ns karpenter scrape=enabled --overwrite=true
kubectl label ns karpenter pod-security.kubernetes.io/enforce=restricted --overwrite=true
kubectl label ns kube-system scrape=enabled --overwrite=true
kubectl label ns kube-system pod-security.kubernetes.io/enforce=restricted --overwrite=true
- name: login to ecr via docker
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
Expand All @@ -60,7 +61,6 @@ runs:
helm upgrade --install karpenter oci://${{ inputs.ecr_account_id }}.dkr.ecr.${{ inputs.ecr_region }}.amazonaws.com/karpenter/snapshot/karpenter \
-n kube-system \
--version "v0-$(git rev-parse HEAD)" \
--set serviceAccount.annotations."eks\.amazonaws\.com/role-arn"="arn:aws:iam::${{ inputs.account_id }}:role/karpenter-irsa-${{ inputs.cluster_name }}" \
--set webhook.enabled=${WEBHOOK_ENABLED} \
--set settings.clusterName="${{ inputs.cluster_name }}" \
--set settings.interruptionQueue="${{ inputs.cluster_name }}" \
Expand Down
1 change: 0 additions & 1 deletion .github/actions/e2e/install-prometheus/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ runs:
-f ./.github/actions/e2e/install-prometheus/values.yaml \
--set prometheus.prometheusSpec.remoteWrite[0].url=https://aps-workspaces.${{ inputs.region }}.amazonaws.com/workspaces/${{ inputs.workspace_id }}/api/v1/remote_write \
--set prometheus.prometheusSpec.remoteWrite[0].sigv4.region=${{ inputs.region }} \
--set prometheus.serviceAccount.annotations."eks\.amazonaws\.com/role-arn"="arn:aws:iam::${{ inputs.account_id }}:role/prometheus-irsa-${{ inputs.cluster_name }}" \
--set "kubelet.serviceMonitor.cAdvisorRelabelings[0].targetLabel=metrics_path" \
--set "kubelet.serviceMonitor.cAdvisorRelabelings[0].action=replace" \
--set "kubelet.serviceMonitor.cAdvisorRelabelings[0].sourceLabels[0]=__metrics_path__" \
Expand Down
3 changes: 3 additions & 0 deletions .github/actions/e2e/setup-cluster/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ runs:
ebsCSIController: true
- name: eks-pod-identity-agent
permissionsBoundary: "arn:aws:iam::${{ inputs.account_id }}:policy/GithubActionsPermissionsBoundary"
configurationValues: |
tolerations:
- operator: Exists
EOF
if [[ ${{ inputs.private_cluster }} == 'true' ]]; then
Expand Down
1 change: 1 addition & 0 deletions test/cloudformation/iam_cloudformation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ Resources:
- sqs:ReceiveMessage
- pricing:GetProducts
- eks:DescribeCluster
- eks-auth:AssumeRoleForPodIdentity
Resource: "*"
- Effect: Allow
Action: iam:PassRole
Expand Down