Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Kirk Ross
    @kirkbross_gitlab
    Are you building an option to create a static IP in the deploy?
    I didn't see any yaml files so I presume they are behind the scenes.
    Mark Terrel
    @mterrel
    We don't have a component to automatically create a static IP address for you, but it's definitely on our to do list. In the meantime, you can follow step 2(a) on [the Google tutorial(https://cloud.google.com/kubernetes-engine/docs/tutorials/configuring-domain-name-static-ip#gcloud) to get the IP address.
    Then, edit the style sheet (styles.tsx)...
    Kirk Ross
    @kirkbross_gitlab
    cool... so the static IP would be an addition to the current kubernates services or should I do it as an ingress?
    Mark Terrel
    @mterrel
    In the function k8sTestStyle, there are two style rules, one that transforms Postgres into TestPostgres and a second rule that
    Oops, sent too early...we just need to add the IP to the existing Service for UrlRouter
    Kirk Ross
    @kirkbross_gitlab
    got it
    Mark Terrel
    @mterrel
    So in k8sTestStyle, delete the second rule that transforms a generic Serviceinto a Kubernetes ServiceDeployment and replace it with:
                {Service}
                {Adapt.rule<ServiceProps>(({ handle, ...props }) => {
                    if (props.key === "UrlRouter") {
                        return <ServiceDeployment config={config} {...props} {...testPodProps} serviceProps={{ loadBalancerIP: "35.236.65.222" }} />;
                    } else {
                        return <ServiceDeployment config={config} {...props} {...testPodProps} />;
                    }
                })}
    Oops, replace that IP address with the one you got when you created your static IP
    Kirk Ross
    @kirkbross_gitlab
    awesome... thanks so much for all your help... learning a lot here.
    Mark Terrel
    @mterrel
    No problem at all. Happy to help. :)
    Kirk Ross
    @kirkbross_gitlab
    And leave k8sProdStyle as-is?
    Mark Terrel
    @mterrel
    Oh, good question. I was assuming you were using the k8s-test style, so that's the one I suggested modifying. But that same change can be applied to the prod style also. Of course you probably want different IP addresses in each of those two styles if you're planning on deploying both the prod style and one or more of the test style at the same time.
    But if you just want the test style to continue to use a temporary, automatically assigned IP, then only modify the prod style.
    Kirk Ross
    @kirkbross_gitlab
    Got it.
    Mark Terrel
    @mterrel
    Oh, and note there is a small difference between those two styles...the test style includes {...testPodProps} and the prod style does not. testPodProps just modify the terminationGracePeriodSeconds value for Pods to kill them without giving them a chance to shut down. That's typically bad practice for real Pods.
    Kirk Ross
    @kirkbross_gitlab
    good catch... would never have noticed! :)
    I'm going to do some work work and then later this afternoon I want to create that static IP and see if I can get this puppy going.
    Mark Terrel
    @mterrel
    Great. If you have any issues, I should be around to answer questions.
    Kirk Ross
    @kirkbross_gitlab
    No I'm just trying to remember what my --deployID is / was.
    Mark Terrel
    @mterrel
    adapt list will tell you
    Or, it will tell you all your deployments, rather.
    Kirk Ross
    @kirkbross_gitlab
    ah... yes... app-test2
    I think I did one deploy and then started from scratch and it wouldn't let me use the same name.
    I must not have destroyed it first
    Mark Terrel
    @mterrel
    That would definitely caus that problem :)
    Kirk Ross
    @kirkbross_gitlab
    is there an adapt rename app-test2 wuddit-app command of some kind
    not that it really matters at this point
    I'm sure I can do it in the google console
    Mark Terrel
    @mterrel
    Unfortunately no.
    And renaming in the console is not going to play nicely with Adapt. Adapt uses that deployID very extensively in how it names things and how it can tell which resources it's supposed to manage and which ones it's not supposed to touch.
    If you rename anything Adapt creates, Adapt will simply re-create it next time you run update
    Kirk Ross
    @kirkbross_gitlab
    ah.
    So if I really care, then I should destroy / clean up everything and start fresh.
    Mark Terrel
    @mterrel
    Yes, unfortunately :/
    Kirk Ross
    @kirkbross_gitlab
    Debating how OCD I wanna be... :)
    Mark Terrel
    @mterrel
    haha I have that debate with myself all the time
    Mark Terrel
    @mterrel
    @kirkbross_gitlab There is one more thing you may want to look at before you make the changes I suggested. Without making any of the suggested changes, you could use the Google Console to add an Ingress that points to the UrlRouter Service. You'd have to manually manage that outside of Adapt because we don't yet have support for Ingress. But the Ingress would give you the stable IP address you need for DNS and you could also use it to enable HTTPS pretty easily too.
    image.png
    Kirk Ross
    @kirkbross_gitlab
    Okay... I'm about to destroy everything and start from scratch. Before I create a static IP I'll try the ingress option.
    is it necessary to run all the adapt commands from the deploy folder? Like adapt destroy app-test2
    Mark Terrel
    @mterrel
    Yes
    Kirk Ross
    @kirkbross_gitlab
    thought so, cool.
    Kirk Ross
    @kirkbross_gitlab
    can I run adapt run k8s-testand then later adapt run k8s-prod ?
    Mark Terrel
    @mterrel
    Yes. Each time you adapt run, it will create a new deployment with a separate set of resources.
    Kirk Ross
    @kirkbross_gitlab
    cool.
    Kirk Ross
    @kirkbross_gitlab
    would you say Adapt is an analog to Amplify for AWS?
    Mark Terrel
    @mterrel
    There's certainly a lot of overlap, yes. Both are trying to make it easier for developers to use and tie together all the pieces needed to create and deploy all the pieces of an application.