Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the acf domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php on line 6131

Deprecated: Creation of dynamic property ACF::$fields is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/fields.php on line 138

Deprecated: Creation of dynamic property acf_loop::$loops is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/loop.php on line 28

Deprecated: Creation of dynamic property ACF::$loop is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/loop.php on line 269

Deprecated: Creation of dynamic property ACF::$revisions is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/revisions.php on line 397

Deprecated: Creation of dynamic property acf_validation::$errors is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/validation.php on line 28

Deprecated: Creation of dynamic property ACF::$validation is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/validation.php on line 214

Deprecated: Creation of dynamic property acf_form_customizer::$preview_values is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-customizer.php on line 28

Deprecated: Creation of dynamic property acf_form_customizer::$preview_fields is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-customizer.php on line 29

Deprecated: Creation of dynamic property acf_form_customizer::$preview_errors is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-customizer.php on line 30

Deprecated: Creation of dynamic property ACF::$form_front is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-front.php on line 598

Deprecated: Creation of dynamic property acf_form_widget::$preview_values is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-widget.php on line 34

Deprecated: Creation of dynamic property acf_form_widget::$preview_reference is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-widget.php on line 35

Deprecated: Creation of dynamic property acf_form_widget::$preview_errors is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-widget.php on line 36

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the all-in-one-wp-migration domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php on line 6131

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/wp_plugin/wp_plugin.php on line 23

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 54

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 1539

Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 828

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the rocket domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php on line 6131

Deprecated: Creation of dynamic property acf_field_oembed::$width is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/fields/class-acf-field-oembed.php on line 31

Deprecated: Creation of dynamic property acf_field_oembed::$height is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/fields/class-acf-field-oembed.php on line 32

Deprecated: Creation of dynamic property acf_field_google_map::$default_values is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/fields/class-acf-field-google-map.php on line 33

Deprecated: Creation of dynamic property acf_field__group::$have_rows is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/fields/class-acf-field-group.php on line 31

Deprecated: Creation of dynamic property acf_field_clone::$cloning is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/pro/fields/class-acf-field-clone.php on line 34

Deprecated: Creation of dynamic property acf_field_clone::$have_rows is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/pro/fields/class-acf-field-clone.php on line 35

