Skip to content

Commit

Permalink
added support for harvester and formatted chart
Browse files Browse the repository at this point in the history
  • Loading branch information
zackbradys committed Dec 24, 2023
1 parent 371973d commit 80c0f9e
Show file tree
Hide file tree
Showing 16 changed files with 645 additions and 167 deletions.
4 changes: 2 additions & 2 deletions charts/cluster-templates/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: rancher-cluster-templates
description: Hardened Rancher Cluster Templates by Rancher Government Solutions
icon: https://raw.githubusercontent.com/rancherfederal/carbide-docs/main/static/img/carbide-logo.svg
type: application
version: 0.3.2
appVersion: 0.3.2
version: 0.4.0
appVersion: 0.4.0
annotations:
catalog.cattle.io/type: cluster-template
catalog.cattle.io/namespace: fleet-default
43 changes: 25 additions & 18 deletions charts/cluster-templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@

| Type | Chart Version | App Version |
| :---------: | :-----------: | :---------: |
| application | `v0.3.2` | `v0.3.2` |
| application | `v0.4.0` | `v0.4.0` |

⚠️ This project is still in active development. As we continued to develop it, there will be breaking changes. ⚠️

## Supported Providers

### Currently Available

- AWS Commercial
- AWS GovCloud
- Custom
* AWS Commercial
* AWS GovCloud
* Harvester
* Custom

### Pending Development

- Harvester
- Microsoft Azure
- Digital Ocean
- VMWare vSphere
* VMWare vSphere
* Microsoft Azure
* Digital Ocean

## Installing the Chart

Expand All @@ -46,30 +46,37 @@ helm delete cluster -n fleet-default

## Example Configurations

- [Amazon EC2](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/charts/cluster-templates/values-aws.yaml)
- [Example Values](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/examples/aws/values-aws.yaml)
- [Example Values with Temporary Credentials](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/examples/aws/values-aws-sts.yaml)
- [Custom](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/charts/cluster-templates/values-custom.yaml)
- [Example Values](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/examples/custom/values-custom.yaml)
- [Harvester (TBD)](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/charts/cluster-templates/values-harvester.yaml)
- [Microsoft Azure (TBD)](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/charts/cluster-templates/values-azure.yaml)
- [Digital Ocean (TBD)](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/charts/cluster-templates/values-digitalocean.yaml)
- [VMWare vSphere (TBD)](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/charts/cluster-templates/values-vsphere.yaml)
* [Amazon EC2](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/charts/cluster-templates/values-aws.yaml)
* [Example Values](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/examples/aws/values-aws.yaml)
* [Example Values with Temporary Credentials](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/examples/aws/values-aws-sts.yaml)
* [Custom](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/charts/cluster-templates/values-custom.yaml)
* [Example Values](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/examples/custom/values-custom.yaml)
* [Harvester](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/charts/cluster-templates/values-harvester.yaml)
* [Example Values](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/examples/harvester/values-harvester.yaml)
* VMWare vSphere (TBD)
* Microsoft Azure (TBD)
* Digital Ocean (TBD)

## Chart/Cluster Secrets Management

### Cloud Credentials

If you do not have Cloud Credentials created in the Rancher Manager, you can create them via `kubectl` with the command below.

- **Note:** You are able to specific an accessKey, secretKey, or sessionToken in the `values.yaml`
#### For AWS Credentials

```bash
kubectl create secret -n cattle-global-data generic aws-creds --from-literal=amazonec2credentialConfig-defaultRegion=REGION --from-literal=amazonec2credentialConfig-accessKey=ACCESSKEY --from-literal=amazonec2credentialConfig-secretKey=SECRETKEY

kubectl annotate secret -n cattle-global-data aws-creds provisioning.cattle.io/driver=aws
```

#### For Harvester Credentials

```bash
coming soon...
```

### Registry Credentials

If you are configuring an authenticated registry and do not have Registry Credentials created in the Rancher Manager, you can create them via `kubectl` with the command below:
Expand Down
43 changes: 25 additions & 18 deletions charts/cluster-templates/app-readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@

| Type | Chart Version | App Version |
| :---------: | :-----------: | :---------: |
| application | `v0.3.2` | `v0.3.2` |
| application | `v0.4.0` | `v0.4.0` |

⚠️ This project is still in active development. As we continued to develop it, there will be breaking changes. ⚠️

## Supported Providers

### Currently Available

- AWS Commercial
- AWS GovCloud
- Custom
* AWS Commercial
* AWS GovCloud
* Harvester
* Custom

### Pending Development

- Harvester
- Microsoft Azure
- Digital Ocean
- VMWare vSphere
* VMWare vSphere
* Microsoft Azure
* Digital Ocean

## Installing the Chart

Expand All @@ -46,30 +46,37 @@ helm delete cluster -n fleet-default

## Example Configurations

