Skip to content

Commit

Permalink
feat: Added routes,ingress,svc code for applicationset (argoproj-labs…
Browse files Browse the repository at this point in the history
…#677)

* Added routes,ingress,svc code

Signed-off-by: rishabh625 <[email protected]>

* Added svc ingress route logic

Signed-off-by: rishabh625 <[email protected]>

* Added enable ingress in test

Signed-off-by: rishabh625 <[email protected]>

* Added correct version of operator

Signed-off-by: rishabh625 <[email protected]>

* ran make bundle

* Applied reviewer suggestions, removed ingress for metrics

* Applied reviewer suggestions, removed ingress for metrics

* Removed unwanted code

* fixed make generate

* Add kuttl test for applicationset

* Renamed kuttl test file

* corrected names

* fix kuttl test

* Update api/v1alpha1/argocd_types.go

changed json from webhookSpec to webhookServer

Co-authored-by: jannfis <[email protected]>

* applied reviewers suggestion

Signed-off-by: rishabh625 <[email protected]>

* ran make bundle

* Added test case to disable ingress

* Added test case to disable ingress

* fixed patch command

* fixed removed TestAssert from errors kuttl file

* corrected filename and patch

* corrected test

* corrected text for applicationset webhook

* ran make bundle

* merged master branch and resolved conflicts

Signed-off-by: rishabh625 <[email protected]>

* ran make bundle

Signed-off-by: rishabh625 <[email protected]>
Co-authored-by: jannfis <[email protected]>
  • Loading branch information
rishabh625 and jannfis authored Aug 17, 2022
1 parent a2e626b commit f127b2e
Show file tree
Hide file tree
Showing 22 changed files with 984 additions and 13 deletions.
16 changes: 16 additions & 0 deletions api/v1alpha1/argocd_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ type ArgoCDApplicationSet struct {

// LogLevel describes the log level that should be used by the ApplicationSet controller. Defaults to ArgoCDDefaultLogLevel if not set. Valid options are debug,info, error, and warn.
LogLevel string `json:"logLevel,omitempty"`

WebhookServer WebhookServerSpec `json:"webhookServer,omitempty"`
}

// ArgoCDCASpec defines the CA options for ArgCD.
Expand Down Expand Up @@ -830,6 +832,20 @@ type SSHHostsSpec struct {
Keys string `json:"keys,omitempty"`
}

// WebhookServerSpec defines the options for the ApplicationSet Webhook Server component.
type WebhookServerSpec struct {

// Host is the hostname to use for Ingress/Route resources.
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Host",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:fieldGroup:Server","urn:alm:descriptor:com.tectonic.ui:text"}
Host string `json:"host,omitempty"`

// Ingress defines the desired state for an Ingress for the Application set webhook component.
Ingress ArgoCDIngressSpec `json:"ingress,omitempty"`

// Route defines the desired state for an OpenShift Route for the Application set webhook component.
Route ArgoCDRouteSpec `json:"route,omitempty"`
}

