검색

이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 3. Configure OpenShift Container Platform

download PDF

3.1. Overview

This guide introduces you to the basic concepts of OpenShift Container Platform, and helps you configure a basic application. This guide provides the configuration steps following the installation of a basic OpenShift Container Platform environment, and is not suitable for deploying or installing a production environment of OpenShift.

3.2. Change Log In Identity Provider

The default behavior of a freshly installed OpenShift Container Platform instance is to deny any user from logging in. To change the authentication method to HTPasswd:

  1. Open the /etc/origin/master/master-config.yaml file in edit mode.
  2. Find the identityProviders section.
  3. Change DenyAllPasswordIdentityProvider to HTPasswdPasswordIdentityProvider provider.
  4. Change the value of the name label to htpasswd_auth and add a new line file: /etc/origin/openshift-passwd in the provider section.

    An example identityProviders section with HTPasswdPasswordIdentityProvider would look like the following.

    oauthConfig:
      ...
      identityProviders:
      - challenge: true
        login: true
        name: htpasswd_auth provider
        provider:
          apiVersion: v1
          kind: HTPasswdPasswordIdentityProvider
          file: /etc/origin/openshift-passwd
  5. Save the file.

3.3. Create User Accounts

Now that you are using the HTPasswdPasswordIdentityProvider provider, you need to generate these user accounts.

  1. You can use the httpd-tools package to obtain the htpasswd binary that can generate these accounts.

    # yum -y install httpd-tools
  2. Create a user account.

    # touch /etc/origin/openshift-passwd
    # htpasswd -b /etc/origin/openshift-passwd admin redhat

    You have created a user, admin, with the password, redhat.

  3. Restart OpenShift before going forward.

    # systemctl restart atomic-openshift-master-api atomic-openshift-master-controllers
  4. Give this user account cluster-admin privileges, which allows it to do everything.

    $ oc adm policy add-cluster-role-to-user cluster-admin admin

    When running oc adm commands, you should run them only from the first master listed in the Ansible host inventory file, by default /etc/ansible/hosts.

  5. You can use this username/password combination to log in via the web console or the command line. To test this, run the following command.

    $ oc login -u admin

Before going forward, change to the default project.

$ oc project default

For more details, see roles and authentication.

3.4. Deploy the OpenShift Router

The OpenShift router is the entry point for external network traffic destined for OpenShift services. It supports HTTP, HTTPS, and any TLS-enabled traffic that uses SNI, which enables the router to send traffic to the correct service.

Without the router, OpenShift services and pods are unable to communicate with any resource outside of the OpenShift instance.

The installer creates a default router.

  1. Delete the default router using the following command.

    $ oc delete all -l router=router
  2. Create a new default router.

    $ oc adm router --replicas=1 --service-account=router

The OpenShift documentation contains detailed information on Router Overview.

3.5. Deploy an Internal Registry

Openshift provides an internal, integrated Docker registry that can be deployed to locally manage images. OpenShift uses the docker-registry to store, retrieve, and build Docker images, as well as deploy and manage them throughout their lifecycle.

The installer creates a default registry.

Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.