diff --git a/README.md b/README.md index 02a2384579381808314b0dce0637885441b791ce..250f4d1e2204e8bf9c751a16ec2ab25348641ed5 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,10 @@ After installing the Kubeflare Operator to your Kubernetes cluster, some new cus This project was created at [Replicated](https://www.replicated.com) 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](https://kubeflare.com). + ## Examples Below is an example of a Kubernetes manifest that we deploy for a domain (with some information redacted): diff --git a/docs/docs/api/zone.md b/docs/docs/api/zone.md index 9597947760eda0f734ee1fe445741de00252e58b..2e327f24a082572d0573973df9c29367ddb8ad57 100644 --- a/docs/docs/api/zone.md +++ b/docs/docs/api/zone.md @@ -110,5 +110,3 @@ Kubeflare uses boolean objects (true, false) and will map those to the string ty | websockets | [websockets](https://api.cloudflare.com/#zone-settings-change-websockets-setting) | boolean | imageResizing | [image_resizing](https://api.cloudflare.com/#zone-settings-change-image-resizing-setting) | boolean | http2Prioritization | [h2_prioritization](https://api.cloudflare.com/#zone-settings-change-http/2-edge-prioritization-setting) | boolean - - diff --git a/docs/docs/getting-started/tutorial.md b/docs/docs/getting-started/tutorial.md new file mode 100644 index 0000000000000000000000000000000000000000..8db33fa0f713d7552989d430ee155bd31e860d04 --- /dev/null +++ b/docs/docs/getting-started/tutorial.md @@ -0,0 +1,51 @@ +# Kubeflare Tutorial + +This tutorial describes how to setup Kubeflare to manage your Cloudflare resources. + +## Cloudflare Account Setup + +If you don't have a Cloudflare account and site already, create one following the instructions [here] (https://support.cloudflare.com/hc/en-us/articles/201720164-Creating-a-Cloudflare-account-and-adding-a-website) + +## Install + +Install Kubeflare via [kubectl](/install/kubectl) or [Helm](/install/helm). + +## Create a DNS Record + +### Create a secret with your API Token + +kubectl -n kubeflare-system create secret generic cf-api-secret --from-literal cf-api-token=<your-api-token> + +### Define a Zone + +```yaml +apiVersion: crds.kubeflare.io/v1alpha1 +kind: Zone +metadata: + name: domainname.io +spec: + apiToken: + valueFrom: + secretKeyRef: + name: cf-api-secret + key: cf-api-token +``` + +Full API Documentation for Zones in Kubeflare [here] (/api/zone). + +### Create an A Record + +```yaml +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 +``` diff --git a/docs/docs/index.md b/docs/docs/index.md index 9b8722a311da322bda3ea9f9fa201f5ac2d4351d..54ef52ead66139eda7dfd47b3f47e9a6a61982ec 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -14,6 +14,7 @@ New to Kubeflare? This is where you want to get started. - Installation: Install Kubeflare via [kubectl](/install/kubectl) or [Helm](/install/helm). +- Tutorial: Learn how to create a simple A record with Kubeflare [Tutorial](/getting-started/tutorial) - Importing: Learn how to automatically [import your existing Cloudflare zones](/getting-started/importing) ## Getting Help diff --git a/docs/docs/install/kubectl.md b/docs/docs/install/kubectl.md index 90cdcedef4aa84f09b2011da58f69a17425411db..013b3b50a604ea760b1fd27b495bb688f6a4277b 100644 --- a/docs/docs/install/kubectl.md +++ b/docs/docs/install/kubectl.md @@ -5,31 +5,83 @@ Kubeflare requires Kubernetes 1.16 or later to install. To install the current version of Kubeflare: ```shell -kubectl apply -f https://git.io/kubeflare +git clone git@github.com:replicatedhq/kubeflare.git +kubectl apply -f kubeflare/config/crds/v1 +cat <<EOF | kubectl apply -f - +--- +apiVersion: v1 +kind: Namespace +metadata: + name: kubeflare-system +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: kubeflare +rules: +- apiGroups: [''] + resources: + - namespaces + - secrets + verbs: [get, list, watch] +- apiGroups: [crds.kubeflare.io] + resources: ['*'] + verbs: [get, list, watch, update, patch, create, delete] +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: kubeflare + namespace: kubeflare-system +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: kubeflare +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: kubeflare +subjects: +- name: kubeflare + namespace: kubeflare-system + kind: ServiceAccount +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: kubeflare + namespace: kubeflare-system +spec: + replicas: 1 + selector: + matchLabels: + app: kubeflare + template: + metadata: + labels: + app: kubeflare + spec: + serviceAccountName: kubeflare + containers: + - name: kubeflare + image: replicated/kubeflare-manager:0.2.0 + imagePullPolicy: IfNotPresent +EOF ``` ## Upgrading -To upgrade when there's a new release available, run the same command again: - -```shell -kubectl apply -f https://git.io/kubeflare -``` +To upgrade when there's a new release available, run the same commands from the install section again, but with the updated image tag. ## Uninstalling To uninstall Kueflare completely from your cluster: -```shell -kubectl delete -f https://git.io/kubeflare -``` - -Or, if you need to uninstall manually: - ```shell kubectl delete crd apitokens.crds.kubeflare.io kubectl delete crd dnsrecords.crds.kubeflare.io kubectl delete crd tokens.crds.kubeflare.io kubectl delete crd zones.crds.kubeflare.io kubectl delete ns kubeflare-system -``` \ No newline at end of file +```