// IsDeletionFinalizerPresent checks if the instance has deletion finalizer
func (argocd *ArgoCD) IsDeletionFinalizerPresent() bool {
for _, finalizer := range argocd.GetFinalizers() {
Expand Down
18 changes: 18 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions bundle/manifests/argocd-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,28 @@ spec:
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:text
- urn:alm:descriptor:com.tectonic.ui:advanced
- description: Host is the hostname to use for Ingress/Route resources.
displayName: Host
path: applicationSet.webhookServer.host
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:fieldGroup:Server
- urn:alm:descriptor:com.tectonic.ui:text
- description: Enabled will toggle the creation of the Ingress.
displayName: Ingress Enabled'
path: applicationSet.webhookServer.ingress.enabled
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:fieldGroup:Grafana
- urn:alm:descriptor:com.tectonic.ui:fieldGroup:Prometheus
- urn:alm:descriptor:com.tectonic.ui:fieldGroup:Server
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: Enabled will toggle the creation of the OpenShift Route.
displayName: Route Enabled'
path: applicationSet.webhookServer.route.enabled
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:fieldGroup:Grafana
- urn:alm:descriptor:com.tectonic.ui:fieldGroup:Prometheus
- urn:alm:descriptor:com.tectonic.ui:fieldGroup:Server
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: ConfigManagementPlugins is used to specify additional config
management plugins.
displayName: Config Management Plugins'
Expand Down
136 changes: 136 additions & 0 deletions bundle/manifests/argoproj.io_argocds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,142 @@ spec:
description: Version is the Argo CD ApplicationSet image tag.
(optional)
type: string
webhookServer:
description: WebhookServerSpec defines the options for the ApplicationSet
Webhook Server component.
properties:
host:
description: Host is the hostname to use for Ingress/Route
resources.
type: string
ingress:
description: Ingress defines the desired state for an Ingress
for the Application set webhook component.
properties:
annotations:
additionalProperties:
type: string
description: Annotations is the map of annotations to
apply to the Ingress.
type: object
enabled:
description: Enabled will toggle the creation of the Ingress.
type: boolean
ingressClassName:
description: IngressClassName for the Ingress resource.
type: string
path:
description: Path used for the Ingress resource.
type: string
tls:
description: TLS configuration. Currently the Ingress
only supports a single TLS port, 443. If multiple members
of this list specify different hosts, they will be multiplexed
on the same port according to the hostname specified
through the SNI TLS extension, if the ingress controller
fulfilling the ingress supports SNI.
items:
description: IngressTLS describes the transport layer
security associated with an Ingress.
properties:
hosts:
description: Hosts are a list of hosts included
in the TLS certificate. The values in this list
must match the name/s used in the tlsSecret. Defaults
to the wildcard host setting for the loadbalancer
controller fulfilling this Ingress, if left unspecified.
items:
type: string
type: array
x-kubernetes-list-type: atomic
secretName:
description: SecretName is the name of the secret
used to terminate TLS traffic on port 443. Field
is left optional to allow TLS routing based on
SNI hostname alone. If the SNI host in a listener
conflicts with the "Host" header field used by
an IngressRule, the SNI host is used for termination
and value of the Host header is used for routing.
type: string
type: object
type: array
required:
- enabled
type: object
route:
description: Route defines the desired state for an OpenShift
Route for the Application set webhook component.
properties:
annotations:
additionalProperties:
type: string
description: Annotations is the map of annotations to
use for the Route resource.
type: object
enabled:
description: Enabled will toggle the creation of the OpenShift
Route.
type: boolean
labels:
additionalProperties:
type: string
description: Labels is the map of labels to use for the
Route resource
type: object
path:
description: Path the router watches for, to route traffic
for to the service.
type: string
tls:
description: TLS provides the ability to configure certificates
and termination for the Route.
properties:
caCertificate:
description: caCertificate provides the cert authority
certificate contents
type: string
certificate:
description: certificate provides certificate contents
type: string
destinationCACertificate:
description: destinationCACertificate provides the
contents of the ca certificate of the final destination. When
using reencrypt termination this file should be
provided in order to have routers use it for health
checks on the secure connection. If this field is
not specified, the router may provide its own destination
CA and perform hostname validation using the short
service name (service.namespace.svc), which allows
infrastructure generated certificates to automatically
verify.
type: string
insecureEdgeTerminationPolicy:
description: "insecureEdgeTerminationPolicy indicates
the desired behavior for insecure connections to
a route. While each router may make its own decisions
on which ports to expose, this is normally port
80. \n * Allow - traffic is sent to the server on
the insecure port (default) * Disable - no traffic
is allowed on the insecure port. * Redirect - clients
are redirected to the secure port."
type: string
key:
description: key provides key file contents
type: string
termination:
description: termination indicates termination type.
type: string
required:
- termination
type: object
wildcardPolicy:
description: WildcardPolicy if any for the route. Currently
only 'Subdomain' or 'None' is allowed.
type: string
required:
- enabled
type: object
type: object
type: object
banner:
description: Banner defines an additional banner to be displayed in
Expand Down
3 changes: 3 additions & 0 deletions common/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,7 @@ const (

// ArgoCDServerTLSSecretName is the name of the TLS secret for the argocd-server
ArgoCDServerTLSSecretName = "argocd-server-tls"

//ApplicationSetServiceNameSuffix is the suffix for Apllication Set Controller Service
ApplicationSetServiceNameSuffix = "applicationset-controller"
)
Loading

0 comments on commit f127b2e

Please sign in to comment.