Skip to content

Commit

Permalink
templates: add cluster object store configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
cbang-akamai committed Dec 12, 2024
1 parent b7820ec commit 69bfcb8
Show file tree
Hide file tree
Showing 8 changed files with 137 additions and 0 deletions.
42 changes: 42 additions & 0 deletions templates/addons/cluster-object-store/cluster-object-store.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
kind: LinodeObjectStorageBucket
metadata:
labels:
app.kubernetes.io/name: linodeobjectstoragebucket
app.kubernetes.io/instance: ${CLUSTER_NAME}-object-store
app.kubernetes.io/part-of: cluster-api-provider-linode
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: cluster-api-provider-linode
cluster.x-k8s.io/cluster-name: ${CLUSTER_NAME}
name: ${CLUSTER_NAME}-object-store
spec:
credentialsRef:
name: ${CLUSTER_NAME}-credentials
region: ${OBJ_BUCKET_REGION:=${LINODE_REGION}}
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
kind: LinodeObjectStorageKey
metadata:
labels:
app.kubernetes.io/name: linodeobjectstoragekey
app.kubernetes.io/instance: ${CLUSTER_NAME}-object-store
app.kubernetes.io/part-of: cluster-api-provider-linode
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: cluster-api-provider-linode
cluster.x-k8s.io/cluster-name: ${CLUSTER_NAME}
name: ${CLUSTER_NAME}-object-store
spec:
credentialsRef:
name: ${CLUSTER_NAME}-credentials
bucketAccess:
- bucketName: ${CLUSTER_NAME}-object-store
permissions: read_write
region: ${OBJ_BUCKET_REGION:=${LINODE_REGION}}
generatedSecret:
type: Opaque
format:
bucket_name: '{{ .BucketName }}'
s3_endpoint: '{{ .S3Endpoint }}'
access_key: '{{ .AccessKey }}'
secret_key: '{{ .SecretKey }}'
5 changes: 5 additions & 0 deletions templates/addons/cluster-object-store/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- cluster-object-store.yaml
15 changes: 15 additions & 0 deletions templates/flavors/k3s/full-vpcless/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ resources:
- ../../../addons/etcd-backup-restore
- ../../../addons/machine-health-check
- ../../../addons/placementGroups
- ../../../addons/cluster-object-store

patches:
- target:
Expand Down Expand Up @@ -198,3 +199,17 @@ patches:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
kind: LinodePlacementGroup
name: ${CLUSTER_NAME}
- target:
group: infrastructure.cluster.x-k8s.io
version: v1alpha2
kind: LinodeCluster
patch: |-
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
kind: LinodeCluster
metadata:
name: ${CLUSTER_NAME}
spec:
objectStore:
presignedURLDuration: "24h"
credentialsRef:
name: ${CLUSTER_NAME}-object-store-obj-key
15 changes: 15 additions & 0 deletions templates/flavors/k3s/full/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ resources:
- ../../../addons/etcd-backup-restore
- ../../../addons/machine-health-check
- ../../../addons/placementGroups
- ../../../addons/cluster-object-store

patches:
- target:
Expand Down Expand Up @@ -50,3 +51,17 @@ patches:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
kind: LinodePlacementGroup
name: ${CLUSTER_NAME}
- target:
group: infrastructure.cluster.x-k8s.io
version: v1alpha2
kind: LinodeCluster
patch: |-
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
kind: LinodeCluster
metadata:
name: ${CLUSTER_NAME}
spec:
objectStore:
presignedURLDuration: "24h"
credentialsRef:
name: ${CLUSTER_NAME}-object-store-obj-key
15 changes: 15 additions & 0 deletions templates/flavors/kubeadm/full-vpcless/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ resources:
- ../../../addons/etcd-backup-restore
- ../../../addons/machine-health-check
- ../../../addons/placementGroups
- ../../../addons/cluster-object-store

patches:
- target:
Expand Down Expand Up @@ -224,3 +225,17 @@ patches:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
kind: LinodePlacementGroup
name: ${CLUSTER_NAME}
- target:
group: infrastructure.cluster.x-k8s.io
version: v1alpha2
kind: LinodeCluster
patch: |-
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
kind: LinodeCluster
metadata:
name: ${CLUSTER_NAME}
spec:
objectStore:
presignedURLDuration: "24h"
credentialsRef:
name: ${CLUSTER_NAME}-object-store-obj-key
15 changes: 15 additions & 0 deletions templates/flavors/kubeadm/full/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ resources:
- ../../../addons/etcd-backup-restore
- ../../../addons/machine-health-check
- ../../../addons/placementGroups
- ../../../addons/cluster-object-store

patches:
- target:
Expand Down Expand Up @@ -103,3 +104,17 @@ patches:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
kind: LinodePlacementGroup
name: ${CLUSTER_NAME}
- target:
group: infrastructure.cluster.x-k8s.io
version: v1alpha2
kind: LinodeCluster
patch: |-
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
kind: LinodeCluster
metadata:
name: ${CLUSTER_NAME}
spec:
objectStore:
presignedURLDuration: "24h"
credentialsRef:
name: ${CLUSTER_NAME}-object-store-obj-key
15 changes: 15 additions & 0 deletions templates/flavors/rke2/full-vpcless/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ resources:
- ../../../addons/etcd-backup-restore
- ../../../addons/machine-health-check
- ../../../addons/placementGroups
- ../../../addons/cluster-object-store

patches:
- target:
Expand Down Expand Up @@ -97,3 +98,17 @@ patches:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
kind: LinodePlacementGroup
name: ${CLUSTER_NAME}
- target:
group: infrastructure.cluster.x-k8s.io
version: v1alpha2
kind: LinodeCluster
patch: |-
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
kind: LinodeCluster
metadata:
name: ${CLUSTER_NAME}
spec:
objectStore:
presignedURLDuration: "24h"
credentialsRef:
name: ${CLUSTER_NAME}-object-store-obj-key
15 changes: 15 additions & 0 deletions templates/flavors/rke2/full/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ resources:
- ../../../addons/etcd-backup-restore
- ../../../addons/machine-health-check
- ../../../addons/placementGroups
- ../../../addons/cluster-object-store

patches:
- target:
Expand Down Expand Up @@ -89,3 +90,17 @@ patches:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
kind: LinodePlacementGroup
name: ${CLUSTER_NAME}
- target:
group: infrastructure.cluster.x-k8s.io
version: v1alpha2
kind: LinodeCluster
patch: |-
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
kind: LinodeCluster
metadata:
name: ${CLUSTER_NAME}
spec:
objectStore:
presignedURLDuration: "24h"
credentialsRef:
name: ${CLUSTER_NAME}-object-store-obj-key

0 comments on commit 69bfcb8

Please sign in to comment.