- [Amazon EC2](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/charts/cluster-templates/values-aws.yaml)
- [Example Values](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/examples/aws/values-aws.yaml)
- [Example Values with Temporary Credentials](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/examples/aws/values-aws-sts.yaml)
- [Custom](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/charts/cluster-templates/values-custom.yaml)
- [Example Values](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/examples/custom/values-custom.yaml)
- [Harvester (TBD)](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/charts/cluster-templates/values-harvester.yaml)
- [Microsoft Azure (TBD)](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/charts/cluster-templates/values-azure.yaml)
- [Digital Ocean (TBD)](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/charts/cluster-templates/values-digitalocean.yaml)
- [VMWare vSphere (TBD)](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/charts/cluster-templates/values-vsphere.yaml)
* [Amazon EC2](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/charts/cluster-templates/values-aws.yaml)
* [Example Values](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/examples/aws/values-aws.yaml)
* [Example Values with Temporary Credentials](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/examples/aws/values-aws-sts.yaml)
* [Custom](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/charts/cluster-templates/values-custom.yaml)
* [Example Values](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/examples/custom/values-custom.yaml)
* [Harvester](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/charts/cluster-templates/values-harvester.yaml)
* [Example Values](https://github.com/rancherfederal/rancher-cluster-templates/blob/main/examples/harvester/values-harvester.yaml)
* VMWare vSphere (TBD)
* Microsoft Azure (TBD)
* Digital Ocean (TBD)

## Chart/Cluster Secrets Management

### Cloud Credentials

If you do not have Cloud Credentials created in the Rancher Manager, you can create them via `kubectl` with the command below.

- **Note:** You are able to specific an accessKey, secretKey, or sessionToken in the `values.yaml`
#### For AWS Credentials

```bash
kubectl create secret -n cattle-global-data generic aws-creds --from-literal=amazonec2credentialConfig-defaultRegion=REGION --from-literal=amazonec2credentialConfig-accessKey=ACCESSKEY --from-literal=amazonec2credentialConfig-secretKey=SECRETKEY

kubectl annotate secret -n cattle-global-data aws-creds provisioning.cattle.io/driver=aws
```

#### For Harvester Credentials

```bash
coming soon...
```

### Registry Credentials

If you are configuring an authenticated registry and do not have Registry Credentials created in the Rancher Manager, you can create them via `kubectl` with the command below:
Expand Down
29 changes: 3 additions & 26 deletions charts/cluster-templates/templates/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ spec:
chartValues:
harvester-cloud-provider:
cloudConfigPath: /var/lib/rancher/rke2/etc/config-files/cloud-provider-config
clusterName: {{ .Values.cluster.name }}
global:
cattle:
clusterName: {{ .Values.cluster.name }}
{{- else if eq $.Values.cloudprovider "vsphere" }}
chartValues:
rke2-calico: {}
Expand Down Expand Up @@ -180,30 +182,6 @@ spec:
{{ toYaml $nodepool.machineDeploymentAnnotations | indent 8 }}
{{- end }}
{{- end }}
{{- if eq $.Values.cloudprovider "harvester" }}
machineSelectorConfig:
- config:
cloud-provider-config: {{ .Values.cluster.config.cloud_provider_config | default "secret://harvester" }}
cloud-provider-name: {{ .Values.cluster.config.cloud_provider_config | default "harvester" }}
{{- if .Values.cluster.config.systemDefaultRegistry }}
system-default-registry: {{ .Values.cluster.config.systemDefaultRegistry }}
{{- end }}
protect-kernel-defaults: {{ .Values.cluster.config.protect_kernel_defaults }}
selinux: {{ .Values.cluster.config.selinux }}
{{- else if eq $.Values.cloudprovider "vsphere" }}
machineSelectorConfig:
- config:
{{- if .Values.cluster.config.cloud_provider_config }}
cloud-provider-config: {{ .Values.cluster.config.cloud_provider_config }}
{{- end }}
cloud-provider-name: {{ .Values.cluster.config.cloud_provider_config | default "vsphere" }}
{{- if .Values.cluster.config.systemDefaultRegistry }}
system-default-registry: {{ .Values.cluster.config.systemDefaultRegistry }}
{{- end }}
docker: {{ .Values.cluster.config.docker }}
protect-kernel-defaults: {{ .Values.cluster.config.protect_kernel_defaults }}
selinux: {{ .Values.cluster.config.selinux }}
{{- else }}
machineSelectorConfig:
- config:
{{- if .Values.cluster.config.cloud_provider_config }}
Expand All @@ -217,7 +195,6 @@ spec:
protect-kernel-defaults: {{ .Values.cluster.config.protect_kernel_defaults }}
selinux: {{ .Values.cluster.config.selinux }}
{{- end }}
{{- end }}
# machineSelectorFiles:
# provisionGeneration:
{{- if and .Values.cluster.config.registries (eq .Values.cluster.config.registries.enabled true) }}
Expand Down
18 changes: 9 additions & 9 deletions charts/cluster-templates/templates/nodeconfig-aws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,15 @@ kind: Amazonec2Config
metadata:
name: {{ $nodepool.name }}
namespace: fleet-default
common:
{{- if $nodepool.labels }}
labels:
{{ toYaml $nodepool.labels | indent 4 }}
{{- end }}
{{- if $nodepool.taints }}
taints:
{{ toYaml $nodepool.taints | indent 4 }}
{{- end }}
{{- if $nodepool.accessKey }}
accessKey: {{ $nodepool.accessKey }}
{{- end }}
Expand All @@ -137,15 +146,6 @@ blockDurationMinutes: {{ $nodepool.blockDurationMinutes }}
{{- if $nodepool.deviceName }}
deviceName: {{ $nodepool.deviceName }}
{{- end }}
common:
{{- if $nodepool.labels }}
labels:
{{ toYaml $nodepool.labels | indent 4 }}
{{- end }}
{{- if $nodepool.taints }}
taints:
{{ toYaml $nodepool.taints | indent 4 }}
{{- end }}
{{- if $nodepool.encryptEbsVolume }}
encryptEbsVolume: {{ $nodepool.encryptEbsVolume }}
{{- end }}
Expand Down
Loading

0 comments on commit 80c0f9e

Please sign in to comment.