-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from replicatedhq/diamonwiggins/how-to-install
Kubeflare Installation with Kubectl
- Loading branch information
Showing
5 changed files
with
121 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 [email protected]: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 | ||
``` | ||
``` |