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

manifest: set the public and private zones for AWS #1233

Merged
merged 2 commits into from
Feb 14, 2019

Conversation

abhinavdahiya
Copy link
Contributor

@abhinavdahiya abhinavdahiya commented Feb 12, 2019

The DNS object 2 was expanded to include the pointers to the public and private hosted zones to allow operators to create DNS records inthe correct zone in [PR #202]4.

The public zone is fetched from the basedomain while since installer creates the private zone at later stage, tags are used to specify the private dns zone.

The ID returned by get-hosted-zone 1 is of the form /hostedzone/<id>. For example,

$ AWS_PROFILE=openshift-dev aws route53 get-hosted-zone --id XXX
{
    "HostedZone": {
        "Id": "/hostedzone/XXX",
...
}

This creates the DNS 2 object like:

apiVersion: config.openshift.io/v1
kind: DNS
metadata:
  name: cluster
spec:
  baseDomain: yyy.openshift.com
  privateZone:
    tags:
      Name: adahiya-1_int
      kubernetes.io/cluster/adahiya-1: owned
      openshiftClusterID: 25375c13-3c0a-4102-a8f9-7ecb60757c62
  publicZone:
    id: "/hostedzone/XXX"
status: {}

But you can actually use both /hostedzone/XXX or XXX to get a zone.

$ AWS_PROFILE=openshift-dev aws route53 get-hosted-zone --id "/hostedzone/XXX"
{
    "HostedZone": {
        "Id": "/hostedzone/XXX",
...
}

The change trims the zoneID to not include the prefix when creating the DNS object as just the ID has cleaner semantics when stored in the object. The terraform-provider-aws also cleans the zone-id for better UX 3 by trimming the prefix /hostedzone/.

/cc @ironcladlou

@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 12, 2019
@abhinavdahiya
Copy link
Contributor Author

/wip

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 12, 2019
@openshift-ci-robot openshift-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 12, 2019
@abhinavdahiya
Copy link
Contributor Author

openshift/api#202 merged. So this is ready for review.

/cc @wking @staebler @ironcladlou

Need this so that ingress can make progress which is blocking #1169

@ironcladlou
Copy link
Contributor

This lgtm

pkg/asset/manifests/dns.go Outdated Show resolved Hide resolved
pkg/asset/installconfig/aws/basedomain.go Outdated Show resolved Hide resolved
pkg/asset/installconfig/aws/basedomain.go Outdated Show resolved Hide resolved
pkg/asset/manifests/dns.go Show resolved Hide resolved
The `DNS` object [2] was expanded to include the pointers to the public and private hosted zones to allow operators to create DNS records inthe correct zone in PR openshift#202 [4].

The public zone is fetched from the `basedomain` while since installer creates the private zone at later stage, tags are used to specify the private dns zone.

The ID returned by `get-hosted-zone` [1] is of the form `/hostedzone/<id>`. For example,

```console
$ AWS_PROFILE=openshift-dev aws route53 get-hosted-zone --id XXX
{
    "HostedZone": {
        "Id": "/hostedzone/XXX",
...
}
```

This creates the `DNS` [2] object like:
```yaml
apiVersion: config.openshift.io/v1
kind: DNS
metadata:
  name: cluster
spec:
  baseDomain: yyy.openshift.com
  privateZone:
    tags:
      Name: adahiya-1_int
      kubernetes.io/cluster/adahiya-1: owned
      openshiftClusterID: 25375c13-3c0a-4102-a8f9-7ecb60757c62
  publicZone:
    id: "/hostedzone/XXX"
status: {}
```

But you can actually use both `/hostedzone/XXX` or `XXX` to get a zone.

```console
$ AWS_PROFILE=openshift-dev aws route53 get-hosted-zone --id "/hostedzone/XXX"
{
    "HostedZone": {
        "Id": "/hostedzone/XXX",
...
}
```

The change trims the `zoneID` to not include the prefix when creating the `DNS` object as just the ID has cleaner semantics when stored in the object. The terraform-provider-aws also cleans the zone-id for better UX [3] by trimming the prefix `/hostedzone/`.

[1]: https://docs.aws.amazon.com/cli/latest/reference/route53/get-hosted-zone.html#synopsis
[2]: https://github.com/openshift/api/blob/8c839bc7ff62e38ad7656bf920e11e2664a44f6b/config/v1/types_dns.go#L11
[3]: https://github.com/terraform-providers/terraform-provider-aws/blob/75a9ebb7bfc7fd61b4454589155cc6b958ebebe4/aws/resource_aws_route53_zone.go#L461-L464
To get openshift/api#202

```console
$ dep ensure -update github.com/openshift/api github.com/openshift/client-go
```

```console
$ dep version
dep:
 version     : v0.5.0
 build date  : 2018-07-26
 git hash    : 224a564
 go version  : go1.10.3
 go compiler : gc
 platform    : linux/amd64
 features    : ImportDuringSolve=false
```
@staebler
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 13, 2019
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhinavdahiya, staebler

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [abhinavdahiya,staebler]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@ironcladlou
Copy link
Contributor

/retest

1 similar comment
@ironcladlou
Copy link
Contributor

/retest

@abhinavdahiya
Copy link
Contributor Author

e2e flaking

/retest

@abhinavdahiya
Copy link
Contributor Author

/retest

1 similar comment
@abhinavdahiya
Copy link
Contributor Author

/retest

}}
case libvirttypes.Name, openstacktypes.Name, nonetypes.Name:
default:
return errors.New("invalid Platform")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't our current plan to ignore invalid platforms in most places? See here and here. I guess your current whitelist approach makes sense if we expect new platforms to require cluster-managed DNS configuration and that we feel a more permissive approach in this block would make it easier to forget to add it?

@wking
Copy link
Member

wking commented Feb 14, 2019

e2e-aws:

Failing tests:

[Area:Networking] NetworkPolicy when using a plugin that implements NetworkPolicy should enforce policy based on Ports [Feature:OSNetworkPolicy] [Suite:openshift/conformance/parallel]
[Conformance][Area:Networking][Feature:Router] The HAProxy router should serve the correct routes when scoped to a single namespace and label set [Suite:openshift/conformance/parallel/minimal]
[Conformance][Area:Networking][Feature:Router] The HAProxy router should support reencrypt to services backed by a serving certificate automatically [Suite:openshift/conformance/parallel/minimal]
[Conformance][templates] templateinstance readiness test  should report failed soon after an annotated objects has failed [Suite:openshift/conformance/parallel/minimal]
[Conformance][templates] templateinstance readiness test  should report ready soon after all annotated objects are ready [Suite:openshift/conformance/parallel/minimal]
[Feature:Builds][Conformance] build can reference a cluster service  with a build being created from new-build should be able to run a build that references a cluster service [Suite:openshift/conformance/parallel/minimal]
[Feature:DeploymentConfig] deploymentconfigs with multiple image change triggers [Conformance] should run a successful deployment with a trigger used by different containers [Suite:openshift/conformance/parallel/minimal]
[sig-api-machinery] CustomResourceDefinition Watch CustomResourceDefinition Watch watch on custom resource definition objects [Suite:openshift/conformance/parallel] [Suite:k8s]
[sig-api-machinery] Servers with support for Table transformation should return chunks of table results for list calls [Suite:openshift/conformance/parallel] [Suite:k8s]
[sig-apps] Deployment deployment should support proportional scaling [Conformance] [Suite:openshift/conformance/parallel/minimal] [Suite:k8s]
[sig-apps] StatefulSet [k8s.io] Basic StatefulSet functionality [StatefulSetBasic] should provide basic identity [Suite:openshift/conformance/parallel] [Suite:k8s]
[sig-cli] Kubectl Port forwarding [k8s.io] With a server listening on localhost [k8s.io] that expects a client request should support a client that connects, sends DATA, and disconnects [Suite:openshift/conformance/parallel] [Suite:k8s]
[sig-cli] Kubectl Port forwarding [k8s.io] With a server listening on localhost should support forwarding over websockets [Suite:openshift/conformance/parallel] [Suite:k8s]
[sig-cli] Kubectl client [k8s.io] Kubectl apply should reuse port when apply to an existing SVC [Suite:openshift/conformance/parallel] [Suite:k8s]
[sig-storage] HostPath should support subPath [NodeConformance] [Suite:openshift/conformance/parallel] [Suite:k8s]
[sig-storage] In-tree Volumes [Driver: cinder] [Testpattern: Dynamic PV (default fs)] subPath should support readOnly file specified in the volumeMount [Suite:openshift/conformance/parallel] [Suite:k8s]
[sig-storage] In-tree Volumes [Driver: emptydir] [Testpattern: Inline-volume (default fs)] subPath should support existing directory [Suite:openshift/conformance/parallel] [Suite:k8s]
[sig-storage] In-tree Volumes [Driver: emptydir] [Testpattern: Pre-provisioned PV (default fs)] subPath should support existing directory [Suite:openshift/conformance/parallel] [Suite:k8s]
[sig-storage] In-tree Volumes [Driver: gluster] [Testpattern: Dynamic PV (default fs)] subPath should support readOnly file specified in the volumeMount [Suite:openshift/conformance/parallel] [Suite:k8s]
[sig-storage] In-tree Volumes [Driver: gluster] [Testpattern: Inline-volume (default fs)] subPath should support readOnly directory specified in the volumeMount [Suite:openshift/conformance/parallel] [Suite:k8s]
[sig-storage] In-tree Volumes [Driver: hostPathSymlink] [Testpattern: Inline-volume (default fs)] subPath should support existing single file [Suite:openshift/conformance/parallel] [Suite:k8s]
[sig-storage] In-tree Volumes [Driver: nfs] [Testpattern: Dynamic PV (ext3)] volumes should be mountable [Suite:openshift/conformance/parallel] [Suite:k8s]
[sig-storage] In-tree Volumes [Driver: vSphere] [Testpattern: Pre-provisioned PV (default fs)] subPath should support readOnly directory specified in the volumeMount [Suite:openshift/conformance/parallel] [Suite:k8s]

/retest

@openshift-merge-robot openshift-merge-robot merged commit 1886b7d into openshift:master Feb 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants