{"id":6399,"date":"2021-05-10T20:59:51","date_gmt":"2021-05-10T15:29:51","guid":{"rendered":"https:\/\/www.skynats.com\/?p=6399"},"modified":"2021-11-03T12:46:44","modified_gmt":"2021-11-03T07:16:44","slug":"deploy-php-application-with-kubernetes-on-ubuntu-18-04","status":"publish","type":"post","link":"https:\/\/www.skynats.com\/blog\/deploy-php-application-with-kubernetes-on-ubuntu-18-04\/","title":{"rendered":"Deploy PHP Application with Kubernetes on Ubuntu 18.04"},"content":{"rendered":"\n<p>Kubernetes is a container orchestration framework that is open source. You can build, upgrade, and scale containers without having to worry about downtime.<\/p>\n\n\n\n<p>Nginx serves as a proxy for PHP-FPM while running a PHP script. Containerizing this configuration in a single container can be a pain, but Kubernetes can make it easier to handle both services in their own containers. Using Kubernetes will allow you to keep your application up to date.<\/p>\n\n\n\n<p>As part of our <a href=\"https:\/\/www.skynats.com\/digitalocean-management\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span style=\"color:#036b98\" class=\"has-inline-color\">DigitalOcean management services<\/span><\/a>, we&#8217;ve seen some such Kubernetes-related queries here at Skynats. Today, we&#8217;ll look at how to use Kubernetes to deploy a PHP framework on Ubuntu 18.04.<\/p>\n\n\n\n<p><strong>Create PHP-FPM and Nginx Services<\/strong><\/p>\n\n\n\n<p>The PHP-FPM and Nginx services will be created in this phase. Access to PHP-FPM pods will be granted by the PHP-FPM program, while access to Nginx pods will be granted by the Nginx service. Since the PHP-FPM pods will be proxied by Nginx pods, you&#8217;ll need to tell the service where to look for them.<\/p>\n\n\n\n<p>You&#8217;ll start by making a directory to store your Kubernetes object definitions. Create the definitions directory on your master node by SSH to the master node to store your Kubernetes object definitions.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir definitions<\/code><\/pre>\n\n\n\n<p>Move to the newly created&nbsp;<code>definitions<\/code>&nbsp;directory<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd definitions<\/code><\/pre>\n\n\n\n<p>Create a php service.yaml file for your PHP-FPM service.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim php_service.yaml<\/code><\/pre>\n\n\n\n<p>To indicate that this object is a service, set the kind to Service. Since it will have links to PHP-FPM, call the service PHP. You&#8217;ll use labels to logically group related objects. Labels will be used to divide objects into &#8220;tiers&#8221;, such as frontend and backend. Since the PHP pods will be running behind this service, you can name it tier: backend.<\/p>\n\n\n\n<p>Selector labels are used by a service to deciding which pods to access. To allocate the pod to the backend tier, use the tier: backend label. To specify that this pod runs PHP, you&#8217;ll also add the app: PHP name. After the metadata portion, add these two labels. Finally, specify the port used to access this service.<\/p>\n\n\n\n<p>The following is an example of a completed php service.yaml file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apiVersion: v1\nkind: Service\nmetadata:\n  name: php\n  labels:\n    tier: backend\nspec:\n  selector:\n    app: php\n    tier: backend\n  ports:\n  - protocol: TCP\n    port: 9000<\/code><\/pre>\n\n\n\n<p>Save the file and create the service for php-fpm using the below command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl apply -f php_service.yaml<\/code><\/pre>\n\n\n\n<p>Verify that your service is running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl get svc<\/code><\/pre>\n\n\n\n<p>You will see your PHP-FPM service running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Output\nNAME         TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE\nkubernetes   ClusterIP   10.96.0.1       &lt;none&gt;        443\/TCP    10m\nphp          ClusterIP   10.100.59.238   &lt;none&gt;        9000\/TCP   5m<\/code><\/pre>\n\n\n\n<p>Now, we can create the Nginx service. Create and open a new file called nginx_service.yaml.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim nginx_service.yaml<\/code><\/pre>\n\n\n\n<p>Since this service can be used to manage Nginx pods, you should call it nginx. You&#8217;ll also have a tier: backend mark to indicate that it belongs in the back-end tier:<br>Target the pods with the selector labels app: nginx and tier: backend, much like the PHP service. Make this service available on port 80, which is the standard HTTP port.<br>Using your Droplet&#8217;s public IP address, the Nginx service will be publicly open to the internet. Add your IP under spec.externalIPs.<\/p>\n\n\n\n<p>The following is an example of a completed Nginx service.yaml file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apiVersion: v1\nkind: Service\nmetadata:\n  name: nginx\n  labels:\n    tier: backend\nspec:\n  selector:\n    app: nginx\n    tier: backend\n  ports:\n  - protocol: TCP\n    port: 80\n  externalIPs:\n  - your_public_ip<\/code><\/pre>\n\n\n\n<p>Save and close the file. Create the Nginx service:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl apply -f nginx_service.yaml<\/code><\/pre>\n\n\n\n<p>You can view all running services by executing:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl get svc<\/code><\/pre>\n\n\n\n<p>You will see both the PHP-FPM and Nginx services listed in the output:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Output\nNAME         TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE\nkubernetes   ClusterIP   10.96.0.1       &lt;none&gt;        443\/TCP    13m\nnginx        ClusterIP   10.102.160.47   your_public_ip 80\/TCP     50s\nphp          ClusterIP   10.100.59.238   &lt;none&gt;        9000\/TCP   8m<\/code><\/pre>\n\n\n\n<p><strong>Install the DigitalOcean storage plugin for deploying the PHP Application<\/strong><\/p>\n\n\n\n<p>To store your DigitalOcean API token, you&#8217;ll first create a Kubernetes Secret object. Secret objects are used to share confidential information with other Kubernetes objects in the same namespace, such as SSH keys and passwords. Namespaces allow you to divide your Kubernetes objects logically.<\/p>\n\n\n\n<p>Open a file named secret.yaml<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim secret.yaml<\/code><\/pre>\n\n\n\n<p>Your Secret object will be called digital ocean, and it will be added to the kube-system namespace. Add the access-token as stringData. This is what your secret.yaml file would look like:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apiVersion: v1\nkind: Secret\nmetadata:\n  name: digitalocean\n  namespace: kube-system\nstringData:\n  access-token: your-api-token<\/code><\/pre>\n\n\n\n<p>Create the secret service:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl apply -f secret.yaml<\/code><\/pre>\n\n\n\n<p>Now, install the DigitalOcean block storage plug-in as your Secret is set up.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl apply -f https:\/\/raw.githubusercontent.com\/digitalocean\/csi-digitalocean\/master\/deploy\/kubernetes\/releases\/csi-digitalocean-v1.1.0.yaml<\/code><\/pre>\n\n\n\n<p>You can now build block storage to store your application code and configuration files after installing the DigitalOcean storage plug-in.<\/p>\n\n\n\n<p><strong>Configuring the Persistent Volume on Ubuntu System.<\/strong><\/p>\n\n\n\n<p>A Persistent Volume is accessed via a PersistentVolumeClaim, or PVC, which mounts the PV along the appropriate path.<\/p>\n\n\n\n<p>Open file code_volume.yaml<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim code_volume.yaml<\/code><\/pre>\n\n\n\n<p>Add the below code to the file<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apiVersion: v1\nkind: PersistentVolumeClaim\nmetadata:\n  name: code\nspec:\n  accessModes:\n  - ReadWriteOnce\n  resources:\n    requests:\n      storage: 1Gi\n  storageClassName: do-block-storage<\/code><\/pre>\n\n\n\n<p>Save the file and Create the&nbsp;<code>code<\/code>&nbsp;PVC using&nbsp;<code>kubectl<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl apply -f code_volume.yaml<\/code><\/pre>\n\n\n\n<p>To view available Persistent Volumes:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl get pv<\/code><\/pre>\n\n\n\n<p>Create PHP-FPM Application deployment<\/p>\n\n\n\n<p>To create your Deployment, open a new file called php_deployment.yaml<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim php_deployment.yaml<\/code><\/pre>\n\n\n\n<p>The Deployment will manage your PHP-FPM pods, so name the Deployment object&nbsp;<code>php<\/code>. Add the below code to the file opened.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apiVersion: apps\/v1\nkind: Deployment\nmetadata:\n  name: php\n  labels:\n    tier: backend\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      app: php\n      tier: backend\n  template:\n    metadata:\n      labels:\n        app: php\n        tier: backend\n    spec:\n      volumes:\n      - name: code\n        persistentVolumeClaim:\n          claimName: code\n      containers:\n      - name: php\n        image: php:7-fpm\n        volumeMounts:\n        - name: code\n          mountPath: \/code\n      initContainers:\n      - name: install\n        image: busybox\n        volumeMounts:\n        - name: code\n          mountPath: \/code\n        command:\n        - wget\n        - \"-O\"\n        - \"\/code\/index.php\"\n        - https:\/\/raw.githubusercontent.com\/do-community\/php-kubernetes\/master\/index.php<\/code><\/pre>\n\n\n\n<p>Save the file and create the PHP-FPM Deployment<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl apply -f php_deployment.yaml<\/code><\/pre>\n\n\n\n<p>You can view your Deployment by running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl get deployments<\/code><\/pre>\n\n\n\n<p>You can view the pods in this Deployment<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl get pods<\/code><\/pre>\n\n\n\n<p><strong>Nginx Deployment on Ubuntu server to run PHP Application<\/strong><\/p>\n\n\n\n<p>To configure Nginx in this step, you&#8217;ll use a ConfigMap. Your configuration is stored in a key-value format in a ConfigMap, which you can reference in other Kubernetes object definitions.<\/p>\n\n\n\n<p>Create a nginx_configMap.yaml file for your ConfigMap<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim nginx_configMap.yaml<\/code><\/pre>\n\n\n\n<p>Add the&nbsp;<code>data<\/code>&nbsp;for the ConfigMap. The final nginx_configMap.yaml will be as below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apiVersion: v1\nkind: ConfigMap\nmetadata:\n  name: nginx-config\n  labels:\n    tier: backend\ndata:\n  config : |\n    server {\n      index index.php index.html;\n      error_log  \/var\/log\/nginx\/error.log;\n      access_log \/var\/log\/nginx\/access.log;\n      root \/code;\n\n      location \/ {\n          try_files $uri $uri\/ \/index.php?$query_string;\n      }\n\n      location ~ \\.php$ {\n          try_files $uri =404;\n          fastcgi_split_path_info ^(.+\\.php)(\/.+)$;\n          fastcgi_pass php:9000;\n          fastcgi_index index.php;\n          include fastcgi_params;\n          fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n          fastcgi_param PATH_INFO $fastcgi_path_info;\n        }\n    }<\/code><\/pre>\n\n\n\n<p>Save the file&nbsp;and create ConfigMap<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl apply -f nginx_configMap.yaml<\/code><\/pre>\n\n\n\n<p>After creating ConfigMap, we can build the Nginx Deployment. <\/p>\n\n\n\n<p>Open nginx_deployment.yaml file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim nginx_deployment.yaml<\/code><\/pre>\n\n\n\n<p>Paste the entire code in the file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apiVersion: apps\/v1\nkind: Deployment\nmetadata:\n  name: nginx\n  labels:\n    tier: backend\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      app: nginx\n      tier: backend\n  template:\n    metadata:\n      labels:\n        app: nginx\n        tier: backend\n    spec:\n      volumes:\n      - name: code\n        persistentVolumeClaim:\n          claimName: code\n      - name: config\n        configMap:\n          name: nginx-config\n          items:\n          - key: config\n            path: site.conf\n      containers:\n      - name: nginx\n        image: nginx:1.7.9\n        ports:\n        - containerPort: 80\n        volumeMounts:\n        - name: code\n          mountPath: \/code\n        - name: config\n          mountPath: \/etc\/nginx\/conf.d<\/code><\/pre>\n\n\n\n<p>Save the file and create Nginx Deployment<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl apply -f nginx_deployment.yaml<\/code><\/pre>\n\n\n\n<p>You can see Nginx and PHP-FPM Deployments using:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl get deployments<\/code><\/pre>\n\n\n\n<p>Run the command to list the pods managed by the Deployments<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl get pods<\/code><\/pre>\n\n\n\n<p>Finally, you can see the list of services running by:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl get services -o wide<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>Output\nNAME         TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE       SELECTOR\nkubernetes   ClusterIP   10.96.0.1       &lt;none&gt;        443\/TCP    39m       &lt;none&gt;\nnginx        ClusterIP   10.102.160.47   your_public_ip 80\/TCP     27m       app=nginx,tier=backend\nphp          ClusterIP   10.100.59.238   &lt;none&gt;        9000\/TCP   34m       app=php,tier=backend<\/code><\/pre>\n\n\n\n<p>You will get your public IP from the above output. Visit your server by typing http:\/\/your_public_ip into your browser. You&#8217;ll see the PHP info() performance and know that your Kubernetes services are up and running.<\/p>\n\n\n\n<p>If you need any assistance, our <a href=\"https:\/\/www.skynats.com\/contact-us\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span style=\"color:#036f9d\" class=\"has-inline-color\">technical teams<\/span><\/a> are available anytime.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Kubernetes is a container orchestration framework that is open source. You can build, upgrade, and scale containers without having to worry about downtime. Nginx serves as a proxy for PHP-FPM while running a PHP script. Containerizing this configuration in a single container can be a pain, but Kubernetes can make it easier to handle both [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,122,127,337,336],"tags":[340,338],"class_list":["post-6399","post","type-post","status-publish","format-standard","hentry","category-blog","category-digitalocean-management","category-docker","category-kubernetes","category-kubernetes-on-digitalocean","tag-digitalocean-kubernetes","tag-kubernetes-deployment"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Deploy PHP Application with Kubernetes on Ubuntu 18.04 | Skynats<\/title>\n<meta name=\"description\" content=\"Kubernetes is a container orchestration framework that is open source. You can build, upgrade, and scale containers without having to worry about downtime.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.skynats.com\/blog\/deploy-php-application-with-kubernetes-on-ubuntu-18-04\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Deploy PHP Application with Kubernetes on Ubuntu 18.04\" \/>\n<meta property=\"og:description\" content=\"Kubernetes is a container orchestration framework that is open source. You can build, upgrade, and scale containers without having to worry about downtime.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.skynats.com\/blog\/deploy-php-application-with-kubernetes-on-ubuntu-18-04\/\" \/>\n<meta property=\"og:site_name\" content=\"Server Management Services | Cloud Management | Skynats\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/skynats\" \/>\n<meta property=\"article:published_time\" content=\"2021-05-10T15:29:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-11-03T07:16:44+00:00\" \/>\n<meta name=\"author\" content=\"Thameem\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@skynatstech\" \/>\n<meta name=\"twitter:site\" content=\"@skynatstech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Thameem\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/deploy-php-application-with-kubernetes-on-ubuntu-18-04\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/deploy-php-application-with-kubernetes-on-ubuntu-18-04\\\/\"},\"author\":{\"name\":\"Thameem\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#\\\/schema\\\/person\\\/ba3ccdb869f155f8613922b77bacd029\"},\"headline\":\"Deploy PHP Application with Kubernetes on Ubuntu 18.04\",\"datePublished\":\"2021-05-10T15:29:51+00:00\",\"dateModified\":\"2021-11-03T07:16:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/deploy-php-application-with-kubernetes-on-ubuntu-18-04\\\/\"},\"wordCount\":948,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#organization\"},\"keywords\":[\"digitalocean kubernetes\",\"kubernetes deployment\"],\"articleSection\":[\"Blog\",\"digitalocean-management\",\"docker\",\"kubernetes\",\"kubernetes on digitalocean\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.skynats.com\\\/blog\\\/deploy-php-application-with-kubernetes-on-ubuntu-18-04\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/deploy-php-application-with-kubernetes-on-ubuntu-18-04\\\/\",\"url\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/deploy-php-application-with-kubernetes-on-ubuntu-18-04\\\/\",\"name\":\"Deploy PHP Application with Kubernetes on Ubuntu 18.04 | Skynats\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#website\"},\"datePublished\":\"2021-05-10T15:29:51+00:00\",\"dateModified\":\"2021-11-03T07:16:44+00:00\",\"description\":\"Kubernetes is a container orchestration framework that is open source. You can build, upgrade, and scale containers without having to worry about downtime.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/deploy-php-application-with-kubernetes-on-ubuntu-18-04\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.skynats.com\\\/blog\\\/deploy-php-application-with-kubernetes-on-ubuntu-18-04\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/deploy-php-application-with-kubernetes-on-ubuntu-18-04\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Deploy PHP Application with Kubernetes on Ubuntu 18.04\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/\",\"name\":\"Server Management Services | Cloud Management | Skynats\",\"description\":\"Server Management and Cloud Management\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#organization\",\"name\":\"Skynats Technologies\",\"url\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/Sknats-Logo-New-whole.png\",\"contentUrl\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/Sknats-Logo-New-whole.png\",\"width\":989,\"height\":367,\"caption\":\"Skynats Technologies\"},\"image\":{\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/skynats\",\"https:\\\/\\\/x.com\\\/skynatstech\",\"https:\\\/\\\/www.instagram.com\\\/skynatstech\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/skynats-technologies\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCvTAjrFJ4_E2MJKwlDHomlg\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#\\\/schema\\\/person\\\/ba3ccdb869f155f8613922b77bacd029\",\"name\":\"Thameem\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1b7c31ade9c00e4d81b5885f1127bd14ff4e7b7e025544efedb218b803ee6fa4?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1b7c31ade9c00e4d81b5885f1127bd14ff4e7b7e025544efedb218b803ee6fa4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1b7c31ade9c00e4d81b5885f1127bd14ff4e7b7e025544efedb218b803ee6fa4?s=96&d=mm&r=g\",\"caption\":\"Thameem\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Deploy PHP Application with Kubernetes on Ubuntu 18.04 | Skynats","description":"Kubernetes is a container orchestration framework that is open source. You can build, upgrade, and scale containers without having to worry about downtime.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.skynats.com\/blog\/deploy-php-application-with-kubernetes-on-ubuntu-18-04\/","og_locale":"en_US","og_type":"article","og_title":"Deploy PHP Application with Kubernetes on Ubuntu 18.04","og_description":"Kubernetes is a container orchestration framework that is open source. You can build, upgrade, and scale containers without having to worry about downtime.","og_url":"https:\/\/www.skynats.com\/blog\/deploy-php-application-with-kubernetes-on-ubuntu-18-04\/","og_site_name":"Server Management Services | Cloud Management | Skynats","article_publisher":"https:\/\/www.facebook.com\/skynats","article_published_time":"2021-05-10T15:29:51+00:00","article_modified_time":"2021-11-03T07:16:44+00:00","author":"Thameem","twitter_card":"summary_large_image","twitter_creator":"@skynatstech","twitter_site":"@skynatstech","twitter_misc":{"Written by":"Thameem","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.skynats.com\/blog\/deploy-php-application-with-kubernetes-on-ubuntu-18-04\/#article","isPartOf":{"@id":"https:\/\/www.skynats.com\/blog\/deploy-php-application-with-kubernetes-on-ubuntu-18-04\/"},"author":{"name":"Thameem","@id":"https:\/\/www.skynats.com\/blog\/#\/schema\/person\/ba3ccdb869f155f8613922b77bacd029"},"headline":"Deploy PHP Application with Kubernetes on Ubuntu 18.04","datePublished":"2021-05-10T15:29:51+00:00","dateModified":"2021-11-03T07:16:44+00:00","mainEntityOfPage":{"@id":"https:\/\/www.skynats.com\/blog\/deploy-php-application-with-kubernetes-on-ubuntu-18-04\/"},"wordCount":948,"commentCount":0,"publisher":{"@id":"https:\/\/www.skynats.com\/blog\/#organization"},"keywords":["digitalocean kubernetes","kubernetes deployment"],"articleSection":["Blog","digitalocean-management","docker","kubernetes","kubernetes on digitalocean"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.skynats.com\/blog\/deploy-php-application-with-kubernetes-on-ubuntu-18-04\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.skynats.com\/blog\/deploy-php-application-with-kubernetes-on-ubuntu-18-04\/","url":"https:\/\/www.skynats.com\/blog\/deploy-php-application-with-kubernetes-on-ubuntu-18-04\/","name":"Deploy PHP Application with Kubernetes on Ubuntu 18.04 | Skynats","isPartOf":{"@id":"https:\/\/www.skynats.com\/blog\/#website"},"datePublished":"2021-05-10T15:29:51+00:00","dateModified":"2021-11-03T07:16:44+00:00","description":"Kubernetes is a container orchestration framework that is open source. You can build, upgrade, and scale containers without having to worry about downtime.","breadcrumb":{"@id":"https:\/\/www.skynats.com\/blog\/deploy-php-application-with-kubernetes-on-ubuntu-18-04\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.skynats.com\/blog\/deploy-php-application-with-kubernetes-on-ubuntu-18-04\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.skynats.com\/blog\/deploy-php-application-with-kubernetes-on-ubuntu-18-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.skynats.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Deploy PHP Application with Kubernetes on Ubuntu 18.04"}]},{"@type":"WebSite","@id":"https:\/\/www.skynats.com\/blog\/#website","url":"https:\/\/www.skynats.com\/blog\/","name":"Server Management Services | Cloud Management | Skynats","description":"Server Management and Cloud Management","publisher":{"@id":"https:\/\/www.skynats.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.skynats.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.skynats.com\/blog\/#organization","name":"Skynats Technologies","url":"https:\/\/www.skynats.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.skynats.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2021\/08\/Sknats-Logo-New-whole.png","contentUrl":"https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2021\/08\/Sknats-Logo-New-whole.png","width":989,"height":367,"caption":"Skynats Technologies"},"image":{"@id":"https:\/\/www.skynats.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/skynats","https:\/\/x.com\/skynatstech","https:\/\/www.instagram.com\/skynatstech\/","https:\/\/www.linkedin.com\/company\/skynats-technologies","https:\/\/www.youtube.com\/channel\/UCvTAjrFJ4_E2MJKwlDHomlg"]},{"@type":"Person","@id":"https:\/\/www.skynats.com\/blog\/#\/schema\/person\/ba3ccdb869f155f8613922b77bacd029","name":"Thameem","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1b7c31ade9c00e4d81b5885f1127bd14ff4e7b7e025544efedb218b803ee6fa4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1b7c31ade9c00e4d81b5885f1127bd14ff4e7b7e025544efedb218b803ee6fa4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1b7c31ade9c00e4d81b5885f1127bd14ff4e7b7e025544efedb218b803ee6fa4?s=96&d=mm&r=g","caption":"Thameem"}}]}},"_links":{"self":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/6399","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/comments?post=6399"}],"version-history":[{"count":0,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/6399\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/media?parent=6399"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/categories?post=6399"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/tags?post=6399"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}