Commit 3db5c0c9 authored by Alejandro Sanchez's avatar Alejandro Sanchez
Browse files

fix: deleted no-needed dierctory

parent 514334fa
Loading
Loading
Loading
Loading
Loading
+0 −53
Original line number Diff line number Diff line
#######################################################################################
# Copyright ETSI Contributors and Others.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#######################################################################################

apiVersion: containerservice.azure.upbound.io/v1beta1
kind: KubernetesCluster
metadata:
  name: ${cluster_resource_name}
spec:
  forProvider:
    # Force K8s version
    # kubernetesVersion: 1.26
    defaultNodePool:
    - name: default
      nodeCount: 1
      # nodeCount: ${node_count}
      # vmSize: Standard_D2_v2
      vmSize: ${vm_size}
    dnsPrefix: pref-${cluster_resource_name}
    identity:
    - type: SystemAssigned
    location: ${cluster_location}
    resourceGroupName: ${rg_name}
    # # In case we had created the RG with CrossPlane:
    # resourceGroupNameSelector:
    #   matchLabels:
    #     testing.upbound.io/example-name: example
    # tags:
    #   Environment: Production
  publishConnectionDetailsTo:
    # name: kubeconfig-myakscluster01
    name: kubeconfig-${cluster_resource_name}
  writeConnectionSecretToRef:
    # name: kubeconfig-myakscluster01
    name: kubeconfig-${cluster_resource_name}
    # namespace: crossplane-system
    namespace: managed-resources
  # Use in case you wanted to use different credentials (i.e., ProviderConfig different than default)
  providerConfigRef:
    name: ${providerconfig_name}
+0 −92
Original line number Diff line number Diff line
#######################################################################################
# Copyright ETSI Contributors and Others.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#######################################################################################

---
# TEMPLATE_PARAMETERS:
# ===================
#
# CLUSTER_KUSTOMIZATION_NAME: Name of the Kustomization in the management cluster representing the AKS cluster.
# - Alternatively, it can be patched at:
#   .metadata.name
#   .metadata.labels.cluster
#   .spec.commonMetadata.labels.cluster
#
# PARAMETERS TO PATCH:
# ===================
#
# .spec.postBuild.substitute.providerconfig_name: Name of the Azure ProviderConfig to use to create the AKS cluster.
# .spec.postBuild.substitute.cluster_name: Name of the cluster in the target cloud. It may differ from `CLUSTER_KUSTOMIZATION_NAME` since naming restrictions are often different from K8s resource naming restrictions (e.g., hyphens vs. underscores).
# .spec.postBuild.substitute.k8s_version: Kubernetes version.
# .spec.postBuild.substitute.node_count: Number of worker nodes.
# .spec.postBuild.substitute.vm_size: Flavor of worker node VMs.
# .spec.postBuild.substitute.cluster_location: Target cluster region.
# .spec.postBuild.substitute.rg_name: Target Resource Group.

# Cluster resource
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
  name: ${CLUSTER_KUSTOMIZATION_NAME}
  namespace: managed-resources
  labels:
    cluster: ${CLUSTER_KUSTOMIZATION_NAME}
spec:
  commonMetadata:
    labels:
      cluster: ${CLUSTER_KUSTOMIZATION_NAME}
  interval: 1h
  retryInterval: 1m
  timeout: 5m
  sourceRef:
    kind: GitRepository
    name: sw-catalogs
    namespace: flux-system
  path: ./cloud-resources/aks/manifests
  prune: true
  wait: true
  # force: true
  patches:
    - patch: |-
        apiVersion: containerservice.azure.upbound.io/v1beta1
        kind: KubernetesCluster
        metadata:
          name: ${cluster_resource_name}
        spec:
          forProvider:
            # Comment for latest version (creation only):
            kubernetesVersion: "${k8s_version}"

            defaultNodePool:
            - name: default
              # nodeCount: 1  # Edit to change no. workers
              nodeCount: ${node_count}

              # Comment for latest version (creation only):
              orchestratorVersion: "${k8s_version}"
              vmSize: ${vm_size}
  # Input parameters
  postBuild:
    substitute:
      providerconfig_name: default
      cluster_resource_name: ${CLUSTER_KUSTOMIZATION_NAME}
      cluster_name: myakscluster01
      k8s_version: "'1.27'"
      node_count: "1"
      vm_size: Standard_D2_v2
      cluster_location: West Europe
      # AKS only
      rg_name: CloudNative-OSM
+0 −97
Original line number Diff line number Diff line
#######################################################################################
# Copyright ETSI Contributors and Others.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#######################################################################################

