From fbac3815bf10b86c9991ad0937d1fe6b71a641c5 Mon Sep 17 00:00:00 2001 From: seemywings Date: Tue, 20 Aug 2024 22:05:31 -0400 Subject: [PATCH] nginx controller --- pages/how-to/set-up/controllers.md | 69 +++++++++++------- src/NavData.tsx | 16 ++--- src/generated/graphql.ts | 110 +++++++++++++++++++++++++++++ src/generated/pages.json | 3 + 4 files changed, 165 insertions(+), 33 deletions(-) diff --git a/pages/how-to/set-up/controllers.md b/pages/how-to/set-up/controllers.md index 9b3e027f..0312c474 100644 --- a/pages/how-to/set-up/controllers.md +++ b/pages/how-to/set-up/controllers.md @@ -1,39 +1,58 @@ --- title: Setting Up a Controller -description: Using Plural CLI to Deploy a Kubernetes Controller Resources +description: Adding Controllers to Workload Clusters --- # Prerequisites -[Plural CLI](/how-to/set-up/plural-cli) +* **Plural Console `admin` permissions** +* **[Plural CLI](/how-to/set-up/plural-cli)** +* **`kubectl` cluster access** -#### Ensure Cloud Provider CLI Authentication -**Plural** uses the _default_ profile when deploying resources -AWS -```sh -aws sts get-caller-identity -``` -AZ -```sh -az account show -``` -GCP -```sh -gcloud auth list -``` - -#### Ensure your _[app.plural.sh](https://app.plural.sh/profile/me)_ User has `admin` permissions +# Set Up +#### Example: ingress-nginx +* **Create an `ingress-nginx` Service Deployment CRD** + * You can add the yaml to the _services_ folder in your `infra` repo +```yaml +apiVersion: deployments.plural.sh/v1alpha1 +kind: ServiceDeployment +metadata: + name: ingress-nginx + namespace: infra +spec: + namespace: ingress-nginx + git: + folder: controllers/ingress-nginx + ref: main + repositoryRef: + kind: GitRepository + name: infra + namespace: infra + helm: + valuesFiles: + - override-values.yaml + clusterRef: + kind: Cluster + name: plrl-how-to-workload-00-dev + namespace: infra +``` +* **Save the Chart to your Infra Repo** + * In this example: `controllers/ingress-nginx` ```sh -plural login +helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx +helm repo update +helm pull ingress-nginx/ingress-nginx --untar ``` +* **Add the `override-values.yaml` in the chart directory** + * Make the desired configurations in the override values file. +* **Commit and Push the changes** +* **Apply the CRD** + * You can get the cluster context with `plural wkspace kube-init` + * Then apply the yaml to the cluster`kubectl apply -f ./services/ingress-nginx.yaml` +* **Navigate to `https://console.[YOUR DOMAIN].onplural.sh/cd/services`** + * Fom here you should see the new service being provisioned -# Set Up -Deploy a few basic controllers to that cluster, I'd do ingress-nginx + external-dns - -this should include supporting terraform to configure externaldns' IRSA rule on EKS - -should be configured as GlobalServices w/ liquid templating for injecting that data in # Troubleshooting #### Get Kubeconfig for the MGMT Cluster diff --git a/src/NavData.tsx b/src/NavData.tsx index 4a19243b..511a91e2 100644 --- a/src/NavData.tsx +++ b/src/NavData.tsx @@ -128,14 +128,14 @@ const rootNavData: NavMenu = deepFreeze([ title: 'Controllers', href: '/how-to/set-up/controllers', }, - { - title: 'Pipelines', - href: '/how-to/set-up/pipelines', - }, - { - title: 'PR Automation', - href: '/how-to/set-up/pr-automation', - }, + // { + // title: 'Pipelines', + // href: '/how-to/set-up/pipelines', + // }, + // { + // title: 'PR Automation', + // href: '/how-to/set-up/pr-automation', + // }, ], }, // { diff --git a/src/generated/graphql.ts b/src/generated/graphql.ts index b5af7e3f..7700fa48 100644 --- a/src/generated/graphql.ts +++ b/src/generated/graphql.ts @@ -374,6 +374,10 @@ export type ClosureItem = { terraform?: Maybe; }; +export enum CloudProvider { + Aws = 'AWS' +} + export type CloudShell = { __typename?: 'CloudShell'; aesKey: Scalars['String']['output']; @@ -545,6 +549,78 @@ export type ConsentRequest = { skip?: Maybe; }; +export type ConsoleConfigurationUpdateAttributes = { + encryptionKey?: InputMaybe; +}; + +export type ConsoleInstance = { + __typename?: 'ConsoleInstance'; + /** the cloud provider hosting this instance */ + cloud: CloudProvider; + console?: Maybe; + /** the time this instance was deleted on */ + deletedAt?: Maybe; + id: Scalars['ID']['output']; + insertedAt?: Maybe; + /** the name of this instance (globally unique) */ + name: Scalars['String']['output']; + owner?: Maybe; + /** the region this instance is hosted in */ + region: Scalars['String']['output']; + /** the heuristic size of this instance */ + size: ConsoleSize; + /** the provisioning status of this instance, liveness is fetched through the console field */ + status: ConsoleInstanceStatus; + /** the subdomain this instance lives under */ + subdomain: Scalars['String']['output']; + updatedAt?: Maybe; + /** full console url of this instance */ + url: Scalars['String']['output']; +}; + +export type ConsoleInstanceAttributes = { + /** the cloud provider to deploy to */ + cloud: CloudProvider; + /** the name of this instance (globally unique) */ + name: Scalars['String']['input']; + /** the region to deploy to (provider specific) */ + region: Scalars['String']['input']; + /** a heuristic size of this instance */ + size: ConsoleSize; +}; + +export type ConsoleInstanceConnection = { + __typename?: 'ConsoleInstanceConnection'; + edges?: Maybe>>; + pageInfo: PageInfo; +}; + +export type ConsoleInstanceEdge = { + __typename?: 'ConsoleInstanceEdge'; + cursor?: Maybe; + node?: Maybe; +}; + +export enum ConsoleInstanceStatus { + DatabaseCreated = 'DATABASE_CREATED', + DatabaseDeleted = 'DATABASE_DELETED', + DeploymentCreated = 'DEPLOYMENT_CREATED', + DeploymentDeleted = 'DEPLOYMENT_DELETED', + Pending = 'PENDING', + Provisioned = 'PROVISIONED' +} + +export type ConsoleInstanceUpdateAttributes = { + configuration?: InputMaybe; + size?: InputMaybe; +}; + +export enum ConsoleSize { + Large = 'LARGE', + Medium = 'MEDIUM', + Small = 'SMALL' +} + export type ContextAttributes = { buckets?: InputMaybe>>; configuration: Scalars['Map']['input']; @@ -2692,6 +2768,7 @@ export type RootMutationType = { createCluster?: Maybe; /** adds a dependency for this cluster to gate future upgrades */ createClusterDependency?: Maybe; + createConsoleInstance?: Maybe; createCrd?: Maybe; createDemoProject?: Maybe; createDnsRecord?: Maybe; @@ -2736,6 +2813,7 @@ export type RootMutationType = { deleteCluster?: Maybe; /** deletes a dependency for this cluster and potentially disables promotions entirely */ deleteClusterDependency?: Maybe; + deleteConsoleInstance?: Maybe; deleteDemoProject?: Maybe; deleteDnsRecord?: Maybe; deleteDomain?: Maybe; @@ -2808,6 +2886,7 @@ export type RootMutationType = { updateAccount?: Maybe; updateChart?: Maybe; updateChartInstallation?: Maybe; + updateConsoleInstance?: Maybe; updateDockerRepository?: Maybe; updateDomain?: Maybe; updateGroup?: Maybe; @@ -2882,6 +2961,11 @@ export type RootMutationTypeCreateClusterDependencyArgs = { }; +export type RootMutationTypeCreateConsoleInstanceArgs = { + attributes: ConsoleInstanceAttributes; +}; + + export type RootMutationTypeCreateCrdArgs = { attributes: CrdAttributes; chartId?: InputMaybe; @@ -3109,6 +3193,11 @@ export type RootMutationTypeDeleteClusterDependencyArgs = { }; +export type RootMutationTypeDeleteConsoleInstanceArgs = { + id: Scalars['ID']['input']; +}; + + export type RootMutationTypeDeleteDnsRecordArgs = { name: Scalars['String']['input']; type: DnsRecordType; @@ -3448,6 +3537,12 @@ export type RootMutationTypeUpdateChartInstallationArgs = { }; +export type RootMutationTypeUpdateConsoleInstanceArgs = { + attributes: ConsoleInstanceUpdateAttributes; + id: Scalars['ID']['input']; +}; + + export type RootMutationTypeUpdateDockerRepositoryArgs = { attributes: DockerRepositoryAttributes; id: Scalars['ID']['input']; @@ -3620,6 +3715,8 @@ export type RootQueryType = { /** Get a list of clusters owned by the current account. */ clusters?: Maybe; configuration?: Maybe; + consoleInstance?: Maybe; + consoleInstances?: Maybe; deferredUpdates?: Maybe; demoProject?: Maybe; dnsDomain?: Maybe; @@ -3764,6 +3861,19 @@ export type RootQueryTypeClustersArgs = { }; +export type RootQueryTypeConsoleInstanceArgs = { + id: Scalars['ID']['input']; +}; + + +export type RootQueryTypeConsoleInstancesArgs = { + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}; + + export type RootQueryTypeDeferredUpdatesArgs = { after?: InputMaybe; before?: InputMaybe; diff --git a/src/generated/pages.json b/src/generated/pages.json index 6bd6f7a9..c8573f1d 100644 --- a/src/generated/pages.json +++ b/src/generated/pages.json @@ -311,6 +311,9 @@ { "path": "/how-to/set-up/pr-automation" }, + { + "path": "/how-to/set-up/scm-connection" + }, { "path": "/how-to/set-up/workload-cluster" },