Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cluster creation to CLI #223

Open
zipofar opened this issue Jun 1, 2023 · 3 comments · Fixed by #224
Open

Add cluster creation to CLI #223

zipofar opened this issue Jun 1, 2023 · 3 comments · Fixed by #224
Assignees
Labels
dev test Low risk issue that should be tested by developer only ephemeral clusters

Comments

@zipofar
Copy link
Contributor

zipofar commented Jun 1, 2023

No description provided.

@zipofar zipofar self-assigned this Jun 1, 2023
@gadkins
Copy link
Member

gadkins commented Jun 2, 2023

Important

  • This issue should implement a minimal version of this command.
  • The goal is to release this as soon as possible
  • GitHub Actions / GitLab CI is the interface we are designing for in this issue
  • DO NOT implemented user-friendly error messages (i.e. stack trace dump is fine).
  • DO NOT handle edge cases

Base configuration (minimal)

  • If no configuration is explicitly passed, create the cluster with the base configuration.
  • This base configuration should include an ingress to the virtual cluster's Kubernetes API.
  • Set the name and namespace equal to the name the user specifies via --name=[NAME]
  • kubeconfig should be saved
  • This endpoint should be returned to stdout

For example, a base configuration with on nginx service:

kind: UffizziCluster
apiVersion: uffizzi.com/v1alpha1
metadata:
  name: foo
  namespace: foo
spec:
  ingress:
    class: "nginx"
    host: deleteme2023.uffizzi.cloud
    services:
    - name: default-svc
      namespace: foo
      port: 8080
      ingressAnnotations:
        cert-manager.io/cluster-issuer: "my-uffizzi-letsencrypt"
      certManagerTLSEnabled: true
  ttl: 1h

Command

$ uffizzi cluster create --name=[NAME] --kubeconfig=[KUBECONFIG] --manfiest=[MANIFEST]
  Cluster [NAME] was successfully created.

Conditions

  • --name - Required
  • --kubeconfig - Required. If it exists, throw error
  • --manifest - Optional. Empty cluster if not included

@gadkins
Copy link
Member

gadkins commented Jun 2, 2023

If --name is not provided, autogenerate a name and return it in the output

I'm moving these details to a separate ticket here.

@zipofar zipofar linked a pull request Jun 2, 2023 that will close this issue
@axisofentropy
Copy link
Member

axisofentropy commented Jun 2, 2023

The behavior if a kubeconfig file is not specified should mirror the behavior of kubectl and other kubernetes tools.

https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/

By default, kubectl looks for a file named config in the $HOME/.kube directory. You can specify other kubeconfig files by setting the KUBECONFIG environment variable or by setting the --kubeconfig flag.

If a kubeconfig file is found, we should merge the new cluster's connection info into it. This is just YAML, but could be tricky? Best to copy an existing implementation.

@moklidia moklidia assigned moklidia and unassigned zipofar Jun 13, 2023
@moklidia moklidia added the dev test Low risk issue that should be tested by developer only label Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev test Low risk issue that should be tested by developer only ephemeral clusters
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants