kubeflare

module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2021 License: Apache-2.0

README

Kubeflare

Kuebflare is a Kubernetes cluster add-on (Operator) that allows you to manage your Cloudflare settings using a Kubernetes declarative API.

After installing the Kubeflare Operator to your Kubernetes cluster, some new custom types will be created in the cluster. These types allow you to define a Cloudflare Zone (domain) and specify the settings and DNS records to create. When this YAML is deployed to the cluster, the Kubeflare Operator will reconcile this with the Cloudflare API to deploy the settings requested in the YAML to the Cloudflare account.

Motivation

This project was created at Replicated to manage Cloudflare settings using our GitOps workflow. We wanted a way for a devleoper to commit their DNS records and other Cloudflare settings to be reviewed and deployed with their code, as a single deployment. This tightly couples the infrastructure changes with the application changes, and makes deploying new services easier and more transparant.

Installation

Full instruction and all installation methods are listed in the documentation.

Examples

Below is an example of a Kubernetes manifest that we deploy for a domain (with some information redacted):

apiVersion: crds.kubeflare.io/v1alpha1
kind: Zone
metadata:
  name: domainname.io
spec:
  apiToken: redacted
  settings:
    alwaysUseHttps: true
    alwaysOnline: true
    minify:
      css: true
---
apiVersion: crds.kubeflare.io/v1alpha1
kind: DNSRecord
metadata:
  name: www.domainname.io
spec:
  zone: domainname.io
  record:
    type: "A"
    name: "www"
    content: "1.1.1.1"
    proxied: true
    ttl: 3600
---
apiVersion: crds.kubeflare.io/v1alpha1
kind: DNSRecord
metadata:
  name: mx-records
spec:
  zone: domainname.io
  records:
    - type: "MX"
      name: "domainname.io"
      content: "aspmx.l.google.com"
      priority: 1
    - type: "MX"
      name: "domainname.io"
      content: "alt1.aspmx.l.google.com"
      priority: 5
    - type: "MX"
      name: "domainname.io"
      content: "alt2.aspmx.l.google.com"
      priority: 5
    - type: "MX"
      name: "domainname.io"
      content: "alt3.aspmx.l.google.com"
      proxied: false      
      priority: 10
    - type: "MX"
      name: "domainname.io"
      content: "alt4.aspmx.l.google.com"
      priority: 10

Settings supported

The Cloudflare API is large and supports many settings. Kubeflare doesn't support all yet, but the current release of Kubeflare supports the following settings:

  • All zone settings (all settings listed under "Zone Settings")
  • DNS Records

This project is independent of Cloudflare and built using their public APIs. This is not a Cloudflare project.

Directories

Path Synopsis
cmd
pkg
apis
Package apis contains Kubernetes API groups.
Package apis contains Kubernetes API groups.
apis/crds
Package crds contains crds API versions
Package crds contains crds API versions
apis/crds/v1alpha1
package v1alpha1 contains API Schema definitions for the crds v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/replicatedhq/kubeflare/pkg/apis/crds +k8s:defaulter-gen=TypeMeta +groupName=crds.kubeflare.io
package v1alpha1 contains API Schema definitions for the crds v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/replicatedhq/kubeflare/pkg/apis/crds +k8s:defaulter-gen=TypeMeta +groupName=crds.kubeflare.io
client/kubeflareclientset
This package has the automatically generated clientset.
This package has the automatically generated clientset.
client/kubeflareclientset/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
client/kubeflareclientset/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
client/kubeflareclientset/typed/crds/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/kubeflareclientset/typed/crds/v1alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL