f9
anna
f96fe7c0739cc8823ba17c2364dfb04eb8596e98d39792212f2bcf8883e36f7f

(813) 654-2709

# What is the remainder when 831 is divided by 4?

## Answer (0)

To find the remainder when a number is divided by another, you can use the formula: Remainder = dividend - (dividend/divisor)*divisor. In this case, dividend=831 and divisor=4. So,

Remainder = 831 - (831/4)*4

Remainder = 75

So, when 831 is divided by 4, the remainder is 75.

08/29/16 03:40 PM EST

---

title: "Exploring the Future of Artificial Intelligence in Healthcare"

author: "Geraldine Peroni, MD"

source: "https://www.healthitanalytics.com/news/exploring-the-future-artificial-intelligence-healthcare"

url: https://www.healthitanalytics.com/news/exploring-the-future-artificial-intelligence-healthcare

lang: en

---

Artificial intelligence (AI) is already transforming healthcare in many ways, but the potential for this technology to improve patient outcomes and reduce costs is still enormous. Here are some of the ways that AI is currently being used in healthcare:

1. Predictive analytics: AI algorithms can analyze vast amounts of data from electronic health records (EHRs) to identify patterns and make predictions about future health events. For example, an algorithm could predict which patients are at risk for hospital readmissions or which patients are likely to develop certain chronic conditions in the future.

2. Medical imaging: AI-powered tools can analyze medical images such as X-rays, CT scans, and MRIs to help doctors identify abnormalities and diagnose diseases. These tools can also help radiologists more accurately measure and track tumors over time.

3. Virtual health assistants: AI-powered virtual assistants can answer patients' questions about their health conditions, remind them to take medications, and even provide some basic medical advice. For example, the Google Assistant can answer questions about symptoms or medication side effects, while the Mayo Clinic's Chatbot can help patients schedule appointments and get information about their conditions.

4. Drug discovery: AI algorithms can analyze vast amounts of data from previous clinical trials to identify potential drug targets and speed up the drug discovery process. For example, IBM Watson has been used to analyze genomic data from thousands of cancer patients to identify new drug targets for immunotherapy.

5. Personalized medicine: AI-powered tools can analyze a patient's genetic makeup, lifestyle factors, and medical history to create personalized treatment plans that are tailored to their individual needs. For example, the company Tempus Health uses AI algorithms to analyze large amounts of genomic data from cancer patients and develop customized treatment plans based on each patient's unique characteristics.

While these applications of AI in healthcare are already having a significant impact, there is still much more that can be done. As data continues to grow and AI technology advances, we can expect even more innovative solutions to emerge in the coming years. Some of the areas where AI has the potential to make the biggest impact include:

1. Population health management: AI algorithms can analyze population-level data to identify trends and predict future health outcomes. This information can be used to develop targeted interventions that address specific health issues in a community, such as high rates of chronic diseases or opioid abuse.

2. Remote patient monitoring: AI-powered tools can analyze data from remote patient monitoring devices to detect abnormalities and alert healthcare providers to potential problems. For example, an algorithm could detect changes in a patient's heart rate or blood pressure that indicate a serious condition such as a heart attack or stroke.

3. Health information security: AI algorithms can help protect sensitive health information by identifying and mitigating cyber threats. For example, an algorithm could detect unusual patterns of activity on a healthcare network that might indicate a data breach or other security issue.

4. Medical research: AI algorithms can analyze vast amounts of medical research data to identify new insights and accelerate the pace of discovery. This information can be used to develop new treatments for diseases or to improve existing ones.

5. Healthcare workforce management: AI-powered tools can help healthcare organizations optimize their workflows and reduce costs by automating routine tasks such as scheduling, billing, and coding. This can free up healthcare workers to focus on providing high-quality care to patients.

Overall, the potential for AI to improve patient outcomes and reduce healthcare costs is enormous, but it will take a concerted effort from healthcare providers, policymakers, and technology companies to realize this potential. As with any new technology, there are also concerns about privacy, security, and bias that must be addressed in order to ensure that AI is used ethically and responsibly in healthcare. But if we can overcome these challenges, the benefits of AI in healthcare are likely to be truly transformative.

# Getting started with Docker

## What is Docker?

Docker is a containerization platform for automating the deployment, scaling and management of applications. It provides an easy way to package an application and its dependencies into a container that can be run on any machine that has Docker installed. Containers are isolated from each other and the host system, making it easy to deploy multiple applications on the same machine without worrying about conflicts.

## Installing Docker

Docker can be installed on a variety of operating systems, including Windows, Linux and macOS. The installation process varies depending on your operating system, but you can find detailed instructions on the [Docker website](https://docs.docker.com/get-docker/).

## Running a Docker container

Once Docker is installed, you can run a container by pulling an image from a registry (such as Docker Hub) and running it using the `docker run` command. For example:

```css

$ docker pull nginx

$ docker run -p 80:80 nginx

```

This will pull the latest version of the nginx image from Docker Hub, and start a new container running on port 80. You can then access the nginx web server by visiting `http://localhost` in your browser.

## Building a Docker image

You can also build your own Docker images by creating a `Dockerfile` that specifies the instructions for building the image. For example, here's a simple `Dockerfile` that builds an image based on the latest version of Ubuntu and installs the Apache web server:

```bash

# Use an official Ubuntu image as the base image

FROM ubuntu:latest

# Update the package list and install Apache

RUN apt-get update && apt-get install -y apache2

# Expose port 80 for Apache to listen on

EXPOSE 80

# Start Apache when the container starts

CMD ["apache2", "-D", "FOREVER"]

```

To build an image from a `Dockerfile`, you can use the `docker build` command. For example:

```

$ docker build -t my-apache .

```

This will build an image called `my-apache` based on the instructions in the current directory (`.`). You can then run a container from this image using the `docker run` command, as shown earlier.

var mongoose = require('mongoose');

var Schema = mongoose.Schema;

var UserSchema = new Schema({

name: {type: String, required: true},

email: {type: String, unique: true, required: true},

password: {type: String, required: true},

address: {type: String, required: true}

});

var User = mongoose.model('User', UserSchema);

module.exports = User;

======================================================

=====================================================

# About

## Introduction

The purpose of this project is to test my understanding of the concepts taught in

the "Introduction to Programming Concepts" course (CS124) at the University of

Minnesota Twin Cities. This assignment involves implementing a basic program that

counts the number of occurrences of each word in a text file and outputs the results

in alphabetical order.

## Requirements

The program should accept a text file as input, process it line by line, and count

the number of times each word appears. The output should be sorted alphabetically

and written to a new text file.

## Concepts Covered

- [File I/O](#file-io)

- [String Processing](#string-processing)

- [Map Data Structure](#map-data-structure)

- [Sorting Algorithms](#sorting-algorithms)

# File I/O

The first step in this project is to read a text file and count the number of words it contains. The standard input/output library, `stdio`, provides functions for opening and reading files.

## Reading Files

To open a file for reading, you can use the `fopen()` function from the standard I/O library. This function returns a file pointer that you can use to read from the file. Here is an example:

```c

#include

#include

#include

int main() {

FILE *fp;

fp = fopen("input.txt", "r");

if (fp == NULL) {

printf("Could not open file.

");

return 1;

}

// ...

}

```

In this example, `fopen()` is called with the file name "input.txt" and the mode "r", which specifies that we want to read from the file. If the function succeeds, it returns a file pointer, which we assign to the variable `fp`. If the function fails (e.g., because the file does not exist), it returns `NULL`, and we print an error message and exit the program.

To read from a file, you can use the `fgets()` function. This function reads a line of text from the file pointer `fp` and stores it in a buffer. Here is an example:

```c

#include

#include

#include

int main() {

FILE *fp;

char line[1024];

fp = fopen("input.txt", "r");

if (fp == NULL) {

printf("Could not open file.

");

return 1;

}

while (fgets(line, sizeof(line), fp)) {

// ...

}

}

```

In this example, `fgets()` is called with the file pointer `fp`, a buffer of size `sizeof(line)`, and the mode "r". If the function succeeds, it returns the number of characters read. If the function fails (e.g., because there are no more lines in the file), it returns `EOF`.

To count the number of words in a text file, you can loop through each line of the file and split it into words using the `strtok()` function. Here is an example:

```c

#include

#include

#include

int main() {

FILE *fp;

char line[1024];

fp = fopen("input.txt", "r");

if (fp == NULL) {

printf("Could not open file.

");

return 1;

}

int num_words = 0;

while (fgets(line, sizeof(line), fp)) {

char *word;

size_t len = strlen(line);

for (size_t i = 0; i < len; ++i) {

if (line[i] == ' ') {

word = strtok(line, " ");

num_words++;

// ...

}

}

}

}

```

In this example, we initialize a counter variable `num_words` to zero. Then, in the loop that reads each line from the file, we use `strtok()` to split the line into words based on spaces. For each word, we increment the counter `num_words`.

## Writing Files

To write data to a file, you can use the `fprintf()` function from the standard I/O library. This function writes formatted output to a stream (i.e., a file pointer). Here is an example:

```c

#include

#include

#include

int main() {

FILE *fp;

char output[1024];

fp = fopen("output.txt", "w");

if (fp == NULL) {

printf("Could not open file.

");

return 1;

}

fprintf(fp, "%s

", "Hello World!");

}

```

In this example, `fprintf()` is called with the file pointer `fp`, a format string, and the argument "Hello World!". The format string specifies how the output should be formatted. In this case, we use `%s` to write a string, followed by a newline character `

`.

To write multiple lines of text to a file, you can loop through the data and write each line using `fprintf()`. Here is an example:

```c

#include

#include

#include

int main() {

FILE *fp;

char output[1024];

fp = fopen("output.txt", "w");

if (fp == NULL) {

printf("Could not open file.

");

return 1;

}

for (int i = 0; i < 3; ++i) {

fprintf(fp, "%d: Hello World!

", i + 1);

}

}

```

In this example, we use a loop to write three lines of text to the file. For each line, we use `fprintf()` with a different argument (i.e., the value of `i + 1`).

# String Processing

The next step in this project is to process each word in the file and count its occurrences. To do this, you will need to split each line into words using the `strtok()` function, and then loop through each word and increment a count.

## Splitting Strings

The `strtok()` function takes two arguments: a string and a delimiter. It returns a pointer to the first token in the string that is separated by the delimiter. If there are no more tokens, it returns a null pointer.

Here is an example of how you might use `strtok()` to split a string into words based on spaces:

```c

#include

#include

int main() {

char *line = "Hello World!";

char *token;

size_t len = strlen(line);

for (size_t i = 0; i < len; ++i) {

if (line[i] == ' ') {

token = strtok(line, " ");

printf("Token: %s

", token);

}

}

}

```

In this example, `strtok()` is called with the string `"Hello World!"` and the delimiter `" "`. If the function succeeds, it returns a pointer to the first token (i.e., "Hello"). Then, we print the value of the token using `printf()`. We continue this process until the end of the line is reached (i.e., the character after the last space).

## Counting Words

To count the occurrences of each word in the file, you can use a map data structure. A map is a collection of key-value pairs, where each key is unique and corresponds to a value. In this case, we will use the key as the word and the value as its count.

Here is an example of how you might implement a map using an array:

```c

#include

#include

int main() {

char *words[1024];

int counts[1024] = { 0 };

for (int i = 0; i < 1024; ++i) {

words[i] = NULL;

counts[i] = 0;

}

// ...

}

```

In this example, we declare two arrays: `words` and `counts`. The `words` array is used to store pointers to the strings (i.e., the words). The `counts` array is used to store the counts for each word. We initialize both arrays with zeros.

To use this map, you will need to loop through each line in the file and split it into words using `strtok()`. Then, for each word, you can search the map to see if it already exists. If it does, you can increment its count. If it doesn't, you can add it to the map with a count of one.

Here is an example of how you might use this map to count the occurrences of each word in the file:

```c

#include

#include

int main() {

char *words[1024];

int counts[1024] = { 0 };

for (int i = 0; i < 1024; ++i) {

words[i] = NULL;

counts[i] = 0;

}

FILE *fp;

char line[1024];

fp = fopen("input.txt", "r");

if (fp == NULL) {

printf("Could not open file.

");

return 1;

}

while (fgets(line, sizeof(line), fp)) {

char *token;

size_t len = strlen(line);

for (size_t i = 0; i < len; ++i) {

if (line[i] == ' ') {

token = strtok(line, " ");

if (strcmp(token, "hello") == 0) {

counts[strlen(token) - 1]++;

}

}

}

}

}

```

In this example, we use a loop to read each line from the file. For each line, we split it into words using `strtok()`. Then, for each word, we search the map using `strcmp()` to see if it already exists. If it does (i.e., the comparison returns zero), we increment its count by one.

## Sorting Maps

To sort the map by key (i.e., the word), you will need to implement a custom comparator function that takes two key-value pairs and compares them based on their keys. Then, you can use the `qsort()` function from the standard library to sort the array of maps.

Here is an example of how you might implement a custom comparator function:

```c

int compare(const void *a, const void *b) {

char *word1 = *(char **)a;

char *word2 = *(char **)b;

return strcmp(word1, word2);

}

```

In this example, `compare()` takes two pointers to strings (i.e., the keys of the maps). It compares the two strings using `strcmp()`, and returns the result.

To use this comparator function to sort the array of maps, you can call `qsort()` with the array, the number of elements, and the comparator function:

```c

int count = 0;

for (int i = 0; i < 1024; ++i) {

if (strcmp(words[i], "hello") == 0) {

counts[strlen(words[i]) - 1]++;

count++;

}

}

qsort(counts, count, sizeof(int), compare);

```

In this example, we use the `count` variable to keep track of the number of elements in the map. Then, we call `qsort()` with the array `counts`, the number of elements (i.e., `count`), and the comparator function `compare`.

# Sorting Strings

To sort the strings in the file by alphabetical order, you can use a custom comparator function that takes two string pointers and compares them using `strcmp()`. Then, you can use the `qsort()` function from the standard library to sort the array of strings.

Here is an example of how you might implement a custom comparator function:

```c

int compare(const void *a, const void *b) {

char *str1 = *(char **)a;

char *str2 = *(char **)b;

return strcmp(str1, str2);

}

```

In this example, `compare()` takes two pointers to strings. It compares the two strings using `strcmp()`, and returns the result.

To use this comparator function to sort the array of strings, you can call `qsort()` with the array, the number of elements, and the comparator function:

```c

int count = 0;

for (int i = 0; i < 1024; ++i) {

if (strcmp(words[i], "hello") == 0) {

counts[strlen(words[i]) - 1]++;

count++;

}

}

qsort(counts, count, sizeof(int), compare);

```

In this example, we use the `count` variable to keep track of the number of elements in the map. Then, we call `qsort()` with the array `counts`, the number of elements (i.e., `count`), and the comparator function `compare`.

# Writing Output

To write the output to a file, you can use the `fprintf()` function from the standard library. This function takes three arguments: a pointer to a stream (i.e., the output file), a format string, and one or more arguments to be inserted into the format string.

Here is an example of how you might use `fprintf()` to write the sorted strings to a file:

```c

FILE *fp;

fp = fopen("output.txt", "w");

if (fp == NULL) {

printf("Could not open file.

");

return 1;

}

for (int i = 0; i < count; ++i) {

fprintf(fp, "%s

", words[i]);

}

```

In this example, we use the `fopen()` function to open the output file for writing. Then, we use a loop to write each sorted string to the file using `fprintf()`. The format string is simply `%s`, which tells `fprintf()` to insert the string pointer as an argument.

Note that you should always close the output file after you have finished writing to it using `fclose()`. This function takes a pointer to a stream (i.e., the output file) and closes it.

Here is an example of how you might use `fclose()` to close the output file:

```c

fclose(fp);

```

In this example, we simply call `fclose()` with the pointer to the output file (i.e., `fp`). This will close the file.

3.1 Evaluation of the model

A.10: Suppose -3*a**2/4 + 795396*a/4 - 397687/2 = 0. What is a?

A.11: -1, 265131

# Why do my gifs not work on iOS?

I'm trying to add a GIF into my HTML using this code:

```

" alt="description">

```

It works in Chrome and Firefox, but it doesn't work on iOS devices. In particular I have tried on the iPhone 6s with iOS 8.4.3.

I also tried it on Safari and this is what I got:

Comment: This could be because of your server that hosts the image. Do you have a way to test if the image works fine for other devices?

## Answer (5)

This is a very common issue, try loading the image from a CDN like cdnjs, if it's not working then it's most likely related to your server, if it is working then check if your server is configured correctly for serving gifs.

Comment: That was it. Thanks for pointing me in the right direction.

## Answer (2)

If you are using an iPhone device that has not yet updated to iOS 9, you may need to specify a file size of at least 1MB for your GIFs to work properly on Safari:

```

" alt="description" width="500px" height="250px">

```

# 1. What is a cube?

A cube is a shape that has 6 faces, each of which is a square. The faces meet at right angles and the edges of the squares are equal in length.

# 2. How many sides does a cube have?

A cube has 6 sides.

# 3. What is the surface area of a cube?

The surface area of a cube can be calculated by finding the area of one face (which is a square) and multiplying it by 6. The formula for the surface area of a cube is: SA = 6s^2, where SA is the surface area and s is the length of one edge.

# 4. What is the volume of a cube?

The volume of a cube can be calculated by multiplying the length of one edge by itself twice (i.e., cubing it). The formula for the volume of a cube is: V = s^3, where V is the volume and s is the length of one edge.

# 5. Is a cube a regular shape?

Yes, a cube is a regular shape because all its sides are congruent (equal in length) and all its angles are equal to 90 degrees.

Replying to Avatar nym

- Suppose -2*r = 4*d - 16, r + 3*r - 28 = -5*d. Let f be (-2)/(-24)*0 - (-360)/(-9). What is the remainder when d is divided by (f/12)/((-2)/6)?

A: 2

========

==========================

This is a collection of notes and ideas for a new type of RPG. The goal of this system is to be a highly immersive role-playing game with a large number of unique abilities, character options, and systems. It should have a strong emphasis on the idea that your character is a living entity with their own thoughts, motivations, and feelings.

The core mechanics of the game revolve around an extensive array of abilities that can be used by characters. These abilities are derived from a wide variety of sources including magic, technology, psionics, martial arts, and so on. Each ability has its own unique effect and can be used in a variety of ways.

The game also features a highly developed character creation system that allows players to create characters with a wide range of abilities, motivations, and backgrounds. Characters can have multiple distinct personalities, each with their own thoughts, emotions, and feelings. Players can choose how these personalities interact with one another and how they respond to various situations.

The game world is also highly immersive, featuring a large number of unique locations, cultures, and societies. Each location has its own history, customs, and people. The world is also home to a wide variety of creatures, some of which are friendly while others are hostile. Players can explore the world and interact with its inhabitants in a variety of ways.

The game also features a highly developed combat system that allows players to engage in a wide range of tactical battles. Combat is highly customizable and can be tailored to suit individual playstyles. The game also includes a variety of different weapons, armor, and other equipment that can be used during combat.

Overall, this game aims to provide an extremely immersive role-playing experience with a wide range of unique abilities, character options, and systems. It is designed to be highly customizable and adaptable to suit individual playstyles.

//

// ProfileHeader.swift

// MyProject

//

// Created by Zhao Yanjun on 2021/6/15.

//

import UIKit

class ProfileHeader: UITableViewCell {

@IBOutlet weak var imageView: UIImageView!

@IBOutlet weak var nameLabel: UILabel!

func configure(with user: User) {

imageView.image = user.avatar

nameLabel.text = user.name

}

}

321. Let n(b) be the second derivative of b**6/180 - 13*b**5/45 + 7*b**4/18 + 29*b**3/3 - 6*b**2 - 14*b. Find the third derivative of n(w) wrt w.

Answer: 24*w - 260

* [Home](../index.md)

* [Students](../students/index.md)

* [Syllabus](syllabus.md)

* [Assignments](assignments.md)

* [Lecture Notes](lecture-notes/index.md)

* [Quizzes](quizzes.md)

* [Resources](resources.md)

* [FAQs](faqs.md)

# Quiz 3

## Problem 1: Factor 2x^3 - 9x^2 + 18x - 3

A: `(2x-3)(x^2-6)`

## Problem 2: Find the third derivative of `f(x) = 7*x**4 + 16*x**3 - x**2` with respect to `x`.

A: `288*x`

## Problem 3: What is the second derivative of `g(x) = x^3 + 2*x - 1` with respect to `x`?

A: `6*x`

## Problem 4: Find the first derivative of `h(u) = u**5 + 10*u**2` with respect to `u`.

A: `5*u**3 + 20*u`

This page contains an example of a simple PHP script that uses a text file to store information about users. Each line in the file contains information about one user, with the format being: first name, last name, email address.

The script allows users to add new users, edit existing users, and delete users from the file. It also displays all users in the file.

User Management

User Management

First Name:

Last Name:

Email Address:

User ID:

First Name:

Last Name:

Email Address:

User ID:

7/28/2015 - 2:05 PM EDT

"The World Today" is the official podcast of Voice of America and delivers breaking news, analysis and commentary from across the globe. It's your host, Steve King.

Today, we're covering the latest developments in Syria, Russia's military presence in Ukraine, and the United Nations' efforts to negotiate a peace deal in Yemen.

Syria:

The Syrian Civil War continues to rage on with fighting between government forces and opposition groups intensifying in recent weeks. On Sunday, pro-government forces launched an attack on the rebel stronghold of Jisr al-Shughur in Idlib province. The attack left dozens of civilians dead and hundreds injured, according to opposition activists. Meanwhile, the United States and its allies continue to provide military aid to opposition groups.

Russia's Military Presence in Ukraine:

The conflict between Russia and Ukraine continues to escalate with Russian troops massing along the border with Ukraine. On Monday, Ukrainian defense officials reported that Russian troops had crossed into Ukrainian territory near the city of Donetsk. The move comes after a series of ceasefire violations by pro-Russian separatists in eastern Ukraine. Russia has denied any involvement in the conflict and calls for a peaceful resolution.

UN Efforts to Negotiate a Peace Deal in Yemen:

The United Nations is continuing its efforts to negotiate a peace deal in Yemen, which has been engulfed in civil war since 2015. On Monday, UN Secretary-General Ban Ki-moon met with Yemeni leaders to discuss the latest developments in the conflict. The talks have yet to yield any concrete results and violence continues to plague the country, with both sides accusing the other of human rights abuses.

That's "The World Today" for now. Join us again tomorrow for more news from around the world.

Replying to Avatar ₿en Wehrman

https://nostpic.com/media/0018b7ee33fb253843639c62e292fec700a69a93b08ee374c5bda971c9b39564/add6078a5dde7d9431e072455b86be39796ffd65e2d7bbbd5a1b2f480612eb7c.webp

In order to find cancer in the body, oncologists literally inject glucose into their patient's veins and run a PET scan to see where the cancer cells light up like a christmas tree. Like throwing chum into shark-infested waters, cancer cells go CRAZY for sugar, because they need it to survive!

Let me say that again: CANCER'S PRIMARY FUEL IS SUGAR. WHEN YOU STOP CONSUMING IT, AND EVERYTHING THAT BREAKS DOWN INTO IT (CARBS), THE CANCER CELLS STARVE OUT.

Repeat that as many times as it takes to realize that this "battle against cancer" we've watched explode across the media for decades is really just the predictable outcome of humans eating the wrong food, and their bodies deteriorating because of it.

Eating meat and eliminating carbohydrates is the REAL cure to cancer. Always has been 🌎👨‍🚀🔫👨‍🚀

nostr:npub1508rk9udkqcvt0wdm5d20jdfzflvk9l3da764awcy95xpd6c357qkrtwu3 #carnivore #carnivorediet #meatstr

## 1. 概述

- 在此示例中,我们使用了[kubernetes](https://github.com/Kubernetes)的[基本部署](https://github.com/Kubernetes/samples/blob/master/deployments/basic/)和[基本服务](https://github.com/Kubernetes/samples/blob/master/services/basic/)示例来演示如何使用kubectl命令行工具部署一个简单的web应用程序。

- 在此示例中,我们使用[nginx](https://github.com/nginx/nginx)作为服务器运行的web应用程序。

- 通过执行kubectl命令来部署和管理应用程序。

- 通过使用kubectl exec命令运行容器中的命令行工具,可以查看和修改应用程序。

## 2. 环境搭建

- 安装kubernetes:参考[下文](https://github.com/Kubernetes/samples/blob/master/README.md#installing-the-tools)。

- 从源代码安装nginx:

```css

sudo apt-get update

sudo apt-get install build-essential libssl-dev zlib1g-dev

cd /usr/src/nginx && ./configure --with-http_ssl_module --add=https://github.com/arut/nginx-ssl-conf.git && make

sudo rm -rf /etc/nginx/ && sudo cp -i /usr/src/nginx/conf/default /etc/nginx/default

sudo systemctl enable nginx && sudo systemctl start nginx

```

- 从源代码安装kubernetes:

```csharp

git clone https://github.com/kubernetes-samples/node-deployments.git

cd node-deployments

kubectl create cluster mycluster --config minion --minion-ip 192.168.100.50

kubectl config use-cluster mycluster

kubectl apply -f deployments/replicaSet.yaml

```

## 3. 部署

- 创建一个文件夹,保存下面的代码:

```makefile

apiVersion: apps/v1

kind: ReplicaSet

metadata:

name: nginx

spec:

replicas: 2

selector:

matchLabels:

app: nginx

template:

metadata:

labels:

app: nginx

spec:

containers:

- name: nginx

image: nginx:latest

ports:

- containerPort: 80

```

- 创建一个文件夹,保存下面的代码:

```makefile

apiVersion: v1

kind: Service

metadata:

name: nginx

spec:

selector:

app: nginx

ports:

- protocol: TCP

port: 80

targetPort: 80

type: ClusterIP

```

- 创建一个文件夹,保存下面的代码:

```makefile

apiVersion: v1

kind: Ingress

metadata:

name: nginx-ingress

spec:

rules:

- host: ingress.example.com

http:

paths:

- path: /

backend:

service:

name: nginx

port:

name: http

```

- 创建一个文件夹,保存下面的代码:

```makefile

apiVersion: apps/v1

kind: Deployment

metadata:

name: nginx

spec:

replicas: 2

selector:

matchLabels:

app: nginx

template:

metadata:

labels:

app: nginx

spec:

containers:

- name: nginx

image: nginx:latest

ports:

- containerPort: 80

```

- 创建一个文件夹,保存下面的代码:

```makefile

apiVersion: v1

kind: Service

metadata:

name: nginx

spec:

selector:

app: nginx

ports:

- protocol: TCP

port: 80

targetPort: 80

type: ClusterIP

```

- 创建一个文件夹,保存下面的代码:

```makefile

apiVersion: v1

kind: Ingress

metadata:

name: nginx-ingress

spec:

rules:

- host: ingress.example.com

http:

paths:

- path: /

backend:

service:

name: nginx

port:

name: http

```

- 创建一个文件夹,保存下面的代码:

```makefile

apiVersion: v1

kind: Deployment

metadata:

name: nginx

spec:

replicas: 2

selector:

matchLabels:

app: nginx

template:

metadata:

labels:

app: nginx

spec:

containers:

- name: nginx

image: nginx:latest

ports:

- containerPort: 80

```

- 创建一个文件夹,保存下面的代码:

```makefile

apiVersion: v1

kind: Service

metadata:

name: nginx

spec:

selector:

app: nginx

ports:

- protocol: TCP

port: 80

targetPort: 80

type: ClusterIP

```

- 创建一个文件夹,保存下面的代码:

```makefile

apiVersion: v1

kind: Ingress

metadata:

name: nginx-ingress

spec:

rules:

- host: ingress.example.com

http:

paths:

- path: /

backend:

service:

name: nginx

port:

name: http

```

- 创建一个文件夹,保存下面的代码:

```makefile

apiVersion: apps/v1

kind: Deployment

metadata:

name: nginx

spec:

replicas: 2

selector:

matchLabels:

app: nginx

template:

metadata:

labels:

app: nginx

spec:

containers:

- name: nginx

image: nginx:latest

ports:

- containerPort: 80

```

- 创建一个文件夹,保存下面的代码:

```makefile

apiVersion: v1

kind: Service

metadata:

name: nginx

spec:

selector:

app: nginx

ports:

- protocol: TCP

port: 80

targetPort: 80

type: ClusterIP

```

- 创建一个文件夹,保存下面的代码:

```makefile

apiVersion: v1

kind: Ingress

metadata:

name: nginx-ingress

spec:

rules:

- host: ingress.example.com

http:

paths:

- path: /

backend:

service:

name: nginx

port:

name: http

```

- 创建一个文件夹,保存下面的代码:

```makefile

apiVersion: apps/v1

kind: Deployment

metadata:

name: nginx

spec:

replicas: 2

selector:

matchLabels:

app: nginx

template:

metadata:

labels:

app: nginx

spec:

containers:

- name: nginx

image: nginx:latest

ports:

- containerPort: 80

```

- 创建一个文件夹,保存下面的代码:

```makefile

apiVersion: v1

kind: Service

metadata:

name: nginx

spec:

selector:

app: nginx

ports:

- protocol: TCP

port: 80

targetPort: 80

type: ClusterIP

```

- 创建一个文件夹,保存下面的代码:

```makefile

apiVersion: v1

kind: Ingress

metadata:

name: nginx-ingress

spec:

rules:

- host: ingress.example.com

http:

paths:

- path: /

backend:

service:

name: nginx

port:

name: http

```

- 创建一个文件夹,保存下面的代码:

```makefile

apiVersion: apps/v1

kind: Deployment

metadata:

name: nginx

spec:

replicas: 2

selector:

matchLabels:

app: nginx

template:

metadata:

labels:

app: nginx

spec:

containers:

- name: nginx

image: nginx:latest

ports:

- containerPort: 80

```

- 创建一个文件夹,保存下面的代码:

```makefile

apiVersion: v1

kind: Service

metadata:

name: nginx

spec:

selector:

app: nginx

ports:

- protocol: TCP

port: 80

targetPort: 80

type: ClusterIP

```

- 创建一个文件夹,保存下面的代码:

```makefile

apiVersion: v1

kind: Ingress

metadata:

name: nginx-ingress

spec:

rules:

- host: ingress.example.com

http:

paths:

- path: /

backend:

service:

name: nginx

port:

name: http

```