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

Cloudfront controller - fails to create **distribution** #2185

Open
bala151187 opened this issue Oct 4, 2024 · 1 comment
Open

Cloudfront controller - fails to create **distribution** #2185

bala151187 opened this issue Oct 4, 2024 · 1 comment
Labels
kind/enhancement Categorizes issue or PR as related to existing feature enhancements. service/cloudfront Indicates issues or PRs that are related to cloudfront-controller.

Comments

@bala151187
Copy link

bala151187 commented Oct 4, 2024

Describe the bug
Distribution fail to be created and erroring out with a message - s3 bucket has been deleted
since s3 bucket takes couple of sec to be created . cloudfront distribution getting failed with that message ..
Either i have make the ack cloudfront controller to restart to make this error go away (or) update a parameter of cloudfront distribution and re-apply to make error go away

Any help appreciated

Steps to reproduce
Create s3 bucket and distribution

# Source: version-manager-ui/templates/cloudfront.yaml
apiVersion: s3.services.k8s.aws/v1alpha1
kind: Bucket
metadata:
  name: dev-atat-version-manager
  annotations:
    services.k8s.aws/deletion-policy: retain
spec:
  name: dev-atat-version-manager
  publicAccessBlock: 
    blockPublicACLs: true
    blockPublicPolicy: true
    ignorePublicACLs: true
    restrictPublicBuckets: true
  policy: >
    {
        "Version": "2008-10-17",
        "Id": "PublicReadGetObjectForCloudFront",
        "Statement": [
            {
                "Sid": "AllowCloudFrontServicePrincipal",
                "Effect": "Allow",
                "Principal": {
                    "Service": "cloudfront.amazonaws.com"
                },
                "Action": "s3:GetObject",
                "Resource": "arn:aws:s3:::dev-atat-version-manager/*"
            }
        ]
      }
  website: 
    errorDocument: 
      key: error.html
    indexDocument: 
      suffix: index.html
  tagging: 
    tagSet:
    - key: app-service
      value: version-manager-ui
    - key: app-platform
      value: atat
    - key: app-environment
      value: DEV
    - key: subProduct
      value: version-manager-ui
    - key: Product
      value: k8s
    - key: Environment
      value: DEV
---
# Source: version-manager-ui/templates/cloudfront.yaml
apiVersion: cloudfront.services.k8s.aws/v1alpha1
kind: Distribution
metadata:
  name: version-manager-ui
  annotations:
    services.k8s.aws/deletion-policy: retain
spec:
  distributionConfig:
    aliases:
      items:
      - version-manager.google.com
    viewerCertificate:
      acmCertificateARN: arn:aws:acm:us-east-1:xyz:certificate/47ce83b0-4a18-474f-97df-b55a15a6d493
      minimumProtocolVersion: TLSv1
      sslSupportMethod: sni-only
    cacheBehaviors:
      minTTL: 500
      maxTTL: 1000
    comment: Version Manager UI
    customErrorResponses: {}
    enabled: true
    defaultCacheBehavior:
      targetOriginID: dev-atat-version-manager
      viewerProtocolPolicy: allow-all
      minTTL: 500
      forwardedValues:
        queryString: false
        cookies:
          forward: "none"
    defaultRootObject: index.html
    origins:
      items:
      - id: dev-atat-version-manager        
        domainName: dev-atat-version-manager.s3.amazonaws.com
        originAccessControlID: EBSNWM0FK0BY8
        s3OriginConfig: 
          originAccessIdentity: ''
        customHeaders: {}
        originPath: ''
        originShield:
          enabled: false

Expected outcome
s3 bucket & cloudfront

Environment

  • Kubernetes version
  • Using EKS (yes/no), if so version? - 130.0
  • AWS service targeted (S3, RDS, etc.) - s3 & cloudfront
@bala151187
Copy link
Author

Screenshot 2024-10-04 at 1 45 29 PM

@a-hilaly a-hilaly added service/cloudfront Indicates issues or PRs that are related to cloudfront-controller. kind/enhancement Categorizes issue or PR as related to existing feature enhancements. labels Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Categorizes issue or PR as related to existing feature enhancements. service/cloudfront Indicates issues or PRs that are related to cloudfront-controller.
Projects
None yet
Development

No branches or pull requests

2 participants