---
apiVersion: dbformysql.azure.upbound.io/v1beta1
kind: Database
metadata:
  # annotations:
  #   meta.upbound.io/example-id: dbformysql/v1beta1/database
  labels:
    testing.upbound.io/name: ${database_name}
  name: ${database_name}
spec:
  forProvider:
    charset: utf8
    collation: utf8_unicode_ci
    resourceGroupName: ${resource_group}
    # resourceGroupNameSelector:
    #   matchLabels:
    #     testing.upbound.io/name: ${database_name}
    serverNameSelector:
      matchLabels:
        testing.upbound.io/name: ${database_name}

---

apiVersion: dbformysql.azure.upbound.io/v1beta1
kind: Server
metadata:
  # annotations:
  #   meta.upbound.io/example-id: dbformysql/v1beta1/database
  labels:
    testing.upbound.io/name: ${database_name}
  name: server-${database_name}
spec:
  forProvider:
    administratorLogin: ${admin_user}
    administratorLoginPasswordSecretRef:
      key: key
      name: ${database_secret_name}
      namespace: ${database_secret_namespace}
    autoGrowEnabled: true
    backupRetentionDays: 7
    geoRedundantBackupEnabled: true
    infrastructureEncryptionEnabled: true
    location: ${region}
    publicNetworkAccessEnabled: false
    resourceGroupName: ${resource_group}
    # resourceGroupNameSelector:
    #   matchLabels:
    #     testing.upbound.io/name: ${database_name}
    # skuName: GP_Gen5_2
    skuName: ${sku_name:=GP_Gen5_2}
    sslEnforcementEnabled: true
    sslMinimalTlsVersionEnforced: TLS1_2
    # storageMb: 5120
    storageMb: ${storage_mb:=5120}
    version: "5.7"

# ---

# apiVersion: v1
# kind: Secret
# metadata:
#   name: example-secret
#   namespace: upbound-system
# type: Opaque
# stringData:
#   example-key: dGVzdFBhc3N3b3JkITEyMw==

# ---

# apiVersion: azure.upbound.io/v1beta1
# kind: ResourceGroup
# metadata:
#   annotations:
#     meta.upbound.io/example-id: dbformysql/v1beta1/database
#   labels:
#     testing.upbound.io/name: ${database_name}
#   name: ${database_name}
# spec:
#   forProvider:
#     location: West Europe
+0 −47
Original line number Diff line number Diff line
#######################################################################################
# Copyright ETSI Contributors and Others.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#######################################################################################

---
# Database resource
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
  name: azure-mysql01
  namespace: managed-resources
spec:
  interval: 1h
  retryInterval: 1m
  timeout: 5m
  sourceRef:
    kind: GitRepository
    name: sw-catalogs
    namespace: flux-system
  path: ./cloud-resources/azure-mysql/resources
  prune: true
  wait: true

  # Input parameters
  postBuild:
    substitute:
      database_name: azure-mysql01
      resource_group: CloudNative-InfraMgmt-CTIO
      region: West Europe
      admin_user: MyDemoUser123
      database_secret_name: database-secret
      database_secret_namespace: managed-resources
      # sku_name: GP_Gen5_2
      # storage_mb: 5120
+0 −67
Original line number Diff line number Diff line
#######################################################################################
# Copyright ETSI Contributors and Others.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#######################################################################################

---
apiVersion: eks.aws.upbound.io/v1beta1
kind: Cluster
metadata:
  name: ${cluster_resource_name}-cluster
  annotations:
    crossplane.io/external-name: ${cluster_name}
  labels:
    provider: aws
    cluster: ${cluster_resource_name}
    type: cluster
spec:
  forProvider:
    region: ${cluster_location}
    version: ${k8s_version}
    roleArnSelector:
      matchLabels:
        provider: aws
        cluster: ${cluster_resource_name}
        type: cluster
    vpcConfig:
      - endpointPrivateAccess: true
        endpointPublicAccess: true
        subnetIdSelector:
          matchLabels:
            provider: aws
            cluster: ${cluster_resource_name}
            type: subnet
            access: private
  publishConnectionDetailsTo:
    name: kubeconfig-${cluster_resource_name}
  # Use in case you wanted to use different credentials (i.e., ProviderConfig different than default)
  providerConfigRef:
    name: ${providerconfig_name}

---
apiVersion: eks.aws.upbound.io/v1beta1
kind: ClusterAuth
metadata:
  name: ${cluster_resource_name}-clusterauth
spec:
  forProvider:
    region: ${cluster_location}
    clusterName: ${cluster_name}
  writeConnectionSecretToRef:
    namespace: managed-resources
    name: kubeconfig-${cluster_resource_name}
  # Use in case you wanted to use different credentials (i.e., ProviderConfig different than default)
  providerConfigRef:
    name: ${providerconfig_name}
Loading