Deprecated: Creation of dynamic property jh_acf_field_table::$settings is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-table-field/class-jh-acf-field-table.php on line 23

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902
{"id":32921,"date":"2023-03-30T18:09:13","date_gmt":"2023-03-30T15:09:13","guid":{"rendered":"https:\/\/upcloud.com\/?post_type=tutorial&p=32921"},"modified":"2023-03-30T18:09:13","modified_gmt":"2023-03-30T15:09:13","slug":"get-started-managed-kubernetes","status":"publish","type":"tutorial","link":"https:\/\/studiogo.tech\/upcloudold\/tutorial\/get-started-managed-kubernetes\/","title":{"rendered":"How to get started with Managed Kubernetes"},"content":{"rendered":"\n

Kubernetes is an open-source container orchestration system which automates the deployment, scaling and management of containerised applications. UpCloud’s Managed Kubernetes offers a fully-managed solution which allows you to create and begin using Kubernetes clusters in just a few minutes. <\/p>\n\n\n\n

Through Kubernetes, you can manage and orchestrate containers (such as Docker) across multiple hosts. Using Kubernetes makes it quick and easy to deploy and manage applications on the cloud. It provides features like self-healing, automatic scaling, and service discovery.<\/p>\n\n\n\n

Creating new Managed Kubernetes cluster<\/h2>\n\n\n\n

The simplest way to create a cluster is by using your Control Panel. You can do so by following the steps outlined below.<\/p>\n\n\n\n

To start, log in to the\u00a0UpCloud Control Panel<\/a> or sign up<\/a> if you haven’t yet done so.<\/p>\n\n\n\n

Next, go to the Kubernetes page using the menu on the left-hand side.<\/p>\n\n\n\n

Then click the Create new cluster<\/em> button.<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

Now, configure your Kubernetes cluster according to your preferences by selecting the availability zone, a private network and node groups.<\/p>\n\n\n\n

Note that during the Open Beta<\/strong>, Managed Kubernetes is available on \"de\"\u00a0de-fra1<\/strong>\u00a0and\u00a0\"finland\"\u00a0fi-hel2<\/strong>.<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

Next, select a Private Network for your worker nodes. This network should be in the same zone as your created cluster. The network cannot be connected to an existing cluster, cannot have an attached router, and should have DHCP enabled with the default route from DHCP disabled. For the IP network of your SDN network, you can use for example\u00a010.0.1.0\/24<\/tt>.<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

Then create a node group or use the default node group. A node group is a group of workers with identical image templates. You can have multiple node groups with differing configurations and usages.<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

You also have the options to include key-value labels. The labels are forwarded to kubernetes node definitions and can be used to organize and to select subsets of Kubernetes objects.<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

Optionally, expand the Advanced options<\/em> to find the Anti-affinity option<\/em> and the ability include SSH keys<\/em>. Note that you will need to add your SSH public key first in your account details<\/a> before deploying it to your Kubernetes cluster.<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

Lastly, name your cluster and when all set, click the\u00a0Create<\/em>\u00a0button.<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

Cluster creation will take a couple of minutes as worker nodes are provisioned and a DNS record is prepared. While your cluster is being created, continue on to setting up your control plain access.<\/p>\n\n\n\n

Connecting to the cluster<\/h2>\n\n\n\n

To be able to deploy workloads to your Managed Kubernetes cluster, you’ll need to configure a connection to it using the kubectl command-line tool with a kubeconfig file.<\/p>\n\n\n\n

You can download your cluster’s kubeconfig file from your cluster’s Overview page and set it up on your local computer. Kubeconfig files are used to organize information about clusters, users, namespaces, and authentication mechanisms.<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

The kubeconfig file allows you to access your cluster easily via the command line. If you do not yet have kubectl installed, follow the instructions for your computer system<\/a> then continue with the step below.<\/p>\n\n\n\n

Add the kubeconfig.yaml<\/tt> file to your system with the command provided at the Kubeconfig section of your cluster Overview. Make sure to set the path correctly depending on where you saved the configuration file.<\/p>\n\n\n\n

export KUBECONFIG=\/{path}\/{cluster-name}_kubeconfig.yaml<\/code><\/pre>\n\n\n\n

You will likely want to add the same command to your profile as well to have it automatically set when you open a new terminal.<\/p>\n\n\n\n

When set, test that your cluster is accessible and can be reached by using kubectl<\/tt>.<\/p>\n\n\n\n

kubectl config view<\/code><\/pre>\n\n\n\n
apiVersion: v1\nclusters:\n- cluster:\n    certificate-authority-data: DATA+OMITTED\n    server: https:\/\/lb-0a8fdaf728bd487e8c4ecf5396a8cb25-1.upcloudlb.com:6443\n  name: my-kube-cluster\ncontexts:\n- context:\n    cluster: my-kube-cluster\n    user: my-kube-cluster-admin\n  name: my-kube-cluster-admin@my-kube-cluster\ncurrent-context: my-kube-cluster-admin@my-kube-cluster\nkind: Config\npreferences: {}\nusers:\n- name: my-kube-cluster-admin\n  user:\n    client-certificate-data: DATA+OMITTED\n    client-key-data: DATA+OMITTED<\/pre>\n\n\n\n

If you are seeing an output similar to the example above, you are ready to start deploy applications to your new Managed Kubernetes cluster.<\/p>\n\n\n\n

Testing app deployment to the cluster<\/h2>\n\n\n\n

Now that you have created your Managed Kubernetes cluster and connected to it using kubectl, you probably want to test it out. This can be done quick and easy with just a few commands with kubectl.<\/p>\n\n\n\n

Start by deploying a\u00a0Hello UKS<\/em>\u00a0application to your newly created cluster with the command below.<\/p>\n\n\n\n

kubectl create deployment --image=ghcr.io\/upcloudltd\/hello hello-uks<\/code><\/pre>\n\n\n\n
deployment.apps\/hello-uks created<\/pre>\n\n\n\n

Next, expose the application at port 80 making it accessible via HTTP.<\/p>\n\n\n\n

kubectl expose deployment hello-uks --port=80 --target-port=80 --type=LoadBalancer<\/code><\/pre>\n\n\n\n
service\/hello-uks exposed<\/pre>\n\n\n\n

This bit will take a moment. <\/p>\n\n\n\n

You can keep an eye on the services with the next command to see when the app becomes available.<\/p>\n\n\n\n

kubectl get services -w<\/code><\/pre>\n\n\n\n
NAME        TYPE          CLUSTER-IP     EXTERNAL-IP       PORT(S)       AGE\nhello-uks   LoadBalancer  10.133.236.77  <pending>         80:31655\/TCP  5s\nkubernetes  ClusterIP     10.128.0.1     <none>            443\/TCP       5m28s\nhello-uks   LoadBalancer  10.133.236.77  <pending>         80:31655\/TCP  2m20s\nhello-uks   LoadBalancer  10.133.236.77  lb-0ad...lb.com   80:31655\/TCP  2m20s<\/pre>\n\n\n\n

Once the hello-uks<\/tt> app has been successfully exposed, you’ll see a load balancer domain name under the external IPs column. It can then be called on the command line.<\/p>\n\n\n\n

curl lb-0ad5c7ed5fac4bdc8b7178264467c320-1.upcloudlb.com<\/code><\/pre>\n\n\n\n
Hello! \ud83d\udc4b\n\nHostname: hello-uks-77547779f-bkrm8\nAddress:  192.168.3.238:80\n\nUpCloudLtd \/ hello-container at 72507bf9<\/pre>\n\n\n\n

You can also open the load balancer address on your web browser.<\/p>\n\n\n\n

\"Hello<\/figure>\n\n\n\n

That’s it! You should now have a fully functional Managed Kubernetes with kubectl configured to connect to the control plain.<\/p>\n\n\n\n

You can learn more about exposing services<\/a> or adding persistent volumes<\/a> for storage at our GitHub page.<\/p>\n","protected":false},"featured_media":33067,"comment_status":"open","ping_status":"closed","template":"","community-category":[109,114,127],"class_list":["post-32921","tutorial","type-tutorial","status-publish","has-post-thumbnail","hentry","community-category-upcloud-services","community-category-kubernetes","community-category-managed-services"],"acf":[],"_links":{"self":[{"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/tutorial\/32921","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/tutorial"}],"about":[{"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/types\/tutorial"}],"replies":[{"embeddable":true,"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/comments?post=32921"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/media\/33067"}],"wp:attachment":[{"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/media?parent=32921"}],"wp:term":[{"taxonomy":"community-category","embeddable":true,"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/community-category?post=32921"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}