-
Notifications
You must be signed in to change notification settings - Fork 591
DNS: Add awsPrivateHostedZoneRole #1460
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
Merged
openshift-merge-robot
merged 1 commit into
openshift:master
from
patrickdillon:aws-shared-vpc
May 30, 2023
Merged
Changes from all commits
Commits
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
114 changes: 114 additions & 0 deletions
114
config/v1/0000_10_config-operator_01_dns-TechPreviewNoUpgrade.crd.yaml
This file contains hidden or 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,114 @@ | ||
| apiVersion: apiextensions.k8s.io/v1 | ||
| kind: CustomResourceDefinition | ||
| metadata: | ||
| annotations: | ||
| api-approved.openshift.io: https://github.com/openshift/api/pull/470 | ||
| include.release.openshift.io/ibm-cloud-managed: "true" | ||
| include.release.openshift.io/self-managed-high-availability: "true" | ||
| include.release.openshift.io/single-node-developer: "true" | ||
| release.openshift.io/feature-set: TechPreviewNoUpgrade | ||
| name: dnses.config.openshift.io | ||
| spec: | ||
| group: config.openshift.io | ||
| names: | ||
| kind: DNS | ||
| listKind: DNSList | ||
| plural: dnses | ||
| singular: dns | ||
| scope: Cluster | ||
| versions: | ||
| - name: v1 | ||
| schema: | ||
| openAPIV3Schema: | ||
| description: "DNS holds cluster-wide information about DNS. The canonical name is `cluster` \n Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer)." | ||
| type: object | ||
| required: | ||
| - spec | ||
| properties: | ||
| apiVersion: | ||
| description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' | ||
| type: string | ||
| kind: | ||
| description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' | ||
| type: string | ||
| metadata: | ||
| type: object | ||
| spec: | ||
| description: spec holds user settable values for configuration | ||
| type: object | ||
| properties: | ||
| baseDomain: | ||
| description: "baseDomain is the base domain of the cluster. All managed DNS records will be sub-domains of this base. \n For example, given the base domain `openshift.example.com`, an API server DNS record may be created for `cluster-api.openshift.example.com`. \n Once set, this field cannot be changed." | ||
| type: string | ||
| platform: | ||
| description: platform holds configuration specific to the underlying infrastructure provider for DNS. When omitted, this means the user has no opinion and the platform is left to choose reasonable defaults. These defaults are subject to change over time. | ||
| type: object | ||
| required: | ||
| - type | ||
| properties: | ||
| aws: | ||
| description: aws contains DNS configuration specific to the Amazon Web Services cloud provider. | ||
| type: object | ||
| properties: | ||
| privateZoneIAMRole: | ||
| description: privateZoneIAMRole contains the ARN of an IAM role that should be assumed when performing operations on the cluster's private hosted zone specified in the cluster DNS config. When left empty, no role should be assumed. | ||
| type: string | ||
| pattern: ^arn:(aws|aws-cn|aws-us-gov):iam:[0-9]{12}:role\/.*$ | ||
| type: | ||
| description: "type is the underlying infrastructure provider for the cluster. Allowed values: \"\", \"AWS\". \n Individual components may not support all platforms, and must handle unrecognized platforms with best-effort defaults." | ||
| type: string | ||
| enum: | ||
| - "" | ||
| - AWS | ||
| - Azure | ||
| - BareMetal | ||
| - GCP | ||
| - Libvirt | ||
| - OpenStack | ||
| - None | ||
| - VSphere | ||
| - oVirt | ||
| - IBMCloud | ||
| - KubeVirt | ||
| - EquinixMetal | ||
| - PowerVS | ||
| - AlibabaCloud | ||
| - Nutanix | ||
| - External | ||
| x-kubernetes-validations: | ||
| - rule: self in ['','AWS'] | ||
| message: allowed values are '' and 'AWS' | ||
| x-kubernetes-validations: | ||
| - rule: 'has(self.type) && self.type == ''AWS'' ? has(self.aws) : !has(self.aws)' | ||
| message: aws configuration is required when platform is AWS, and forbidden otherwise | ||
| privateZone: | ||
| description: "privateZone is the location where all the DNS records that are only available internally to the cluster exist. \n If this field is nil, no private records should be created. \n Once set, this field cannot be changed." | ||
| type: object | ||
| properties: | ||
| id: | ||
| description: "id is the identifier that can be used to find the DNS hosted zone. \n on AWS zone can be fetched using `ID` as id in [1] on Azure zone can be fetched using `ID` as a pre-determined name in [2], on GCP zone can be fetched using `ID` as a pre-determined name in [3]. \n [1]: https://docs.aws.amazon.com/cli/latest/reference/route53/get-hosted-zone.html#options [2]: https://docs.microsoft.com/en-us/cli/azure/network/dns/zone?view=azure-cli-latest#az-network-dns-zone-show [3]: https://cloud.google.com/dns/docs/reference/v1/managedZones/get" | ||
| type: string | ||
| tags: | ||
| description: "tags can be used to query the DNS hosted zone. \n on AWS, resourcegroupstaggingapi [1] can be used to fetch a zone using `Tags` as tag-filters, \n [1]: https://docs.aws.amazon.com/cli/latest/reference/resourcegroupstaggingapi/get-resources.html#options" | ||
| type: object | ||
| additionalProperties: | ||
| type: string | ||
| publicZone: | ||
| description: "publicZone is the location where all the DNS records that are publicly accessible to the internet exist. \n If this field is nil, no public records should be created. \n Once set, this field cannot be changed." | ||
| type: object | ||
| properties: | ||
| id: | ||
| description: "id is the identifier that can be used to find the DNS hosted zone. \n on AWS zone can be fetched using `ID` as id in [1] on Azure zone can be fetched using `ID` as a pre-determined name in [2], on GCP zone can be fetched using `ID` as a pre-determined name in [3]. \n [1]: https://docs.aws.amazon.com/cli/latest/reference/route53/get-hosted-zone.html#options [2]: https://docs.microsoft.com/en-us/cli/azure/network/dns/zone?view=azure-cli-latest#az-network-dns-zone-show [3]: https://cloud.google.com/dns/docs/reference/v1/managedZones/get" | ||
| type: string | ||
| tags: | ||
| description: "tags can be used to query the DNS hosted zone. \n on AWS, resourcegroupstaggingapi [1] can be used to fetch a zone using `Tags` as tag-filters, \n [1]: https://docs.aws.amazon.com/cli/latest/reference/resourcegroupstaggingapi/get-resources.html#options" | ||
| type: object | ||
| additionalProperties: | ||
| type: string | ||
| status: | ||
| description: status holds observed values from the cluster. They may not be overridden. | ||
| type: object | ||
| served: true | ||
| storage: true | ||
| subresources: | ||
| status: {} | ||
This file contains hidden or 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,104 @@ | ||
| apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this | ||
| name: "[TechPreview] DNS" | ||
| crd: 0000_10_config-operator_01_dns-TechPreviewNoUpgrade.crd.yaml | ||
| tests: | ||
| onCreate: | ||
| - name: Should be able to create a minimal DNS | ||
| initial: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: DNS | ||
| spec: {} # No spec is required for a DNS | ||
| expected: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: DNS | ||
| spec: {} | ||
| - name: Should be able to specify an AWS role ARN for a private hosted zone | ||
| initial: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: DNS | ||
| spec: | ||
| platform: | ||
| type: AWS | ||
| aws: | ||
| privateZoneIAMRole: arn:aws:iam:123456789012:role/foo | ||
| expected: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: DNS | ||
| spec: | ||
| platform: | ||
| type: AWS | ||
| aws: | ||
| privateZoneIAMRole: arn:aws:iam:123456789012:role/foo | ||
| - name: Should not be able to specify unsupported platform | ||
| initial: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: DNS | ||
| spec: | ||
| platform: | ||
| type: Azure | ||
| azure: | ||
| privateZoneIAMRole: arn:aws:iam:123456789012:role/foo | ||
| expectedError: "Invalid value: \"string\": allowed values are '' and 'AWS'" | ||
| - name: Should not be able to specify invalid AWS role ARN | ||
| initial: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: DNS | ||
| metadata: | ||
| name: cluster | ||
| spec: | ||
| platform: | ||
| type: AWS | ||
| aws: | ||
| privateZoneIAMRole: arn:aws:iam:bad:123456789012:role/foo | ||
| expectedError: "DNS.config.openshift.io \"cluster\" is invalid: spec.platform.aws.privateZoneIAMRole: Invalid value: \"arn:aws:iam:bad:123456789012:role/foo\": spec.platform.aws.privateZoneIAMRole in body should match '^arn:(aws|aws-cn|aws-us-gov):iam:[0-9]{12}:role\\/.*$'" | ||
| - name: Should not be able to specify different type and platform | ||
| initial: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: DNS | ||
| spec: | ||
| platform: | ||
| type: "" | ||
| aws: | ||
| privateZoneIAMRole: arn:aws:iam:123456789012:role/foo | ||
| expectedError: "Invalid value: \"object\": aws configuration is required when platform is AWS, and forbidden otherwise" | ||
| onUpdate: | ||
| - name: Can switch from empty (default), to AWS | ||
| initial: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: DNS | ||
| spec: | ||
| platform: | ||
| type: "" | ||
| updated: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: DNS | ||
| spec: | ||
| platform: | ||
| type: AWS | ||
| aws: | ||
| privateZoneIAMRole: arn:aws:iam:123456789012:role/foo | ||
| expected: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: DNS | ||
| spec: | ||
| platform: | ||
| type: AWS | ||
| aws: | ||
| privateZoneIAMRole: arn:aws:iam:123456789012:role/foo | ||
| - name: Upgrade case is valid | ||
| initial: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: DNS | ||
| spec: {} # No spec is required for a DNS | ||
| updated: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: DNS | ||
| spec: | ||
| platform: | ||
| type: "" | ||
| expected: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: DNS | ||
| spec: | ||
| platform: | ||
| type: "" |
This file contains hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
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.
Is this going to cause confusing error messages, or does the
x-kubernetes-validationsrule take precedence and prevent theenumrule from causing unsupported values to be printed in error messages?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.
In the test, the
x-kubernetes-validationsmessage takes precedence, so I think we're ok.