Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Switch off ocm #633

Closed
wants to merge 12 commits into from
Closed

Switch off ocm #633

wants to merge 12 commits into from

Conversation

maleck13
Copy link
Contributor

@maleck13 maleck13 commented Oct 19, 2023

hacky branch to get a simple policy only controller and no OCM.

  • Allow DNSPolicy (simple strategy) and TLSPolicy to work in single cluster context

Try it
ensure your env is setup as normal but set the following value

export MGC_WORKLOAD_CLUSTERS_COUNT=0

make local-setup OCM_SINGLE=true

yeah its odd to use OCM_SINGLE when there is no ocm....

Run the controller locally

make build-controller install run-controller

create the needed resources

apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
metadata:
  name: prod-web
  namespace: multi-cluster-gateways
spec:
  gatewayClassName: istio
  listeners:
  - allowedRoutes:
      namespaces:
        from: All
    name: specific
    hostname: 'specific.cb.hcpapps.net'
    port: 443
    protocol: HTTPS
    tls:
      mode: Terminate
      certificateRefs:
      - kind: Secret
        name: specific.cb.hcpapps.net
---
apiVersion: kuadrant.io/v1alpha1 
kind: TLSPolicy 
metadata: 
  name: prod-web 
  namespace: multi-cluster-gateways
spec: 
  targetRef: 
    name: prod-web 
    group: gateway.networking.k8s.io 
    kind: Gateway    
  issuerRef: 
    group: cert-manager.io 
    kind: ClusterIssuer 
    name: glbc-ca
---
apiVersion: kuadrant.io/v1alpha1
kind: DNSPolicy
metadata:
  name: prod-web
  namespace: multi-cluster-gateways
spec:
  targetRef:
    group: gateway.networking.k8s.io
    kind: Gateway
    name: prod-web
    namespace: multi-cluster-gateways
  strategy: simple  
---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
  name: echo2
spec:
  parentRefs:
  - kind: Gateway
    name: prod-web
    namespace: multi-cluster-gateways
  hostnames:
  - specific.cb.hcpapps.net
  rules:
  - backendRefs:
    - name: echo
      port: 8080
---
apiVersion: v1
kind: Service
metadata:
  name: echo2
spec:
  ports:
    - name: http-port
      port: 8080
      targetPort: http-port
      protocol: TCP
  selector:
    app: echo     
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: echo2
spec:
  replicas: 1
  selector:
    matchLabels:
      app: echo
  template:
    metadata:
      labels:
        app: echo
    spec:
      containers:
        - name: echo
          image: docker.io/jmalloc/echo-server
          ports:
            - name: http-port
              containerPort: 8080
              protocol: TCP 


Should end up with a simple A record based IP address and TLS in place.

mikenairn and others added 6 commits October 18, 2023 12:59
Adds a strategy field to the DNSPolicy spec that determines how the
policy with generate endpoints for any created DNSRecords.

Two strategies are allowed, `simple` and `loadbalanced`. Simple will
creates a single DNS record (A or CNAME) for each listener/hostname with
all ip/hostnames as targets. LoadBalanced works as before by creating a
more complex record structure with CNAMES and A records using Geo and
Weighted routing strategies to achieve loadbalancing functionality.

The strategy field is currently marked as immutable and it should not be
chnaged after initial DNSPolicy creation.
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 19, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: maleck13

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:

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

@openshift-merge-robot
Copy link
Collaborator

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants