intro

Kubernetes basics - Secret

Concepts We can regard Secret as encrypted ConfigMap. In order to enabling encryption, we should Future scope: how to encrypted??? Secret We should store the key in base64 encode. Suppose we want to store secret value this_is_value with key key_1. First, we should encode the secret value as follow. $ echo -n "this_is_value" | base64 dGhpc19pc192YWx1ZQ== dGhpc19pc192YWx1ZQ== is base64 encoded this_is_value. Now, make a YAML file. apiVersion: v1 kind: Secrets metadata: name: my-secret data: key_1: dGhpc19pc192YWx1ZQ== Even we try to read a value with kubectl describe secrets it doesn’t return a credential.

Kubernetes basics - ConfigMap

Intro : overried ENTRYPOINT of a DOcker image in k8s We can overried ENTRYPOINT value in a Docker image with command argumanet. CMD can’t be overwrrided by command argument. We have to use args argument instead. https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/ Here is an official sample. pods/commands.yaml apiVersion: v1 kind: Pod metadata: name: command-demo labels: purpose: demonstrate-command spec: containers: - name: command-demo-container image: debian command: ["printenv"] args: ["HOSTNAME", "KUBERNETES_PORT"] restartPolicy: OnFailure Inject environment variable In container section, add env.

Dockerfile

Terminology context: A build’s context is the set of files located in the specified PATH or URL1. Dockerfile sample FROMubuntu:20.04ENV TZ=America/Los_AngelesRUN mkdir -p /home/my_userCOPY ./files/in_home /home/my_user/in_homeARG DEBIAN_FRONTEND=noninteractive RUN apt update && apt upgrade -yRUN apt install -y nginx phpCOPY ./files/nginx/my.conf /etc/nginx/sites-available/my.confRUN ln -s /etc/nginx/sites-available/my.conf /etc/nginx/sites-enabled/my.confCMD ["nginx", "-g", "daemon off;"]Here is the context. . ├── Dockerfile └── files ├── in_home(dir) └── nginx └── my.conf Exec the commands below and run

SpaCy

What is spaCy In README of the GitHub project, there is a discription what is spaCy. spaCy: Industrial-strength NLP spaCy is a library for advanced Natural Language Processing in Python and Cython. It’s built on the very latest research, and was designed from day one to be used in real products. spaCy comes with pretrained statistical models and word vectors, and currently supports tokenization for 50+ languages. It features state-of-the-art speed, convolutional neural network models for tagging, parsing and named entity recognition and easy deep learning integration.

MySQL - Intro

This is a draft page. Connect to MySQL Open your terminal and execute the following. mysql -u root -p mysql: Connect to MySQL. -u root: as user root. -p : with the password. This command prompt you to input the password. After input your password, MySQL prmpt mysql> will appear. Make a normal user Create normal user There are users im MySQL, different from OS user. I recommend to make a new simple user in order to access control.

Docker - intro

Install macOS Environment: macOS 10.15.3 (Intel chip), Mar. 2020. Installing Docker in macOS, the official document seems to recommend installing Docker Desktop with the installer. I don’t need desktop function so far, but this is not so critical when I learn Docker. And it is the easiest way to install Docker CLI in macOS. If you don’t have DockerID, please make it first. Related official Documents: https://docs.docker.com/docker-for-mac/install/ https://hub.

Install Node.js on macOS

Install On Ubuntu 20 https://github.com/nodesource/distributions/blob/master/README.md curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - sudo apt-get install -y nodejs On Ubuntu 20 in GCP (Mar. 2021) curl -fsSL https://deb.nodesource.com/setup_current.x | sudo -E bash - sudo apt-get install -y nodejs On macOS brew update brew install node Check Version check as of March 2020. node --version #v13.10.1 npm --version #6.13.7 Update npm version npm install -g npm@latest